summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2007-02-04 18:59:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2007-02-04 18:59:13 +0000
commit3d970d8fa2cd0f98c5981105afbdbfe9e32ec31a (patch)
tree9afaa147eaad51d3b1178379a16ee1aaac634ae6
parent3b8391b85c3dbad127086d3f3bb4e7a535446145 (diff)
Two libevent fixes from the SVN repo:
allow gotsig to terminate active event loop and evbuffer_find fix. OK brad@ pyr@
-rw-r--r--lib/libevent/buffer.c9
-rw-r--r--lib/libevent/event.c4
-rw-r--r--lib/libevent/event.h4
3 files changed, 10 insertions, 7 deletions
diff --git a/lib/libevent/buffer.c b/lib/libevent/buffer.c
index 4a1ac9f7a29..2c706bb4ff0 100644
--- a/lib/libevent/buffer.c
+++ b/lib/libevent/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.12 2006/12/21 02:28:47 krw Exp $ */
+/* $OpenBSD: buffer.c,v 1.13 2007/02/04 18:59:12 millert Exp $ */
/*
* Copyright (c) 2002, 2003 Niels Provos <provos@citi.umich.edu>
@@ -434,12 +434,13 @@ evbuffer_find(struct evbuffer *buffer, const u_char *what, size_t len)
u_char *search = buffer->buffer;
u_char *p;
- while ((p = memchr(search, *what, remain)) != NULL && remain >= len) {
+ while ((p = memchr(search, *what, remain)) != NULL) {
+ remain = buffer->off - (size_t)(search - buffer->buffer);
+ if (remain < len)
+ break;
if (memcmp(p, what, len) == 0)
return (p);
-
search = p + 1;
- remain = buffer->off - (size_t)(search - buffer->buffer);
}
return (NULL);
diff --git a/lib/libevent/event.c b/lib/libevent/event.c
index 13049b286c9..7012da54447 100644
--- a/lib/libevent/event.c
+++ b/lib/libevent/event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.c,v 1.14 2006/11/05 03:39:40 brad Exp $ */
+/* $OpenBSD: event.c,v 1.15 2007/02/04 18:59:12 millert Exp $ */
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
@@ -303,6 +303,8 @@ event_process_active(struct event_base *base)
ncalls--;
ev->ev_ncalls = ncalls;
(*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg);
+ if (event_gotsig)
+ return;
}
}
}
diff --git a/lib/libevent/event.h b/lib/libevent/event.h
index 1c8d29a2203..5791b16c9bf 100644
--- a/lib/libevent/event.h
+++ b/lib/libevent/event.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.h,v 1.15 2006/03/30 06:32:36 brad Exp $ */
+/* $OpenBSD: event.h,v 1.16 2007/02/04 18:59:12 millert Exp $ */
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
@@ -42,7 +42,7 @@ extern "C" {
typedef unsigned char u_char;
#endif
-#define LIBEVENT_VERSION "1.1a"
+#define LIBEVENT_VERSION "1.1b"
#define EVLIST_TIMEOUT 0x01
#define EVLIST_INSERTED 0x02