Skip to content

Commit

Permalink
use of CMD_* instead of magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Oct 2, 2018
1 parent e6902ee commit 2fec844
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/remote/codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ class SecurityPluginMessageTransportSender : public TransportSender {
}

void send(ByteBuffer* buffer, TransportSendControl* control) {
control->startMessage((int8)5, 0);
control->startMessage(CMD_AUTHNZ, 0);
SerializationHelper::serializeFull(buffer, control, _data);
// send immediately
control->flush(true);
Expand Down
2 changes: 1 addition & 1 deletion src/remote/pv/codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class BlockingTCPTransportCodec:
}

virtual void processControlMessage() OVERRIDE FINAL {
if (_command == 2)
if (_command == CMD_SET_ENDIANESS)
{
// check 7-th bit
setByteOrder(_flags < 0 ? EPICS_ENDIAN_BIG : EPICS_ENDIAN_LITTLE);
Expand Down
2 changes: 1 addition & 1 deletion src/server/beaconEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void BeaconEmitter::send(ByteBuffer* buffer, TransportSendControl* control)
}

// send beacon
control->startMessage((int8)0, 12+2+2+16+2);
control->startMessage((int8)CMD_BEACON, 12+2+2+16+2);

buffer->put(_guid.value, 0, sizeof(_guid.value));

Expand Down
4 changes: 2 additions & 2 deletions src/server/responseHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void ServerChannelFindRequesterImpl::channelFindResult(const Status& /*status*/,

void ServerChannelFindRequesterImpl::send(ByteBuffer* buffer, TransportSendControl* control)
{
control->startMessage((int8)4, 12+4+16+2);
control->startMessage(CMD_SEARCH_RESPONSE, 12+4+16+2);

Lock guard(_mutex);
buffer->put(_guid.value, 0, sizeof(_guid.value));
Expand Down Expand Up @@ -1802,7 +1802,7 @@ void ServerChannelPutGetRequesterImpl::send(ByteBuffer* buffer, TransportSendCon
return;
}

control->startMessage((int32)12, sizeof(int32)/sizeof(int8) + 1);
control->startMessage(CMD_PUT_GET, sizeof(int32)/sizeof(int8) + 1);
buffer->putInt(_ioid);
buffer->putByte((int8)request);
{
Expand Down

0 comments on commit 2fec844

Please sign in to comment.