Skip to content

Commit

Permalink
Avoid data() as it is c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieAkeroyd authored and anjohnson committed Nov 1, 2023
1 parent d4bb595 commit 55ab0fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/server/pv/responseHandlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,19 @@ class EchoTransportSender : public TransportSender {
EchoTransportSender(osiSockAddr* echoFrom, size_t payloadSize, epics::pvData::ByteBuffer& payloadBuffer) {
memcpy(&_echoFrom, echoFrom, sizeof(osiSockAddr));
toEcho.resize(payloadSize);
payloadBuffer.getArray(toEcho.data(), payloadSize);
if (payloadSize) {
payloadBuffer.getArray(&toEcho[0], payloadSize);
}
}

virtual ~EchoTransportSender() {}

virtual void send(epics::pvData::ByteBuffer* buffer, TransportSendControl* control) OVERRIDE FINAL {
control->startMessage(CMD_ECHO, toEcho.size(), toEcho.size());
control->setRecipient(_echoFrom);
buffer->putArray<char>(toEcho.data(), toEcho.size());
if (toEcho.size() > 0) {
buffer->putArray<char>(&toEcho[0], toEcho.size());
}
}

private:
Expand Down

0 comments on commit 55ab0fd

Please sign in to comment.