aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou/sendbuf.h
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-01 16:36:37 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-01 16:36:37 +0100
commitc112e5013454b48c9f05b3ac2153656cdcf549a4 (patch)
treeee34f55863ae900c045f42c9540153f43b7b37fd /libglouglou/sendbuf.h
parentwork in progress on implementing a send buffer (diff)
downloadglouglou-c112e5013454b48c9f05b3ac2153656cdcf549a4.tar.xz
glouglou-c112e5013454b48c9f05b3ac2153656cdcf549a4.zip
work in progress on sendbuf
Diffstat (limited to 'libglouglou/sendbuf.h')
-rw-r--r--libglouglou/sendbuf.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/libglouglou/sendbuf.h b/libglouglou/sendbuf.h
index 90dc4bc..340e1c7 100644
--- a/libglouglou/sendbuf.h
+++ b/libglouglou/sendbuf.h
@@ -1,4 +1,5 @@
#include <event.h>
+#include <sys/queue.h>
struct sendbuf {
struct event_base *ev_base;
@@ -6,16 +7,23 @@ struct sendbuf {
struct timeval ev_timer_tv;
int sndbuf_max;
int msec_max;
- int (*send_func)(void *, int, void *);
- void *usrdata;
+};
+
+struct sendbuf_queue {
void *buffer;
int buffer_size;
int buffer_pos;
+ int (*send_func)(void *, int, void *);
+ void *usrdata;
int flushing;
int flushed_len;
-};
+}
-struct sendbuf *sendbuf_init(struct event_base *, int, int,
- int (*send_func)(void *, int, void *), void *);
+struct sendbuf *sendbuf_init(struct event_base *, int, int, int);
void sendbuf_shutdown(struct sendbuf *);
-void *sendbuf_gettoken(struct sendbuf *, int);
+void sendbuf_queue_add(struct sendbuf *,
+ int (*send_func)(void *, int, void *),
+ void *);
+void *sendbuf_token_get(struct sendbuf *, int);
+void sendbuf_token_ready(struct sendbuf *, void *);
+