From e89fb4a92938af624c9d408495ffa05e15eee960 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 24 Dec 2015 23:39:24 +0000 Subject: [PATCH] Minor re-arrangement of fields and code documentation improvements. --- control.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/control.h b/control.h index 42ba5a7..616c728 100644 --- a/control.h +++ b/control.h @@ -41,22 +41,25 @@ class ControlConn struct ev_io iob; struct ev_loop *loop; ServiceSet *service_set; - char * iobuf; - int bufidx; bool bad_conn_close; // close when finished output? bool oom_close; // send final 'out of memory' indicator + + // The packet length before we need to re-check if the packet is complete. + // processPacket() will not be called until the packet reaches this size. + int chklen; + + char * iobuf; + int bufidx; template using list = std::list; template using vector = std::vector; // Buffer for outgoing packets. Each outgoing back is represented as a vector. list> outbuf; + // Current index within the first outgoing packet (all previous bytes have been sent). unsigned outpkt_index = 0; - // The packet length before we need to re-check if the packet is complete - int chklen; - // Queue a packet to be sent // Returns: true if the packet was successfully queued, false if otherwise // (eg if out of memory); in the latter case the connection might -- 2.25.1