From 4707fca02e54bc5fd620f3db4b73c45b9467bb41 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Wed, 30 Dec 2015 00:29:09 +0000 Subject: [PATCH] Include desired state of service in SERVICERECORD packets. --- control.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/control.cc b/control.cc index cfe029e..c54bbc2 100644 --- a/control.cc +++ b/control.cc @@ -67,7 +67,7 @@ void ControlConn::processFindLoad(int pktType) uint16_t svcSize; rbuf.extract((char *)&svcSize, 1, 2); - chklen = svcSize + 3; + chklen = svcSize + 3; // packet type + (2 byte) length + service name if (svcSize <= 0 || chklen > 1024) { // Queue error response / mark connection bad char badreqRep[] = { DINIT_RP_BADREQ }; @@ -104,12 +104,13 @@ void ControlConn::processFindLoad(int pktType) // Allocate a service handle handle_t handle = allocateServiceHandle(record); std::vector rp_buf; - rp_buf.reserve(6); + rp_buf.reserve(7); rp_buf.push_back(DINIT_RP_SERVICERECORD); rp_buf.push_back(static_cast(record->getState())); for (int i = 0; i < (int) sizeof(handle); i++) { rp_buf.push_back(*(((char *) &handle) + i)); } + rp_buf.push_back(static_cast(record->getTargetState())); if (! queuePacket(std::move(rp_buf))) return; } else { -- 2.25.1