diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-02 05:54:31 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-02 05:54:31 +0100 |
commit | 5e67a4962e242e05776d731a7cb6f5cdd5cfd9da (patch) | |
tree | fcd38b9334320b977eca2cfbda5c050f6a87050a /libglouglou/sendbuf.h | |
parent | work in progress on sendbuf (diff) | |
download | glouglou-5e67a4962e242e05776d731a7cb6f5cdd5cfd9da.tar.xz glouglou-5e67a4962e242e05776d731a7cb6f5cdd5cfd9da.zip |
work in progress for sendbuf support.
now it compiles :)
Diffstat (limited to 'libglouglou/sendbuf.h')
-rw-r--r-- | libglouglou/sendbuf.h | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/libglouglou/sendbuf.h b/libglouglou/sendbuf.h index 340e1c7..0290202 100644 --- a/libglouglou/sendbuf.h +++ b/libglouglou/sendbuf.h @@ -3,27 +3,21 @@ struct sendbuf { struct event_base *ev_base; - struct event *ev_timer; - struct timeval ev_timer_tv; - int sndbuf_max; + struct event *ev_timer; + struct timeval ev_timer_tv; int msec_max; -}; - -struct sendbuf_queue { - void *buffer; int buffer_size; - int buffer_pos; + void *buffer; + int buffer_pos; /* next to use in buffer */ + int flushing; + int flushing_pos; /* next to send in buffer */ int (*send_func)(void *, int, void *); void *usrdata; - int flushing; - int flushed_len; -} - -struct sendbuf *sendbuf_init(struct event_base *, int, int, int); -void sendbuf_shutdown(struct sendbuf *); -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 *); +}; +struct sendbuf *sendbuf_new(struct event_base *, int, int, + int (*send_func)(void *, int, void *), + void *); +void sendbuf_free(struct sendbuf *); +int sendbuf_append(struct sendbuf *, void *, int); +void *sendbuf_gettoken(struct sendbuf *, int); |