Hello,
In bufferevent_read_pressure_cb() function, the second argument (which
is size_t old) is not used. Here's a patch which removes it.
Regards,
Charles Longeau
Index: trunk/libevent/evbuffer.c
===================================================================
--- trunk/libevent/evbuffer.c (revision 502)
+++ trunk/libevent/evbuffer.c (working copy)
@@ -53,7 +53,7 @@
/* prototypes */
void bufferevent_setwatermark(struct bufferevent *, short, size_t, size_t);
-void bufferevent_read_pressure_cb(struct evbuffer *, size_t, size_t, void *);
+void bufferevent_read_pressure_cb(struct evbuffer *, size_t, void *);
static int
bufferevent_add(struct event *ev, int timeout)
@@ -75,8 +75,8 @@
*/
void
-bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
- void *arg) {
+bufferevent_read_pressure_cb(struct evbuffer *buf, size_t now, void *arg)
+{
struct bufferevent *bufev = arg;
/*
* If we are below the watermark then reschedule reading if it's
@@ -401,7 +401,7 @@
/* If the watermarks changed then see if we should call read again */
bufferevent_read_pressure_cb(bufev->input,
- 0, EVBUFFER_LENGTH(bufev->input), bufev);
+ EVBUFFER_LENGTH(bufev->input), bufev);
}
int
Index: trunk/libevent/buffer.c
===================================================================
--- trunk/libevent/buffer.c (revision 502)
+++ trunk/libevent/buffer.c (working copy)
@@ -116,9 +116,9 @@
* of data that we transfered from inbuf to outbuf
*/
if (inbuf->off != oldoff && inbuf->cb != NULL)
- (*inbuf->cb)(inbuf, oldoff, inbuf->off, inbuf->cbarg);
+ (*inbuf->cb)(inbuf, inbuf->off, inbuf->cbarg);
if (oldoff && outbuf->cb != NULL)
- (*outbuf->cb)(outbuf, 0, oldoff, outbuf->cbarg);
+ (*outbuf->cb)(outbuf, oldoff, outbuf->cbarg);
return (0);
}
@@ -137,7 +137,6 @@
{
char *buffer;
size_t space;
- size_t oldoff = buf->off;
int sz;
va_list aq;
@@ -168,7 +167,7 @@
if (sz < space) {
buf->off += sz;
if (buf->cb != NULL)
- (*buf->cb)(buf, oldoff, buf->off, buf->cbarg);
+ (*buf->cb)(buf, buf->off, buf->cbarg);
return (sz);
}
if (evbuffer_expand(buf, sz + 1) == -1)
@@ -305,7 +304,6 @@
evbuffer_add(struct evbuffer *buf, const void *data, size_t datlen)
{
size_t need = buf->misalign + buf->off + datlen;
- size_t oldoff = buf->off;
if (buf->totallen < need) {
if (evbuffer_expand(buf, datlen) == -1)
@@ -316,7 +314,7 @@
buf->off += datlen;
if (datlen && buf->cb != NULL)
- (*buf->cb)(buf, oldoff, buf->off, buf->cbarg);
+ (*buf->cb)(buf, buf->off, buf->cbarg);
return (0);
}
@@ -341,7 +339,7 @@
done:
/* Tell someone about changes in this buffer */
if (buf->off != oldoff && buf->cb != NULL)
- (*buf->cb)(buf, oldoff, buf->off, buf->cbarg);
+ (*buf->cb)(buf, buf->off, buf->cbarg);
}
@@ -404,7 +402,7 @@
/* Tell someone about changes in this buffer */
if (buf->off != oldoff && buf->cb != NULL)
- (*buf->cb)(buf, oldoff, buf->off, buf->cbarg);
+ (*buf->cb)(buf, buf->off, buf->cbarg);
return (n);
}
@@ -447,7 +445,7 @@
}
void evbuffer_setcb(struct evbuffer *buffer,
- void (*cb)(struct evbuffer *, size_t, size_t, void *),
+ void (*cb)(struct evbuffer *, size_t, void *),
void *cbarg)
{
buffer->cb = cb;
Index: trunk/libevent/event.h
===================================================================
--- trunk/libevent/event.h (revision 502)
+++ trunk/libevent/event.h (working copy)
@@ -660,7 +660,7 @@
size_t totallen;
size_t off;
- void (*cb)(struct evbuffer *, size_t, size_t, void *);
+ void (*cb)(struct evbuffer *, size_t, void *);
void *cbarg;
};
@@ -997,7 +997,7 @@
@param cb the callback function to invoke when the evbuffer is modified
@param cbarg an argument to be provided to the callback function
*/
-void evbuffer_setcb(struct evbuffer *, void (*)(struct evbuffer *, size_t,
size_t, void *), void *);
+void evbuffer_setcb(struct evbuffer *, void (*)(struct evbuffer *, size_t,
void *), void *);
/*
* Marshaling tagged data - We assume that all tags are inserted in their
_______________________________________________
Libevent-users mailing list
[email protected]
http://monkeymail.org/mailman/listinfo/libevent-users