aboutsummaryrefslogtreecommitdiffhomepage
path: root/env_universal_common.h
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-10-07 04:45:39 +1000
committerGravatar axel <axel@liljencrantz.se>2006-10-07 04:45:39 +1000
commit184d58cd360569fa44aa088dab3421b832313424 (patch)
tree7c14112c444f009f138b33e77d5b8a354991e60a /env_universal_common.h
parentbcf3024cf01f4b2d14b38de8fc24372d7b4e9127 (diff)
Buffer calls to read() in the universal variable code
darcs-hash:20061006184539-ac50b-d8ecc4c45d0caae12cd60e32515a1218b37831d3.gz
Diffstat (limited to 'env_universal_common.h')
-rw-r--r--env_universal_common.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/env_universal_common.h b/env_universal_common.h
index 1f669bee..e116a15f 100644
--- a/env_universal_common.h
+++ b/env_universal_common.h
@@ -50,6 +50,11 @@ enum
;
/**
+ The size of the buffer used for reading from the socket
+*/
+#define ENV_UNIVERSAL_BUFFER_SIZE 1024
+
+/**
This struct represents a connection between a universal variable server/client
*/
typedef struct connection
@@ -77,6 +82,22 @@ typedef struct connection
string_buffer_t input;
/**
+ The read buffer.
+ */
+ char buffer[ENV_UNIVERSAL_BUFFER_SIZE];
+
+ /**
+ Number of bytes that have already been consumed.
+ */
+ int buffer_consumed;
+
+ /**
+ Number of bytes that have been read into the buffer.
+ */
+ int buffer_used;
+
+
+ /**
Link to the next connection
*/
struct connection *next;