]> git.meshlink.io Git - utcp/blobdiff - utcp_priv.h
Fix and refactor send buffer code.
[utcp] / utcp_priv.h
index d73d664d51e9981c82150e7766a98de0dd76fed9..b9979539465a7ac7e5cbae1b9e5c3258fc8a445a 100644 (file)
@@ -71,6 +71,13 @@ static const char *strstate[] __attribute__((unused)) = {
        [TIME_WAIT] = "TIME_WAIT"
 };
 
+struct buffer {
+       char *data;
+       uint32_t used;
+       uint32_t size;
+       uint32_t maxsize;
+};
+
 struct utcp_connection {
        void *priv;
        struct utcp *utcp;
@@ -113,9 +120,7 @@ struct utcp_connection {
 
        // Send buffer
 
-       char *sndbuf;
-       uint32_t sndbufsize;
-       uint32_t maxsndbufsize;
+       struct buffer sndbuf;
 
        // Per-socket options