Module Name:    src
Committed By:   spz
Date:           Thu Jan 29 07:26:03 UTC 2015

Modified Files:
        src/external/bsd/libevent: libevent2netbsd
        src/external/bsd/libevent/dist: buffer.c bufferevent.c
            evbuffer-internal.h evdns.c event.c event_tagging.c evrpc.c
            evutil.c evutil_rand.c http.c log-internal.h log.c ltmain.sh
            util-internal.h
        src/external/bsd/libevent/dist/include/event2: rpc.h util.h
        src/external/bsd/libevent/dist/test: regress.c regress.h
            regress_buffer.c regress_http.c
        src/external/bsd/libevent/include/event2: event-config.h
        src/external/bsd/libevent/man: buffer.h.3 buffer_compat.h.3
            bufferevent.3 bufferevent_ssl.h.3 deprecated.3 dns.h.3
            dns_compat.h.3 evbuffer_cb_info.3 evbuffer_iovec.3 evbuffer_ptr.3
            event.h.3 event_base.3 event_compat.h.3 event_config.3
            evthread_condition_callbacks.3 evthread_lock_callbacks.3
            evutil_addrinfo.3 http.h.3 http_compat.h.3 rpc.h.3 rpc_compat.h.3
            tag.h.3 tag_compat.h.3 thread.h.3 util.h.3

Log Message:
merge and update manpages and include/event2/event-config.h
May need extra fixing around log-internal.h and log.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libevent/libevent2netbsd
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/buffer.c \
    src/external/bsd/libevent/dist/bufferevent.c \
    src/external/bsd/libevent/dist/evbuffer-internal.h \
    src/external/bsd/libevent/dist/evdns.c \
    src/external/bsd/libevent/dist/event.c \
    src/external/bsd/libevent/dist/event_tagging.c \
    src/external/bsd/libevent/dist/evrpc.c \
    src/external/bsd/libevent/dist/evutil_rand.c \
    src/external/bsd/libevent/dist/http.c \
    src/external/bsd/libevent/dist/log.c \
    src/external/bsd/libevent/dist/util-internal.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libevent/dist/evutil.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/log-internal.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/libevent/dist/ltmain.sh
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libevent/dist/include/event2/rpc.h \
    src/external/bsd/libevent/dist/include/event2/util.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/libevent/dist/test/regress.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libevent/dist/test/regress.h \
    src/external/bsd/libevent/dist/test/regress_buffer.c \
    src/external/bsd/libevent/dist/test/regress_http.c
cvs rdiff -u -r1.1 -r1.2 \
    src/external/bsd/libevent/include/event2/event-config.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/libevent/man/buffer.h.3 \
    src/external/bsd/libevent/man/buffer_compat.h.3 \
    src/external/bsd/libevent/man/bufferevent.3 \
    src/external/bsd/libevent/man/bufferevent_ssl.h.3 \
    src/external/bsd/libevent/man/deprecated.3 \
    src/external/bsd/libevent/man/dns.h.3 \
    src/external/bsd/libevent/man/dns_compat.h.3 \
    src/external/bsd/libevent/man/evbuffer_cb_info.3 \
    src/external/bsd/libevent/man/evbuffer_iovec.3 \
    src/external/bsd/libevent/man/evbuffer_ptr.3 \
    src/external/bsd/libevent/man/event.h.3 \
    src/external/bsd/libevent/man/event_base.3 \
    src/external/bsd/libevent/man/event_compat.h.3 \
    src/external/bsd/libevent/man/event_config.3 \
    src/external/bsd/libevent/man/evthread_condition_callbacks.3 \
    src/external/bsd/libevent/man/evthread_lock_callbacks.3 \
    src/external/bsd/libevent/man/evutil_addrinfo.3 \
    src/external/bsd/libevent/man/http.h.3 \
    src/external/bsd/libevent/man/http_compat.h.3 \
    src/external/bsd/libevent/man/rpc.h.3 \
    src/external/bsd/libevent/man/rpc_compat.h.3 \
    src/external/bsd/libevent/man/tag.h.3 \
    src/external/bsd/libevent/man/tag_compat.h.3 \
    src/external/bsd/libevent/man/thread.h.3 \
    src/external/bsd/libevent/man/util.h.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libevent/libevent2netbsd
diff -u src/external/bsd/libevent/libevent2netbsd:1.1 src/external/bsd/libevent/libevent2netbsd:1.2
--- src/external/bsd/libevent/libevent2netbsd:1.1	Thu Apr 11 16:56:11 2013
+++ src/external/bsd/libevent/libevent2netbsd	Thu Jan 29 07:26:02 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: libevent2netbsd,v 1.1 2013/04/11 16:56:11 christos Exp $
+# $NetBSD: libevent2netbsd,v 1.2 2015/01/29 07:26:02 spz Exp $
 
 # Extract the new tarball and rename the libevent-X.Y.Z directory
 # to dist.  Run this script and check for additional files and
@@ -43,6 +43,11 @@ if [ -f $d/configure ]; then
 #endif
 	d
 }
+/_EVENT_SIZEOF_LONG_LONG/ {
+	a\
+#define _EVENT_SIZEOF_LONG_LONG 8
+	d
+}
 /_EVENT_SIZEOF_LONG/ {
 	a\
 #ifdef _LP64\

Index: src/external/bsd/libevent/dist/buffer.c
diff -u src/external/bsd/libevent/dist/buffer.c:1.2 src/external/bsd/libevent/dist/buffer.c:1.3
--- src/external/bsd/libevent/dist/buffer.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/buffer.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: buffer.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: buffer.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2002-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -28,7 +28,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: buffer.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: buffer.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifdef WIN32
 #include <winsock2.h>
@@ -88,7 +88,7 @@ __RCSID("$NetBSD: buffer.c,v 1.2 2013/04
 #include "event2/thread.h"
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: buffer.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: buffer.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 #include "log-internal.h"
 #include "mm-internal.h"
 #include "util-internal.h"
@@ -162,12 +162,20 @@ evbuffer_chain_new(size_t size)
 	struct evbuffer_chain *chain;
 	size_t to_alloc;
 
+	if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE)
+		return (NULL);
+
 	size += EVBUFFER_CHAIN_SIZE;
 
 	/* get the next largest memory that can hold the buffer */
-	to_alloc = MIN_BUFFER_SIZE;
-	while (to_alloc < size)
-		to_alloc <<= 1;
+	if (size < EVBUFFER_CHAIN_MAX / 2) {
+		to_alloc = MIN_BUFFER_SIZE;
+		while (to_alloc < size) {
+			to_alloc <<= 1;
+		}
+	} else {
+		to_alloc = size;
+	}
 
 	/* we get everything in one chunk */
 	if ((chain = mm_malloc(to_alloc)) == NULL)
@@ -1007,6 +1015,7 @@ evbuffer_drain(struct evbuffer *buf, siz
 
 		buf->first = chain;
 		if (chain) {
+			EVUTIL_ASSERT(remaining <= chain->off);
 			chain->misalign += remaining;
 			chain->off -= remaining;
 		}
@@ -1073,6 +1082,7 @@ evbuffer_copyout(struct evbuffer *buf, v
 
 	if (datlen) {
 		EVUTIL_ASSERT(chain);
+		EVUTIL_ASSERT(datlen <= chain->off);
 		memcpy(data, chain->buffer + chain->misalign, datlen);
 	}
 
@@ -1548,6 +1558,10 @@ evbuffer_add(struct evbuffer *buf, const
 	if (buf->freeze_end) {
 		goto done;
 	}
+	/* Prevent buf->total_len overflow */
+	if (datlen > EV_SIZE_MAX - buf->total_len) {
+		goto done;
+	}
 
 	chain = buf->last;
 
@@ -1561,7 +1575,10 @@ evbuffer_add(struct evbuffer *buf, const
 	}
 
 	if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
-		remain = (size_t)(chain->buffer_len - chain->misalign - chain->off);
+		/* Always true for mutable buffers */
+		EVUTIL_ASSERT(chain->misalign >= 0 &&
+		    (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX);
+		remain = chain->buffer_len - (size_t)chain->misalign - chain->off;
 		if (remain >= datlen) {
 			/* there's enough space to hold all the data in the
 			 * current last chain */
@@ -1632,6 +1649,9 @@ evbuffer_prepend(struct evbuffer *buf, c
 	if (buf->freeze_start) {
 		goto done;
 	}
+	if (datlen > EV_SIZE_MAX - buf->total_len) {
+		goto done;
+	}
 
 	chain = buf->first;
 
@@ -1644,6 +1664,10 @@ evbuffer_prepend(struct evbuffer *buf, c
 
 	/* we cannot touch immutable buffers */
 	if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
+		/* Always true for mutable buffers */
+		EVUTIL_ASSERT(chain->misalign >= 0 &&
+		    (ev_uint64_t)chain->misalign <= EVBUFFER_CHAIN_MAX);
+
 		/* If this chain is empty, we can treat it as
 		 * 'empty at the beginning' rather than 'empty at the end' */
 		if (chain->off == 0)
@@ -1681,6 +1705,7 @@ evbuffer_prepend(struct evbuffer *buf, c
 	tmp->next = chain;
 
 	tmp->off = datlen;
+	EVUTIL_ASSERT(datlen <= tmp->buffer_len);
 	tmp->misalign = tmp->buffer_len - datlen;
 
 	memcpy(tmp->buffer + tmp->misalign, data, datlen);
@@ -1779,7 +1804,9 @@ evbuffer_expand_singlechain(struct evbuf
 
 	/* Would expanding this chunk be affordable and worthwhile? */
 	if (CHAIN_SPACE_LEN(chain) < chain->buffer_len / 8 ||
-	    chain->off > MAX_TO_COPY_IN_EXPAND) {
+	    chain->off > MAX_TO_COPY_IN_EXPAND ||
+	    (datlen < EVBUFFER_CHAIN_MAX &&
+		EVBUFFER_CHAIN_MAX - datlen >= chain->off)) {
 		/* It's not worth resizing this chain. Can the next one be
 		 * used? */
 		if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) {
@@ -1907,6 +1934,8 @@ _evbuffer_expand_fast(struct evbuffer *b
 			rmv_all = 1;
 			avail = 0;
 		} else {
+			/* can't overflow, since only mutable chains have
+			 * huge misaligns. */
 			avail = (size_t) CHAIN_SPACE_LEN(chain);
 			chain = chain->next;
 		}
@@ -1917,6 +1946,7 @@ _evbuffer_expand_fast(struct evbuffer *b
 			EVUTIL_ASSERT(chain->off == 0);
 			evbuffer_chain_free(chain);
 		}
+		EVUTIL_ASSERT(datlen >= avail);
 		tmp = evbuffer_chain_new(datlen - avail);
 		if (tmp == NULL) {
 			if (rmv_all) {
@@ -2046,6 +2076,7 @@ get_n_bytes_readable_on_socket(evutil_so
 	unsigned long lng = EVBUFFER_MAX_READ;
 	if (ioctlsocket(fd, FIONREAD, &lng) < 0)
 		return -1;
+	/* Can overflow, but mostly harmlessly. XXXX */
 	return (int)lng;
 #elif defined(FIONREAD)
 	int n = EVBUFFER_MAX_READ;
@@ -2158,8 +2189,14 @@ evbuffer_read(struct evbuffer *buf, evut
 #ifdef USE_IOVEC_IMPL
 	remaining = n;
 	for (i=0; i < nvecs; ++i) {
-		ev_ssize_t space = (ev_ssize_t) CHAIN_SPACE_LEN(*chainp);
-		if (space < remaining) {
+		/* can't overflow, since only mutable chains have
+		 * huge misaligns. */
+		size_t space = (size_t) CHAIN_SPACE_LEN(*chainp);
+		/* XXXX This is a kludge that can waste space in perverse
+		 * situations. */
+		if (space > EVBUFFER_CHAIN_MAX)
+			space = EVBUFFER_CHAIN_MAX;
+		if ((ev_ssize_t)space < remaining) {
 			(*chainp)->off += space;
 			remaining -= (int)space;
 		} else {
@@ -2368,9 +2405,11 @@ evbuffer_write_atmost(struct evbuffer *b
 		/* XXX(nickm) Don't disable this code until we know if
 		 * the WSARecv code above works. */
 		void *p = evbuffer_pullup(buffer, howmuch);
+		EVUTIL_ASSERT(p || !howmuch);
 		n = send(fd, p, howmuch, 0);
 #else
 		void *p = evbuffer_pullup(buffer, howmuch);
+		EVUTIL_ASSERT(p || !howmuch);
 		n = write(fd, p, howmuch);
 #endif
 #ifdef USE_SENDFILE
@@ -2430,12 +2469,17 @@ evbuffer_ptr_set(struct evbuffer *buf, s
 	case EVBUFFER_PTR_ADD:
 		/* this avoids iterating over all previous chains if
 		   we just want to advance the position */
+		if (pos->pos < 0 || EV_SIZE_MAX - position < (size_t)pos->pos) {
+			EVBUFFER_UNLOCK(buf);
+			return -1;
+		}
 		chain = pos->_internal.chain;
 		pos->pos += position;
 		position = pos->_internal.pos_in_chain;
 		break;
 	}
 
+	EVUTIL_ASSERT(EV_SIZE_MAX - left >= position);
 	while (chain && position + left >= chain->off) {
 		left -= chain->off - position;
 		chain = chain->next;
@@ -2468,7 +2512,9 @@ evbuffer_ptr_memcmp(const struct evbuffe
 
 	ASSERT_EVBUFFER_LOCKED(buf);
 
-	if (pos->pos + len > buf->total_len)
+	if (pos->pos < 0 ||
+	    EV_SIZE_MAX - len < (size_t)pos->pos ||
+	    pos->pos + len > buf->total_len)
 		return -1;
 
 	chain = pos->_internal.chain;
@@ -2592,7 +2638,10 @@ evbuffer_peek(struct evbuffer *buffer, e
 	if (n_vec == 0 && len < 0) {
 		/* If no vectors are provided and they asked for "everything",
 		 * pretend they asked for the actual available amount. */
-		len = buffer->total_len - len_so_far;
+		len = buffer->total_len;
+		if (start_at) {
+			len -= start_at->pos;
+		}
 	}
 
 	while (chain) {
@@ -2656,6 +2705,9 @@ evbuffer_add_vprintf(struct evbuffer *bu
 
 		if (sz < 0)
 			goto done;
+		if (INT_MAX >= EVBUFFER_CHAIN_MAX &&
+		    (size_t)sz >= EVBUFFER_CHAIN_MAX)
+			goto done;
 		if ((size_t)sz < space) {
 			chain->off += sz;
 			buf->total_len += sz;
@@ -2749,6 +2801,11 @@ evbuffer_add_file(struct evbuffer *outbu
 #endif
 	int ok = 1;
 
+	if (offset < 0 || length < 0 ||
+	    ((ev_uint64_t)length > EVBUFFER_CHAIN_MAX) ||
+	    (ev_uint64_t)offset > (ev_uint64_t)(EVBUFFER_CHAIN_MAX - length))
+		return (-1);
+
 #if defined(USE_SENDFILE)
 	if (use_sendfile) {
 		EVBUFFER_LOCK(outbuf);
@@ -2837,7 +2894,7 @@ evbuffer_add_file(struct evbuffer *outbu
 	{
 		/* the default implementation */
 		struct evbuffer *tmp = evbuffer_new();
-		ev_ssize_t nread;
+		ev_ssize_t read;
 
 		if (tmp == NULL)
 			return (-1);
@@ -2854,13 +2911,14 @@ evbuffer_add_file(struct evbuffer *outbu
 		 * can abort without side effects if the read fails.
 		 */
 		while (length) {
-			nread = evbuffer_readfile(tmp, fd, (ev_ssize_t)length);
-			if (nread == -1) {
+			ev_ssize_t to_read = length > EV_SSIZE_MAX ? EV_SSIZE_MAX : (ev_ssize_t)length;
+			read = evbuffer_readfile(tmp, fd, to_read);
+			if (read == -1) {
 				evbuffer_free(tmp);
 				return (-1);
 			}
 
-			length -= nread;
+			length -= read;
 		}
 
 		EVBUFFER_LOCK(outbuf);
Index: src/external/bsd/libevent/dist/bufferevent.c
diff -u src/external/bsd/libevent/dist/bufferevent.c:1.2 src/external/bsd/libevent/dist/bufferevent.c:1.3
--- src/external/bsd/libevent/dist/bufferevent.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/bufferevent.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufferevent.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: bufferevent.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2002-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson
@@ -30,7 +30,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bufferevent.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: bufferevent.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifdef _EVENT_HAVE_SYS_TIME_H
 #include <sys/time.h>
@@ -548,7 +548,7 @@ bufferevent_setwatermark(struct bufferev
 				      bufev_private->read_watermarks_cb,
 				      EVBUFFER_CB_ENABLED|EVBUFFER_CB_NODEFER);
 
-			if (evbuffer_get_length(bufev->input) > highmark)
+			if (evbuffer_get_length(bufev->input) >= highmark)
 				bufferevent_wm_suspend_read(bufev);
 			else if (evbuffer_get_length(bufev->input) < highmark)
 				bufferevent_wm_unsuspend_read(bufev);
Index: src/external/bsd/libevent/dist/evbuffer-internal.h
diff -u src/external/bsd/libevent/dist/evbuffer-internal.h:1.2 src/external/bsd/libevent/dist/evbuffer-internal.h:1.3
--- src/external/bsd/libevent/dist/evbuffer-internal.h:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/evbuffer-internal.h	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: evbuffer-internal.h,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: evbuffer-internal.h,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2000-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -154,6 +154,18 @@ struct evbuffer {
 	struct bufferevent *parent;
 };
 
+#if _EVENT_SIZEOF_OFF_T < _EVENT_SIZEOF_SIZE_T
+typedef ev_ssize_t ev_misalign_t;
+#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX)
+#else
+typedef ev_off_t ev_misalign_t;
+#if _EVENT_SIZEOF_OFF_T > _EVENT_SIZEOF_SIZE_T
+#define EVBUFFER_CHAIN_MAX EV_SIZE_MAX
+#else
+#define EVBUFFER_CHAIN_MAX ((size_t)EV_SSIZE_MAX)
+#endif
+#endif
+
 /** A single item in an evbuffer. */
 struct evbuffer_chain {
 	/** points to next buffer in the chain */
@@ -164,7 +176,7 @@ struct evbuffer_chain {
 
 	/** unused space at the beginning of buffer or an offset into a
 	 * file for sendfile buffers. */
-	ev_off_t misalign;
+	ev_misalign_t misalign;
 
 	/** Offset into buffer + misalign at which to start writing.
 	 * In other words, the total number of bytes actually stored
Index: src/external/bsd/libevent/dist/evdns.c
diff -u src/external/bsd/libevent/dist/evdns.c:1.2 src/external/bsd/libevent/dist/evdns.c:1.3
--- src/external/bsd/libevent/dist/evdns.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/evdns.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: evdns.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: evdns.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /* Copyright 2006-2007 Niels Provos
  * Copyright 2007-2012 Nick Mathewson and Niels Provos
  *
@@ -52,7 +52,7 @@
 #include <sys/types.h>
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: evdns.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: evdns.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifndef _FORTIFY_SOURCE
 #define _FORTIFY_SOURCE 3
@@ -730,21 +730,29 @@ request_reissue(struct request *req) {
 
 /* this function looks for space on the inflight queue and promotes */
 /* requests from the waiting queue if it can. */
+/* */
+/* TODO: */
+/* add return code, see at nameserver_pick() and other functions. */
 static void
 evdns_requests_pump_waiting_queue(struct evdns_base *base) {
 	ASSERT_LOCKED(base);
 	while (base->global_requests_inflight < base->global_max_requests_inflight &&
 		   base->global_requests_waiting) {
 		struct request *req;
-		/* move a request from the waiting queue to the inflight queue */
+
 		EVUTIL_ASSERT(base->req_waiting_head);
 		req = base->req_waiting_head;
+
+		req->ns = nameserver_pick(base);
+		if (!req->ns)
+			return;
+
+		/* move a request from the waiting queue to the inflight queue */
 		evdns_request_remove(req, &base->req_waiting_head);
 
 		base->global_requests_waiting--;
 		base->global_requests_inflight++;
 
-		req->ns = nameserver_pick(base);
 		request_trans_id_set(req, transaction_id_pick(base));
 
 		evdns_request_insert(req, &REQ_HEAD(base, req->trans_id));
@@ -1686,7 +1694,7 @@ evdns_request_data_build(const char *con
 
 /* exported function */
 struct evdns_server_port *
-evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t sock, int flags, evdns_request_callback_fn_type cb, void *user_data)
+evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data)
 {
 	struct evdns_server_port *port;
 	if (flags)
@@ -1696,7 +1704,7 @@ evdns_add_server_port_with_base(struct e
 	memset(port, 0, sizeof(struct evdns_server_port));
 
 
-	port->socket = sock;
+	port->socket = socket;
 	port->refcnt = 1;
 	port->choked = 0;
 	port->closing = 0;
@@ -1717,9 +1725,9 @@ evdns_add_server_port_with_base(struct e
 }
 
 struct evdns_server_port *
-evdns_add_server_port(evutil_socket_t sock, int flags, evdns_request_callback_fn_type cb, void *user_data)
+evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data)
 {
-	return evdns_add_server_port_with_base(NULL, sock, flags, cb, user_data);
+	return evdns_add_server_port_with_base(NULL, socket, flags, cb, user_data);
 }
 
 /* exported function */
@@ -2218,6 +2226,12 @@ evdns_request_transmit(struct request *r
 	req->transmit_me = 1;
 	EVUTIL_ASSERT(req->trans_id != 0xffff);
 
+	if (!req->ns)
+	{
+		/* unable to transmit request if no nameservers */
+		return 1;
+	}
+
 	if (req->ns->choked) {
 		/* don't bother trying to write to a socket */
 		/* which we have had EAGAIN from */
@@ -2438,6 +2452,7 @@ evdns_base_resume(struct evdns_base *bas
 	EVDNS_LOCK(base);
 	evdns_requests_pump_waiting_queue(base);
 	EVDNS_UNLOCK(base);
+
 	return 0;
 }
 
@@ -3934,6 +3949,10 @@ evdns_nameserver_free(struct nameserver 
 	event_debug_unassign(&server->event);
 	if (server->state == 0)
 		(void) event_del(&server->timeout_event);
+	if (server->probe_request) {
+		evdns_cancel_request(server->base, server->probe_request);
+		server->probe_request = NULL;
+	}
 	event_debug_unassign(&server->timeout_event);
 	mm_free(server);
 }
@@ -3949,6 +3968,15 @@ evdns_base_free_and_unlock(struct evdns_
 
 	/* TODO(nickm) we might need to refcount here. */
 
+	for (server = base->server_head; server; server = server_next) {
+		server_next = server->next;
+		evdns_nameserver_free(server);
+		if (server_next == base->server_head)
+			break;
+	}
+	base->server_head = NULL;
+	base->global_good_nameservers = 0;
+
 	for (i = 0; i < base->n_req_heads; ++i) {
 		while (base->req_heads[i]) {
 			if (fail_requests)
@@ -3963,14 +3991,6 @@ evdns_base_free_and_unlock(struct evdns_
 	}
 	base->global_requests_inflight = base->global_requests_waiting = 0;
 
-	for (server = base->server_head; server; server = server_next) {
-		server_next = server->next;
-		evdns_nameserver_free(server);
-		if (server_next == base->server_head)
-			break;
-	}
-	base->server_head = NULL;
-	base->global_good_nameservers = 0;
 
 	if (base->global_search_state) {
 		for (dom = base->global_search_state->head; dom; dom = dom_next) {
Index: src/external/bsd/libevent/dist/event.c
diff -u src/external/bsd/libevent/dist/event.c:1.2 src/external/bsd/libevent/dist/event.c:1.3
--- src/external/bsd/libevent/dist/event.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/event.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: event.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2000-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -27,7 +27,7 @@
  */
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: event.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: event.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifdef WIN32
 #include <winsock2.h>
@@ -1259,6 +1259,14 @@ done:
 static inline void
 event_persist_closure(struct event_base *base, struct event *ev)
 {
+	// Define our callback, we use this to store our callback before it's executed
+	void (*evcb_callback)(evutil_socket_t, short, void *);
+
+        // Other fields of *ev that must be stored before executing
+        evutil_socket_t evcb_fd;
+        short evcb_res;
+        void *evcb_arg;
+
 	/* reschedule the persistent event if we have a timeout. */
 	if (ev->ev_io_timeout.tv_sec || ev->ev_io_timeout.tv_usec) {
 		/* If there was a timeout, we want it to run at an interval of
@@ -1300,8 +1308,18 @@ event_persist_closure(struct event_base 
 		run_at.tv_usec |= usec_mask;
 		event_add_internal(ev, &run_at, 1);
 	}
-	EVBASE_RELEASE_LOCK(base, th_base_lock);
-	(*ev->ev_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg);
+
+	// Save our callback before we release the lock
+	evcb_callback = ev->ev_callback;
+        evcb_fd = ev->ev_fd;
+        evcb_res = ev->ev_res;
+        evcb_arg = ev->ev_arg;
+
+	// Release the lock
+ 	EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+	// Execute the callback
+        (evcb_callback)(evcb_fd, evcb_res, evcb_arg);
 }
 
 /*
Index: src/external/bsd/libevent/dist/event_tagging.c
diff -u src/external/bsd/libevent/dist/event_tagging.c:1.2 src/external/bsd/libevent/dist/event_tagging.c:1.3
--- src/external/bsd/libevent/dist/event_tagging.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/event_tagging.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: event_tagging.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: event_tagging.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2003-2009 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
@@ -28,7 +28,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: event_tagging.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: event_tagging.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifdef _EVENT_HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -209,6 +209,8 @@ decode_tag_internal(ev_uint32_t *ptag, s
 	 */
 	data = evbuffer_pullup(
 		evbuf, len < sizeof(number) + 1 ? len : sizeof(number) + 1);
+	if (!data)
+		return (-1);
 
 	while (count++ < len) {
 		ev_uint8_t lower = *data++;
@@ -315,6 +317,8 @@ do {									\
 									\
 	/* XXX(niels): faster? */					\
 	data = evbuffer_pullup(evbuf, offset + 1) + offset;		\
+	if (!data)							\
+		return (-1);						\
 									\
 	nibbles = ((data[0] & 0xf0) >> 4) + 1;				\
 	if (nibbles > maxnibbles || (nibbles >> 1) + 1 > len)		\
@@ -322,6 +326,8 @@ do {									\
 	len = (nibbles >> 1) + 1;					\
 									\
 	data = evbuffer_pullup(evbuf, offset + len) + offset;		\
+	if (!data)							\
+		return (-1);						\
 									\
 	while (nibbles > 0) {						\
 		number <<= 4;						\
Index: src/external/bsd/libevent/dist/evrpc.c
diff -u src/external/bsd/libevent/dist/evrpc.c:1.2 src/external/bsd/libevent/dist/evrpc.c:1.3
--- src/external/bsd/libevent/dist/evrpc.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/evrpc.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: evrpc.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: evrpc.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2000-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -27,7 +27,7 @@
  */
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: evrpc.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: evrpc.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifdef WIN32
 #define WIN32_LEAN_AND_MEAN
@@ -96,16 +96,16 @@ evrpc_free(struct evrpc_base *base)
 {
 	struct evrpc *rpc;
 	struct evrpc_hook *hook;
-	struct evrpc_hook_ctx *paused;
+	struct evrpc_hook_ctx *pause;
 	int r;
 
 	while ((rpc = TAILQ_FIRST(&base->registered_rpcs)) != NULL) {
 		r = evrpc_unregister_rpc(base, rpc->uri);
 		EVUTIL_ASSERT(r == 0);
 	}
-	while ((paused = TAILQ_FIRST(&base->paused_requests)) != NULL) {
-		TAILQ_REMOVE(&base->paused_requests, paused, next);
-		mm_free(paused);
+	while ((pause = TAILQ_FIRST(&base->paused_requests)) != NULL) {
+		TAILQ_REMOVE(&base->paused_requests, pause, next);
+		mm_free(pause);
 	}
 	while ((hook = TAILQ_FIRST(&base->input_hooks)) != NULL) {
 		r = evrpc_remove_hook(base, EVRPC_INPUT, hook);
@@ -544,7 +544,7 @@ evrpc_pool_free(struct evrpc_pool *pool)
 {
 	struct evhttp_connection *connection;
 	struct evrpc_request_wrapper *request;
-	struct evrpc_hook_ctx *paused;
+	struct evrpc_hook_ctx *pause;
 	struct evrpc_hook *hook;
 	int r;
 
@@ -553,9 +553,9 @@ evrpc_pool_free(struct evrpc_pool *pool)
 		evrpc_request_wrapper_free(request);
 	}
 
-	while ((paused = TAILQ_FIRST(&pool->paused_requests)) != NULL) {
-		TAILQ_REMOVE(&pool->paused_requests, paused, next);
-		mm_free(paused);
+	while ((pause = TAILQ_FIRST(&pool->paused_requests)) != NULL) {
+		TAILQ_REMOVE(&pool->paused_requests, pause, next);
+		mm_free(pause);
 	}
 
 	while ((connection = TAILQ_FIRST(&pool->connections)) != NULL) {
@@ -769,14 +769,14 @@ evrpc_pause_request(void *vbase, void *c
     void (*cb)(void *, enum EVRPC_HOOK_RESULT))
 {
 	struct _evrpc_hooks *base = vbase;
-	struct evrpc_hook_ctx *paused = mm_malloc(sizeof(*paused));
-	if (paused == NULL)
+	struct evrpc_hook_ctx *pause = mm_malloc(sizeof(*pause));
+	if (pause == NULL)
 		return (-1);
 
-	paused->ctx = ctx;
-	paused->cb = cb;
+	pause->ctx = ctx;
+	pause->cb = cb;
 
-	TAILQ_INSERT_TAIL(&base->pause_requests, paused, next);
+	TAILQ_INSERT_TAIL(&base->pause_requests, pause, next);
 	return (0);
 }
 
@@ -785,19 +785,19 @@ evrpc_resume_request(void *vbase, void *
 {
 	struct _evrpc_hooks *base = vbase;
 	struct evrpc_pause_list *head = &base->pause_requests;
-	struct evrpc_hook_ctx *paused;
+	struct evrpc_hook_ctx *pause;
 
-	TAILQ_FOREACH(paused, head, next) {
-		if (paused->ctx == ctx)
+	TAILQ_FOREACH(pause, head, next) {
+		if (pause->ctx == ctx)
 			break;
 	}
 
-	if (paused == NULL)
+	if (pause == NULL)
 		return (-1);
 
-	(*paused->cb)(paused->ctx, res);
-	TAILQ_REMOVE(head, paused, next);
-	mm_free(paused);
+	(*pause->cb)(pause->ctx, res);
+	TAILQ_REMOVE(head, pause, next);
+	mm_free(pause);
 	return (0);
 }
 
Index: src/external/bsd/libevent/dist/evutil_rand.c
diff -u src/external/bsd/libevent/dist/evutil_rand.c:1.2 src/external/bsd/libevent/dist/evutil_rand.c:1.3
--- src/external/bsd/libevent/dist/evutil_rand.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/evutil_rand.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: evutil_rand.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: evutil_rand.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
  *
@@ -35,7 +35,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: evutil_rand.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: evutil_rand.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #include <limits.h>
 
@@ -46,6 +46,12 @@ __RCSID("$NetBSD: evutil_rand.c,v 1.2 20
 #include <stdlib.h>
 #include <string.h>
 int
+evutil_secure_rng_set_urandom_device_file(char *fname)
+{
+	(void) fname;
+	return -1;
+}
+int
 evutil_secure_rng_init(void)
 {
 	/* call arc4random() now to force it to self-initialize */
@@ -60,12 +66,11 @@ evutil_secure_rng_global_setup_locks_(co
 }
 
 static void
-/*ARGSUED*/
+/*ARGSUSED*/
 ev_arc4random_buf(void *buf, size_t n)
 {
 #if defined(_EVENT_HAVE_ARC4RANDOM_BUF) && !defined(__APPLE__)
-	arc4random_buf(buf, n);
-	return;
+	return arc4random_buf(buf, n);
 #else
 	unsigned char *b = buf;
 
@@ -76,8 +81,12 @@ ev_arc4random_buf(void *buf, size_t n)
 	 * and fall back otherwise.  (OSX does this using some linker
 	 * trickery.)
 	 */
-	if (arc4random_buf != NULL) {
-		return arc4random_buf(buf, n);
+	{
+		void (*tptr)(void *,size_t) =
+		    (void (*)(void*,size_t))arc4random_buf;
+		if (tptr != NULL) {
+			return arc4random_buf(buf, n);
+		}
 	}
 #endif
 	/* Make sure that we start out with b at a 4-byte alignment; plenty
@@ -130,6 +139,18 @@ evutil_secure_rng_global_setup_locks_(co
 #endif
 
 int
+/*ARGSUSED*/
+evutil_secure_rng_set_urandom_device_file(char *fname)
+{
+#ifdef TRY_SEED_URANDOM
+	_ARC4_LOCK();
+	arc4random_urandom_filename = fname;
+	_ARC4_UNLOCK();
+#endif
+	return 0;
+}
+
+int
 evutil_secure_rng_init(void)
 {
 	int val;
Index: src/external/bsd/libevent/dist/http.c
diff -u src/external/bsd/libevent/dist/http.c:1.2 src/external/bsd/libevent/dist/http.c:1.3
--- src/external/bsd/libevent/dist/http.c:1.2	Thu Apr 11 16:56:41 2013
+++ src/external/bsd/libevent/dist/http.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: http.c,v 1.2 2013/04/11 16:56:41 christos Exp $	*/
+/*	$NetBSD: http.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2002-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -28,7 +28,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: http.c,v 1.2 2013/04/11 16:56:41 christos Exp $");
+__RCSID("$NetBSD: http.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifdef _EVENT_HAVE_SYS_PARAM_H
 #include <sys/param.h>
@@ -386,8 +386,6 @@ evhttp_write_buffer(struct evhttp_connec
 	evcon->cb = cb;
 	evcon->cb_arg = arg;
 
-	bufferevent_enable(evcon->bufev, EV_WRITE);
-
 	/* Disable the read callback: we don't actually care about data;
 	 * we only care about close detection.  (We don't disable reading,
 	 * since we *do* want to learn about any close events.) */
@@ -396,6 +394,8 @@ evhttp_write_buffer(struct evhttp_connec
 	    evhttp_write_cb,
 	    evhttp_error_cb,
 	    evcon);
+
+	bufferevent_enable(evcon->bufev, EV_WRITE);
 }
 
 static void
@@ -2184,6 +2184,8 @@ evhttp_connection_get_peer(struct evhttp
 int
 evhttp_connection_connect(struct evhttp_connection *evcon)
 {
+	int old_state = evcon->state;
+
 	if (evcon->state == EVCON_CONNECTING)
 		return (0);
 
@@ -2212,8 +2214,11 @@ evhttp_connection_connect(struct evhttp_
 	/* make sure that we get a write callback */
 	bufferevent_enable(evcon->bufev, EV_WRITE);
 
+	evcon->state = EVCON_CONNECTING;
+
 	if (bufferevent_socket_connect_hostname(evcon->bufev, evcon->dns_base,
 		AF_UNSPEC, evcon->address, evcon->port) < 0) {
+		evcon->state = old_state;
 		event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed",
 		    __func__, evcon->address);
 		/* some operating systems return ECONNREFUSED immediately
@@ -2224,8 +2229,6 @@ evhttp_connection_connect(struct evhttp_
 		return (0);
 	}
 
-	evcon->state = EVCON_CONNECTING;
-
 	return (0);
 }
 
Index: src/external/bsd/libevent/dist/log.c
diff -u src/external/bsd/libevent/dist/log.c:1.2 src/external/bsd/libevent/dist/log.c:1.3
--- src/external/bsd/libevent/dist/log.c:1.2	Tue Jan  7 02:09:01 2014
+++ src/external/bsd/libevent/dist/log.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.c,v 1.2 2014/01/07 02:09:01 joerg Exp $	*/
+/*	$NetBSD: log.c,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*	$OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $	*/
 
 /*
@@ -40,7 +40,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: log.c,v 1.2 2014/01/07 02:09:01 joerg Exp $");
+__RCSID("$NetBSD: log.c,v 1.3 2015/01/29 07:26:02 spz Exp $");
 
 #ifdef WIN32
 #include <winsock2.h>
@@ -60,7 +60,7 @@ __RCSID("$NetBSD: log.c,v 1.2 2014/01/07
 #include "log-internal.h"
 
 static void _warn_helper(int severity, const char *errstr, const char *fmt,
-    va_list ap) EV_CHECK_FMT(3, 0);
+    va_list ap);
 static void event_log(int severity, const char *msg);
 static void event_exit(int errcode) EV_NORETURN;
 
Index: src/external/bsd/libevent/dist/util-internal.h
diff -u src/external/bsd/libevent/dist/util-internal.h:1.2 src/external/bsd/libevent/dist/util-internal.h:1.3
--- src/external/bsd/libevent/dist/util-internal.h:1.2	Thu Apr 11 16:56:42 2013
+++ src/external/bsd/libevent/dist/util-internal.h	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: util-internal.h,v 1.2 2013/04/11 16:56:42 christos Exp $	*/
+/*	$NetBSD: util-internal.h,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
  *
@@ -62,7 +62,7 @@ extern "C" {
  */
 #define _EVUTIL_NIL_CONDITION(condition) do { \
 	(void)sizeof(!(condition));  \
-} while (/*CONSTCOND*/0)
+} while(/*CONSTCOND*/0)
 
 /* Internal use only: macros to match patterns of error codes in a
    cross-platform way.  We need these macros because of two historical
@@ -321,6 +321,8 @@ HANDLE evutil_load_windows_system_librar
 #endif
 #endif
 
+void evutil_memclear_(void *mem, size_t len);
+
 #ifdef __cplusplus
 }
 #endif

Index: src/external/bsd/libevent/dist/evutil.c
diff -u src/external/bsd/libevent/dist/evutil.c:1.4 src/external/bsd/libevent/dist/evutil.c:1.5
--- src/external/bsd/libevent/dist/evutil.c:1.4	Fri Apr 12 20:02:00 2013
+++ src/external/bsd/libevent/dist/evutil.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: evutil.c,v 1.4 2013/04/12 20:02:00 christos Exp $	*/
+/*	$NetBSD: evutil.c,v 1.5 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
  *
@@ -27,7 +27,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: evutil.c,v 1.4 2013/04/12 20:02:00 christos Exp $");
+__RCSID("$NetBSD: evutil.c,v 1.5 2015/01/29 07:26:02 spz Exp $");
 
 #define _GNU_SOURCE
 
@@ -262,7 +262,6 @@ evutil_ersatz_socketpair(int family, int
 		goto tidy_up_and_fail;
 	if (size != sizeof(listen_addr))
 		goto abort_tidy_up_and_fail;
-	evutil_closesocket(listener);
 	/* Now check we are talking to ourself by matching port and host on the
 	   two sockets.	 */
 	if (getsockname(connector, (struct sockaddr *) &connect_addr, &size) == -1)
@@ -272,6 +271,7 @@ evutil_ersatz_socketpair(int family, int
 		|| listen_addr.sin_addr.s_addr != connect_addr.sin_addr.s_addr
 		|| listen_addr.sin_port != connect_addr.sin_port)
 		goto abort_tidy_up_and_fail;
+	evutil_closesocket(listener);
 	fd[0] = connector;
 	fd[1] = acceptor;
 
@@ -1565,7 +1565,7 @@ evutil_vsnprintf(char *buf, size_t bufle
 	int r;
 	if (!buflen)
 		return 0;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(WIN32)
 	r = _vsnprintf(buf, buflen, format, ap);
 	if (r < 0)
 		r = _vscprintf(format, ap);
@@ -2112,6 +2112,18 @@ _evutil_weakrand(void)
 #endif
 }
 
+/**
+ * Volatile pointer to memset: we use this to keep the compiler from
+ * eliminating our call to memset.
+ */
+void * (*volatile evutil_memset_volatile_)(void *, int, size_t) = memset;
+
+void
+evutil_memclear_(void *mem, size_t len)
+{
+	evutil_memset_volatile_(mem, 0, len);
+}
+
 int
 evutil_sockaddr_is_loopback(const struct sockaddr *addr)
 {

Index: src/external/bsd/libevent/dist/log-internal.h
diff -u src/external/bsd/libevent/dist/log-internal.h:1.3 src/external/bsd/libevent/dist/log-internal.h:1.4
--- src/external/bsd/libevent/dist/log-internal.h:1.3	Tue Jan  7 02:09:01 2014
+++ src/external/bsd/libevent/dist/log-internal.h	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: log-internal.h,v 1.3 2014/01/07 02:09:01 joerg Exp $	*/
+/*	$NetBSD: log-internal.h,v 1.4 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2000-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -31,7 +31,7 @@
 #include "event2/util.h"
 
 #ifdef __GNUC__
-#define EV_CHECK_FMT(a,b) __attribute__((__format__(__printf__, a, b)))
+#define EV_CHECK_FMT(a,b) __attribute__((format(printf, a, b)))
 #define EV_NORETURN __attribute__((noreturn))
 #else
 #define EV_CHECK_FMT(a,b)
@@ -55,4 +55,6 @@ void _event_debugx(const char *fmt, ...)
 #define event_debug(x) do {;} while (/*CONSTCOND*/0)
 #endif
 
+#undef EV_CHECK_FMT
+
 #endif

Index: src/external/bsd/libevent/dist/ltmain.sh
diff -u src/external/bsd/libevent/dist/ltmain.sh:1.1.1.1 src/external/bsd/libevent/dist/ltmain.sh:1.2
--- src/external/bsd/libevent/dist/ltmain.sh:1.1.1.1	Thu Apr 11 16:43:27 2013
+++ src/external/bsd/libevent/dist/ltmain.sh	Thu Jan 29 07:26:02 2015
@@ -4269,7 +4269,7 @@ int setenv (const char *, const char *, 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
   if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
+} while (/*CONSTCOND*/0)
 
 #if defined(LT_DEBUGWRAPPER)
 static int lt_debug = 1;

Index: src/external/bsd/libevent/dist/include/event2/rpc.h
diff -u src/external/bsd/libevent/dist/include/event2/rpc.h:1.2 src/external/bsd/libevent/dist/include/event2/rpc.h:1.3
--- src/external/bsd/libevent/dist/include/event2/rpc.h:1.2	Thu Apr 11 16:56:42 2013
+++ src/external/bsd/libevent/dist/include/event2/rpc.h	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc.h,v 1.2 2013/04/11 16:56:42 christos Exp $	*/
+/*	$NetBSD: rpc.h,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2006-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
Index: src/external/bsd/libevent/dist/include/event2/util.h
diff -u src/external/bsd/libevent/dist/include/event2/util.h:1.2 src/external/bsd/libevent/dist/include/event2/util.h:1.3
--- src/external/bsd/libevent/dist/include/event2/util.h:1.2	Thu Apr 11 16:56:42 2013
+++ src/external/bsd/libevent/dist/include/event2/util.h	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.h,v 1.2 2013/04/11 16:56:42 christos Exp $	*/
+/*	$NetBSD: util.h,v 1.3 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
  *
@@ -216,18 +216,18 @@ extern "C" {
 
    @{
 */
-#define EV_UINT64_MAX UINT64_MAX
-#define EV_INT64_MAX  INT64_MAX
-#define EV_INT64_MIN  INT64_MIN
-#define EV_UINT32_MAX UINT32_MAX
-#define EV_INT32_MAX  INT32_MAX
-#define EV_INT32_MIN  INT32_MIN
-#define EV_UINT16_MAX UINT16_MAX
-#define EV_INT16_MAX  INT16_MAX
-#define EV_INT16_MIN  INT16_MIN
-#define EV_UINT8_MAX  UINT8_MAX
-#define EV_INT8_MAX   INT8_MAX
-#define EV_INT8_MIN   INT8_MIN
+#define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)
+#define EV_INT64_MAX  ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)
+#define EV_INT64_MIN  ((-EV_INT64_MAX) - 1)
+#define EV_UINT32_MAX ((ev_uint32_t)0xffffffffUL)
+#define EV_INT32_MAX  ((ev_int32_t) 0x7fffffffL)
+#define EV_INT32_MIN  ((-EV_INT32_MAX) - 1)
+#define EV_UINT16_MAX ((ev_uint16_t)0xffffUL)
+#define EV_INT16_MAX  ((ev_int16_t) 0x7fffL)
+#define EV_INT16_MIN  ((-EV_INT16_MAX) - 1)
+#define EV_UINT8_MAX  255
+#define EV_INT8_MAX   127
+#define EV_INT8_MIN   ((-EV_INT8_MAX) - 1)
 /** @} */
 
 /**
@@ -235,9 +235,20 @@ extern "C" {
 
    @{
 */
-#define EV_SIZE_MAX SIZE_MAX
-#define EV_SSIZE_MAX SSIZE_MAX
-#define EV_SSIZE_MIN SSIZE_MIN
+#if _EVENT_SIZEOF_SIZE_T == 8
+#define EV_SIZE_MAX EV_UINT64_MAX
+#define EV_SSIZE_MAX EV_INT64_MAX
+#elif _EVENT_SIZEOF_SIZE_T == 4
+#define EV_SIZE_MAX EV_UINT32_MAX
+#define EV_SSIZE_MAX EV_INT32_MAX
+#elif defined(_EVENT_IN_DOXYGEN)
+#define EV_SIZE_MAX ...
+#define EV_SSIZE_MAX ...
+#else
+#error "No way to define SIZE_MAX"
+#endif
+
+#define EV_SSIZE_MIN ((-EV_SSIZE_MAX) - 1)
 /**@}*/
 
 #ifdef WIN32
@@ -319,7 +330,7 @@ int evutil_closesocket(evutil_socket_t s
 #define EVUTIL_SOCKET_ERROR() WSAGetLastError()
 /** Replace the most recent socket error with errcode */
 #define EVUTIL_SET_SOCKET_ERROR(errcode)		\
-	do { WSASetLastError(errcode); } while (/*CONSTCOND*/0)
+	do { WSASetLastError(errcode); } while (0)
 /** Return the most recent socket error to occur on sock. */
 int evutil_socket_geterror(evutil_socket_t sock);
 /** Convert a socket error to a string. */
@@ -351,7 +362,7 @@ const char *evutil_socket_error_to_strin
 #else
 #define EVUTIL_SOCKET_ERROR() (errno)
 #define EVUTIL_SET_SOCKET_ERROR(errcode)		\
-		do { errno = (errcode); } while (/*CONSTCOND*/0)
+		do { errno = (errcode); } while (0)
 #define evutil_socket_geterror(sock) (errno)
 #define evutil_socket_error_to_string(errcode) (strerror(errcode))
 #endif
@@ -377,7 +388,7 @@ const char *evutil_socket_error_to_strin
 			(vvp)->tv_sec++;				\
 			(vvp)->tv_usec -= 1000000;			\
 		}							\
-	} while (/*CONSTCOND*/0)
+	} while (0)
 #define	evutil_timersub(tvp, uvp, vvp)					\
 	do {								\
 		(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;		\
@@ -386,7 +397,7 @@ const char *evutil_socket_error_to_strin
 			(vvp)->tv_sec--;				\
 			(vvp)->tv_usec += 1000000;			\
 		}							\
-	} while (/*CONSTCOND*/0)
+	} while (0)
 #endif /* !_EVENT_HAVE_HAVE_TIMERADD */
 
 #ifdef _EVENT_HAVE_TIMERCLEAR
@@ -638,9 +649,12 @@ const char *evutil_gai_strerror(int err)
 
 /** Generate n bytes of secure pseudorandom data, and store them in buf.
  *
- * By default, Libevent uses an ARC4-based random number generator, seeded
- * using the platform's entropy source (/dev/urandom on Unix-like systems;
- * CryptGenRandom on Windows).
+ * Current versions of Libevent use an ARC4-based random number generator,
+ * seeded using the platform's entropy source (/dev/urandom on Unix-like
+ * systems; CryptGenRandom on Windows).  This is not actually as secure as it
+ * should be: ARC4 is a pretty lousy cipher, and the current implementation
+ * provides only rudimentary prediction- and backtracking-resistance.  Don't
+ * use this for serious cryptographic applications.
  */
 void evutil_secure_rng_get_bytes(void *buf, size_t n);
 
@@ -662,6 +676,21 @@ void evutil_secure_rng_get_bytes(void *b
  */
 int evutil_secure_rng_init(void);
 
+/**
+ * Set a filename to use in place of /dev/urandom for seeding the secure
+ * PRNG. Return 0 on success, -1 on failure.
+ *
+ * Call this function BEFORE calling any other initialization or RNG
+ * functions.
+ *
+ * (This string will _NOT_ be copied internally. Do not free it while any
+ * user of the secure RNG might be running. Don't pass anything other than a
+ * real /dev/...random device file here, or you might lose security.)
+ *
+ * This API is unstable, and might change in a future libevent version.
+ */
+int evutil_secure_rng_set_urandom_device_file(char *fname);
+
 /** Seed the random number generator with extra random bytes.
 
     You should almost never need to call this function; it should be

Index: src/external/bsd/libevent/dist/test/regress.c
diff -u src/external/bsd/libevent/dist/test/regress.c:1.7 src/external/bsd/libevent/dist/test/regress.c:1.8
--- src/external/bsd/libevent/dist/test/regress.c:1.7	Fri Apr 12 17:50:27 2013
+++ src/external/bsd/libevent/dist/test/regress.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: regress.c,v 1.7 2013/04/12 17:50:27 christos Exp $	*/
+/*	$NetBSD: regress.c,v 1.8 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2003-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -33,7 +33,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: regress.c,v 1.7 2013/04/12 17:50:27 christos Exp $");
+__RCSID("$NetBSD: regress.c,v 1.8 2015/01/29 07:26:02 spz Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1369,7 +1369,7 @@ test_loopexit(void)
 	evtimer_add(&ev, &tv);
 
 	tv.tv_usec = 0;
-	tv.tv_sec = SECONDS;
+	tv.tv_sec = 1;
 	event_loopexit(&tv);
 
 	evutil_gettimeofday(&tv_start, NULL);

Index: src/external/bsd/libevent/dist/test/regress.h
diff -u src/external/bsd/libevent/dist/test/regress.h:1.3 src/external/bsd/libevent/dist/test/regress.h:1.4
--- src/external/bsd/libevent/dist/test/regress.h:1.3	Thu Feb 27 18:11:04 2014
+++ src/external/bsd/libevent/dist/test/regress.h	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: regress.h,v 1.3 2014/02/27 18:11:04 joerg Exp $	*/
+/*	$NetBSD: regress.h,v 1.4 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2000-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -112,7 +112,7 @@ int _test_ai_eq(const struct evutil_addr
 	} while (/*CONSTCOND*/0)
 
 #define test_timeval_diff_leq(tv1, tv2, diff, tolerance)		\
-	tt_int_op(imaxabs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance)
+	tt_int_op(abs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance)
 
 #define test_timeval_diff_eq(tv1, tv2, diff)				\
 	test_timeval_diff_leq((tv1), (tv2), (diff), 50)
Index: src/external/bsd/libevent/dist/test/regress_buffer.c
diff -u src/external/bsd/libevent/dist/test/regress_buffer.c:1.3 src/external/bsd/libevent/dist/test/regress_buffer.c:1.4
--- src/external/bsd/libevent/dist/test/regress_buffer.c:1.3	Sat Jan  4 02:56:31 2014
+++ src/external/bsd/libevent/dist/test/regress_buffer.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: regress_buffer.c,v 1.3 2014/01/04 02:56:31 joerg Exp $	*/
+/*	$NetBSD: regress_buffer.c,v 1.4 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2003-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -33,7 +33,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: regress_buffer.c,v 1.3 2014/01/04 02:56:31 joerg Exp $");
+__RCSID("$NetBSD: regress_buffer.c,v 1.4 2015/01/29 07:26:02 spz Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -992,7 +992,9 @@ test_evbuffer_iterative(void *ptr)
 	n = 0;
 	for (i = 0; i < 1000; ++i) {
 		for (j = 1; j < strlen(abc); ++j) {
-			evbuffer_add_printf(buf, "%*.*s", j, j, abc);
+			char format[32];
+			evutil_snprintf(format, sizeof(format), "%%%u.%us", j, j);
+			evbuffer_add_printf(buf, fmtcheck(format, "%s"), abc);
 
 			/* Only check for rep violations every so often.
 			   Walking over the whole list of chains can get
Index: src/external/bsd/libevent/dist/test/regress_http.c
diff -u src/external/bsd/libevent/dist/test/regress_http.c:1.3 src/external/bsd/libevent/dist/test/regress_http.c:1.4
--- src/external/bsd/libevent/dist/test/regress_http.c:1.3	Thu Apr 11 16:56:42 2013
+++ src/external/bsd/libevent/dist/test/regress_http.c	Thu Jan 29 07:26:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: regress_http.c,v 1.3 2013/04/11 16:56:42 christos Exp $	*/
+/*	$NetBSD: regress_http.c,v 1.4 2015/01/29 07:26:02 spz Exp $	*/
 /*
  * Copyright (c) 2003-2007 Niels Provos <pro...@citi.umich.edu>
  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
@@ -34,7 +34,7 @@
 
 #include "event2/event-config.h"
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: regress_http.c,v 1.3 2013/04/11 16:56:42 christos Exp $");
+__RCSID("$NetBSD: regress_http.c,v 1.4 2015/01/29 07:26:02 spz Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2008,7 +2008,7 @@ http_parse_uri_test(void *ptr)
 	tt_want(ret == url_tmp);					\
 	if (strcmp(ret,want) != 0)					\
 		TT_FAIL(("\"%s\" != \"%s\"",ret,want));			\
-	} while (/*CONSTCOND*/0)
+	} while(/*CONSTCOND*/0)
 
 	tt_want(evhttp_uri_join(NULL, 0, 0) == NULL);
 	tt_want(evhttp_uri_join(NULL, url_tmp, 0) == NULL);
@@ -2018,7 +2018,7 @@ http_parse_uri_test(void *ptr)
 #define BAD(s) do {							\
 		if (URI_PARSE(s) != NULL)				\
 			TT_FAIL(("Expected error parsing \"%s\"",s));	\
-	} while (/*CONSTCOND*/0)
+	} while(/*CONSTCOND*/0)
 	/* Nonconformant URIs we can parse: parsing */
 #define NCF(s) do {							\
 		uri = URI_PARSE(s);					\
@@ -2033,7 +2033,7 @@ http_parse_uri_test(void *ptr)
 				sizeof(url_tmp)));			\
 			evhttp_uri_free(uri);				\
 		}							\
-	} while (/*CONSTCOND*/0)
+	} while(/*CONSTCOND*/0)
 
 	NCF("http://www.test.com/ why hello");
 	NCF("http://www.test.com/why-hello\x01";);
@@ -3017,16 +3017,21 @@ http_stream_in_cancel_test(void *arg)
 static void
 http_connection_fail_done(struct evhttp_request *req, void *arg)
 {
+       struct evhttp_connection *evcon = arg;
+       struct event_base *base = evhttp_connection_get_base(evcon);
+
        /* An ENETUNREACH error results in an unrecoverable
         * evhttp_connection error (see evhttp_connection_fail()).  The
         * connection will be reset, and the user will be notified with a NULL
         * req parameter. */
        tt_assert(!req);
 
+       evhttp_connection_free(evcon);
+
        test_ok = 1;
 
  end:
-       event_base_loopexit(arg, NULL);
+       event_base_loopexit(base, NULL);
 }
 
 /* Test unrecoverable evhttp_connection errors by generating an ENETUNREACH
@@ -3057,7 +3062,7 @@ http_connection_fail_test(void *arg)
         * server using our make request method.
         */
 
-       req = evhttp_request_new(http_connection_fail_done, data->base);
+       req = evhttp_request_new(http_connection_fail_done, evcon);
        tt_assert(req);
 
        if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/") == -1) {
@@ -3069,8 +3074,7 @@ http_connection_fail_test(void *arg)
        tt_int_op(test_ok, ==, 1);
 
  end:
-       if (evcon)
-               evhttp_connection_free(evcon);
+        ;
 }
 
 static void

Index: src/external/bsd/libevent/include/event2/event-config.h
diff -u src/external/bsd/libevent/include/event2/event-config.h:1.1 src/external/bsd/libevent/include/event2/event-config.h:1.2
--- src/external/bsd/libevent/include/event2/event-config.h:1.1	Thu Apr 11 16:55:51 2013
+++ src/external/bsd/libevent/include/event2/event-config.h	Thu Jan 29 07:26:02 2015
@@ -1,3 +1,4 @@
+/*	$NetBSD: event-config.h,v 1.2 2015/01/29 07:26:02 spz Exp $	*/
 /* event2/event-config.h
  *
  * This file was generated by autoconf when libevent was built, and post-
@@ -12,7 +13,7 @@
 #define _EVENT2_EVENT_CONFIG_H_
 
 /* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.in by autoheader.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define if libevent should build without support for a debug mode */
 /* #undef _EVENT_DISABLE_DEBUG_MODE */
@@ -371,7 +372,7 @@
 /* #undef _EVENT_NO_MINUS_C_MINUS_O */
 
 /* Numeric representation of the version */
-#define _EVENT_NUMERIC_VERSION 0x02001500
+#define _EVENT_NUMERIC_VERSION 0x02001600
 
 /* Name of package */
 #define _EVENT_PACKAGE "libevent"
@@ -403,23 +404,22 @@
 
 /* The size of `long', as computed by sizeof. */
 #ifdef _LP64
-#define SIZEOF_LONG 8
+#define _EVENT_SIZEOF_LONG 8
 #else
-#define SIZEOF_LONG 4
+#define _EVENT_SIZEOF_LONG 4
 #endif
 
 /* The size of `long long', as computed by sizeof. */
-#ifdef _LP64
-#define SIZEOF_LONG 8
-#else
-#define SIZEOF_LONG 4
-#endif
+#define _EVENT_SIZEOF_LONG_LONG 8
+
+/* The size of `off_t', as computed by sizeof. */
+#define _EVENT_SIZEOF_OFF_T 8
 
 /* The size of `pthread_t', as computed by sizeof. */
 #ifdef _LP64
-#define SIZEOF_PTHREAD_T 8
+#define _EVENT_SIZEOF_PTHREAD_T 8
 #else
-#define SIZEOF_PTHREAD_T 4
+#define _EVENT_SIZEOF_PTHREAD_T 4
 #endif
 
 /* The size of `short', as computed by sizeof. */
@@ -427,16 +427,16 @@
 
 /* The size of `size_t', as computed by sizeof. */
 #ifdef _LP64
-#define SIZEOF_SIZE_T 8
+#define _EVENT_SIZEOF_SIZE_T 8
 #else
-#define SIZEOF_SIZE_T 4
+#define _EVENT_SIZEOF_SIZE_T 4
 #endif
 
 /* The size of `void *', as computed by sizeof. */
 #ifdef _LP64
-#define SIZEOF_VOID_P 8
+#define _EVENT_SIZEOF_VOID_P 8
 #else
-#define SIZEOF_VOID_P 4
+#define _EVENT_SIZEOF_VOID_P 4
 #endif
 
 /* Define to 1 if you have the ANSI C header files. */
@@ -446,7 +446,7 @@
 #define _EVENT_TIME_WITH_SYS_TIME 1
 
 /* Version number of package */
-#define _EVENT_VERSION "2.0.21-stable"
+#define _EVENT_VERSION "2.0.22-stable"
 
 /* Define to appropriate substitue if compiler doesnt have __func__ */
 /* #undef _EVENT___func__ */

Index: src/external/bsd/libevent/man/buffer.h.3
diff -u src/external/bsd/libevent/man/buffer.h.3:1.1.1.1 src/external/bsd/libevent/man/buffer.h.3:1.2
--- src/external/bsd/libevent/man/buffer.h.3:1.1.1.1	Thu Apr 11 16:05:55 2013
+++ src/external/bsd/libevent/man/buffer.h.3	Thu Jan 29 07:26:03 2015
@@ -1,9 +1,8 @@
-.TH "event2/buffer.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/buffer.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
 event2/buffer.h \- 
-.PP
 Functions for buffering data for network sending or receiving\&.  
 
 .SH SYNOPSIS
@@ -182,7 +181,7 @@ Functions for buffering data for network
 .ti -1c
 .RI "unsigned char * \fBevbuffer_pullup\fP (struct \fBevbuffer\fP *buf, ev_ssize_t size)"
 .br
-.RI "\fIMakes the data at the begging of an evbuffer contiguous\&. \fP"
+.RI "\fIMakes the data at the beginning of an evbuffer contiguous\&. \fP"
 .ti -1c
 .RI "int \fBevbuffer_read\fP (struct \fBevbuffer\fP *buffer, \fBevutil_socket_t\fP fd, int howmuch)"
 .br
@@ -256,16 +255,10 @@ There are several guidelines for using e
 .PP
 .IP "\(bu" 2
 if you already know how much data you are going to add as a result of calling \fBevbuffer_add()\fP multiple times, it makes sense to use \fBevbuffer_expand()\fP first to make sure that enough memory is allocated before hand\&.
-.PP
-.PP
 .IP "\(bu" 2
 \fBevbuffer_add_buffer()\fP adds the contents of one buffer to the other without incurring any unnecessary memory copies\&.
-.PP
-.PP
 .IP "\(bu" 2
 \fBevbuffer_add()\fP and \fBevbuffer_add_buffer()\fP do not mix very well: if you use them, you will wind up with fragmented memory in your buffer\&.
-.PP
-.PP
 .IP "\(bu" 2
 For high-performance code, you may want to avoid copying data into and out of buffers\&. You can skip the copy step by using \fBevbuffer_reserve_space()\fP/evbuffer_commit_space() when writing into a buffer, and \fBevbuffer_peek()\fP when reading\&.
 .PP
@@ -278,7 +271,9 @@ As the contents of an evbuffer can be st
 .SS "#define EVBUFFER_CB_ENABLED   1"
 
 .PP
-If this flag is not set, then a callback is temporarily disabled, and should not be invoked\&. \fBSee Also:\fP
+If this flag is not set, then a callback is temporarily disabled, and should not be invoked\&. 
+.PP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_cb_set_flags()\fP, \fBevbuffer_cb_clear_flags()\fP 
 .RE
@@ -314,7 +309,9 @@ If a callback adds or removes data from 
 .SS "typedef void(* evbuffer_ref_cleanup_cb)(const void *data, size_t datalen, void *extra)"
 
 .PP
-A cleanup function for a piece of memory added to an evbuffer by reference\&. \fBSee Also:\fP
+A cleanup function for a piece of memory added to an evbuffer by reference\&. 
+.PP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_add_reference()\fP 
 .RE
@@ -344,7 +341,9 @@ An EOL is a LF\&. 
 .SS "enum \fBevbuffer_ptr_how\fP"
 
 .PP
-Defines how to adjust an \fBevbuffer_ptr\fP by \fBevbuffer_ptr_set()\fP \fBSee Also:\fP
+Defines how to adjust an \fBevbuffer_ptr\fP by \fBevbuffer_ptr_set()\fP 
+.PP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_ptr_set()\fP 
 .RE
@@ -364,7 +363,9 @@ Advances the pointer by adding to the cu
 .SS "int evbuffer_add (struct \fBevbuffer\fP *buf, const void *data, size_tdatlen)"
 
 .PP
-Append data to the end of an evbuffer\&. \fBParameters:\fP
+Append data to the end of an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP the evbuffer to be appended to 
 .br
@@ -396,13 +397,13 @@ Move all data from one evbuffer into ano
 0 if successful, or -1 if an error occurred
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_remove_buffer()\fP 
 .RE
 .PP
 
-.SS "struct evbuffer_cb_entry* evbuffer_add_cb (struct \fBevbuffer\fP *buffer, \fBevbuffer_cb_func\fPcb, void *cbarg)\fC [read]\fP"
+.SS "struct evbuffer_cb_entry* evbuffer_add_cb (struct \fBevbuffer\fP *buffer, \fBevbuffer_cb_func\fPcb, void *cbarg)"
 
 .PP
 Add a new callback to an evbuffer\&. Subsequent calls to \fBevbuffer_add_cb()\fP add new callbacks\&. To remove this callback, call evbuffer_remove_cb or evbuffer_remove_cb_entry\&.
@@ -467,7 +468,7 @@ Append a formatted string to the end of 
 The number of bytes added if successful, or -1 if an error occurred\&.
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 evutil_printf(), \fBevbuffer_add_vprintf()\fP 
 .RE
@@ -500,7 +501,9 @@ Reference memory into an evbuffer withou
 .SS "int evbuffer_add_vprintf (struct \fBevbuffer\fP *buf, const char *fmt, va_listap)"
 
 .PP
-Append a va_list formatted string to the end of an evbuffer\&. \fBParameters:\fP
+Append a va_list formatted string to the end of an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP the evbuffer that will be appended to 
 .br
@@ -518,7 +521,9 @@ The number of bytes added if successful,
 .SS "int evbuffer_cb_clear_flags (struct \fBevbuffer\fP *buffer, struct evbuffer_cb_entry *cb, ev_uint32_tflags)"
 
 .PP
-Change the flags that are set for a callback on a buffer by removing some\&. \fBParameters:\fP
+Change the flags that are set for a callback on a buffer by removing some\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer that the callback is watching\&. 
 .br
@@ -536,7 +541,9 @@ Change the flags that are set for a call
 .SS "int evbuffer_cb_set_flags (struct \fBevbuffer\fP *buffer, struct evbuffer_cb_entry *cb, ev_uint32_tflags)"
 
 .PP
-Change the flags that are set for a callback on a buffer by adding more\&. \fBParameters:\fP
+Change the flags that are set for a callback on a buffer by adding more\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer that the callback is watching\&. 
 .br
@@ -554,7 +561,9 @@ Change the flags that are set for a call
 .SS "int evbuffer_clear_flags (struct \fBevbuffer\fP *buf, ev_uint64_tflags)"
 
 .PP
-Change the flags that are set for an evbuffer by removing some\&. \fBParameters:\fP
+Change the flags that are set for an evbuffer by removing some\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer that the callback is watching\&. 
 .br
@@ -592,7 +601,7 @@ If you want to commit less data than you
 0 on success, -1 on error 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_reserve_space()\fP 
 .RE
@@ -625,7 +634,9 @@ Force all the callbacks on an evbuffer t
 .SS "int evbuffer_drain (struct \fBevbuffer\fP *buf, size_tlen)"
 
 .PP
-Remove a specified number of bytes data from the beginning of an evbuffer\&. \fBParameters:\fP
+Remove a specified number of bytes data from the beginning of an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP the evbuffer to be drained 
 .br
@@ -677,7 +688,9 @@ Expands the available space in an evbuff
 .SS "void evbuffer_free (struct \fBevbuffer\fP *buf)"
 
 .PP
-Deallocate storage for an evbuffer\&. \fBParameters:\fP
+Deallocate storage for an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP pointer to the evbuffer to be freed 
 .RE
@@ -722,7 +735,9 @@ Returns the number of contiguous availab
 .SS "size_t evbuffer_get_length (const struct \fBevbuffer\fP *buf)"
 
 .PP
-Returns the total number of bytes stored in the evbuffer\&. \fBParameters:\fP
+Returns the total number of bytes stored in the evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP pointer to the evbuffer 
 .RE
@@ -737,10 +752,12 @@ the number of bytes stored in the evbuff
 
 .PP
 Acquire the lock on an evbuffer\&. Has no effect if locking was not enabled with evbuffer_enable_locking\&. 
-.SS "struct \fBevbuffer\fP* evbuffer_new (void)\fC [read]\fP"
+.SS "struct \fBevbuffer\fP* evbuffer_new (void)"
 
 .PP
-Allocate storage for a new evbuffer\&. \fBReturns:\fP
+Allocate storage for a new evbuffer\&. 
+.PP
+\fBReturns:\fP
 .RS 4
 a pointer to a newly allocated evbuffer struct, or NULL if an error occurred 
 .RE
@@ -776,7 +793,9 @@ The number of extents needed\&. This may
 .SS "int evbuffer_prepend (struct \fBevbuffer\fP *buf, const void *data, size_tsize)"
 
 .PP
-Prepends data to the beginning of the evbuffer\&. \fBParameters:\fP
+Prepends data to the beginning of the evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP the evbuffer to which to prepend data 
 .br
@@ -794,7 +813,9 @@ Prepends data to the beginning of the ev
 .SS "int evbuffer_prepend_buffer (struct \fBevbuffer\fP *dst, struct \fBevbuffer\fP *src)"
 
 .PP
-Prepends all data from the src evbuffer to the beginning of the dst evbuffer\&. \fBParameters:\fP
+Prepends all data from the src evbuffer to the beginning of the dst evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIdst\fP the evbuffer to which to prepend data 
 .br
@@ -832,7 +853,9 @@ Sets the search pointer in the buffer to
 .SS "unsigned char* evbuffer_pullup (struct \fBevbuffer\fP *buf, ev_ssize_tsize)"
 
 .PP
-Makes the data at the begging of an evbuffer contiguous\&. \fBParameters:\fP
+Makes the data at the beginning of an evbuffer contiguous\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP the evbuffer to make contiguous 
 .br
@@ -848,7 +871,9 @@ a pointer to the contiguous memory array
 .SS "int evbuffer_read (struct \fBevbuffer\fP *buffer, \fBevutil_socket_t\fPfd, inthowmuch)"
 
 .PP
-Read from a file descriptor and store the result in an evbuffer\&. \fBParameters:\fP
+Read from a file descriptor and store the result in an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer to store the result 
 .br
@@ -862,7 +887,7 @@ Read from a file descriptor and store th
 the number of bytes read, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_write()\fP 
 .RE
@@ -933,7 +958,9 @@ the number of bytes read 
 .SS "int evbuffer_remove_cb (struct \fBevbuffer\fP *buffer, \fBevbuffer_cb_func\fPcb, void *cbarg)"
 
 .PP
-Remove a callback from an evbuffer, given the function and argument used to add it\&. \fBReturns:\fP
+Remove a callback from an evbuffer, given the function and argument used to add it\&. 
+.PP
+\fBReturns:\fP
 .RS 4
 0 if a callback was removed, or -1 if no matching callback was found\&. 
 .RE
@@ -979,16 +1006,18 @@ NOTE: The code currently does not ever u
 the number of provided extents, or -1 on error\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_commit_space()\fP 
 .RE
 .PP
 
-.SS "struct \fBevbuffer_ptr\fP evbuffer_search (struct \fBevbuffer\fP *buffer, const char *what, size_tlen, const struct \fBevbuffer_ptr\fP *start)\fC [read]\fP"
+.SS "struct \fBevbuffer_ptr\fP evbuffer_search (struct \fBevbuffer\fP *buffer, const char *what, size_tlen, const struct \fBevbuffer_ptr\fP *start)"
 
 .PP
-Search for a string within an evbuffer\&. \fBParameters:\fP
+Search for a string within an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer to be searched 
 .br
@@ -1005,10 +1034,12 @@ a struct \fBevbuffer_ptr\fP whose 'pos' 
 .RE
 .PP
 
-.SS "struct \fBevbuffer_ptr\fP evbuffer_search_eol (struct \fBevbuffer\fP *buffer, struct \fBevbuffer_ptr\fP *start, size_t *eol_len_out, enum \fBevbuffer_eol_style\fPeol_style)\fC [read]\fP"
+.SS "struct \fBevbuffer_ptr\fP evbuffer_search_eol (struct \fBevbuffer\fP *buffer, struct \fBevbuffer_ptr\fP *start, size_t *eol_len_out, enum \fBevbuffer_eol_style\fPeol_style)"
 
 .PP
-Search for an end-of-line string within an evbuffer\&. \fBParameters:\fP
+Search for an end-of-line string within an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer to be searched 
 .br
@@ -1025,10 +1056,12 @@ a struct \fBevbuffer_ptr\fP whose 'pos' 
 .RE
 .PP
 
-.SS "struct \fBevbuffer_ptr\fP evbuffer_search_range (struct \fBevbuffer\fP *buffer, const char *what, size_tlen, const struct \fBevbuffer_ptr\fP *start, const struct \fBevbuffer_ptr\fP *end)\fC [read]\fP"
+.SS "struct \fBevbuffer_ptr\fP evbuffer_search_range (struct \fBevbuffer\fP *buffer, const char *what, size_tlen, const struct \fBevbuffer_ptr\fP *start, const struct \fBevbuffer_ptr\fP *end)"
 
 .PP
-Search for a string within part of an evbuffer\&. \fBParameters:\fP
+Search for a string within part of an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer to be searched 
 .br
@@ -1050,7 +1083,9 @@ a struct \fBevbuffer_ptr\fP whose 'pos' 
 .SS "int evbuffer_set_flags (struct \fBevbuffer\fP *buf, ev_uint64_tflags)"
 
 .PP
-Change the flags that are set for an evbuffer by adding more\&. \fBParameters:\fP
+Change the flags that are set for an evbuffer by adding more\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer that the callback is watching\&. 
 .br
@@ -1068,7 +1103,9 @@ Change the flags that are set for an evb
 .SS "int evbuffer_unfreeze (struct \fBevbuffer\fP *buf, intat_front)"
 
 .PP
-Re-enable calls that modify an evbuffer\&. \fBParameters:\fP
+Re-enable calls that modify an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuf\fP The buffer to un-freeze 
 .br
@@ -1102,7 +1139,7 @@ Write the contents of an evbuffer to a f
 the number of bytes written, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_read()\fP 
 .RE
@@ -1127,7 +1164,7 @@ Write some of the contents of an evbuffe
 the number of bytes written, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_read()\fP 
 .RE
Index: src/external/bsd/libevent/man/buffer_compat.h.3
diff -u src/external/bsd/libevent/man/buffer_compat.h.3:1.1.1.1 src/external/bsd/libevent/man/buffer_compat.h.3:1.2
--- src/external/bsd/libevent/man/buffer_compat.h.3:1.1.1.1	Thu Apr 11 16:05:55 2013
+++ src/external/bsd/libevent/man/buffer_compat.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/buffer_compat.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/buffer_compat.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -78,7 +78,9 @@ If a callback adds or removes data from 
 .SS "unsigned char* evbuffer_find (struct \fBevbuffer\fP *buffer, const unsigned char *what, size_tlen)"
 
 .PP
-Find a string within an evbuffer\&. \fBParameters:\fP
+Find a string within an evbuffer\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbuffer\fP the evbuffer to be searched 
 .br
@@ -96,7 +98,9 @@ a pointer to the beginning of the search
 .SS "char* evbuffer_readline (struct \fBevbuffer\fP *buffer)"
 
 .PP
-Obsolete alias for evbuffer_readln(buffer, NULL, EOL_STYLE_ANY)\&. \fBDeprecated\fP
+Obsolete alias for evbuffer_readln(buffer, NULL, EOL_STYLE_ANY)\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because its behavior is not correct for almost any protocol, and also because it's wholly subsumed by \fBevbuffer_readln()\fP\&.
 .RE
Index: src/external/bsd/libevent/man/bufferevent.3
diff -u src/external/bsd/libevent/man/bufferevent.3:1.1.1.1 src/external/bsd/libevent/man/bufferevent.3:1.2
--- src/external/bsd/libevent/man/bufferevent.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/bufferevent.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "bufferevent" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "bufferevent" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -15,7 +15,9 @@ An opaque type for handling buffered IO\
 .PP 
 An opaque type for handling buffered IO\&. 
 
-\fBSee Also:\fP
+
+.PP
+\fBSee also:\fP
 .RS 4
 \fBevent2/bufferevent\&.h\fP 
 .RE
Index: src/external/bsd/libevent/man/bufferevent_ssl.h.3
diff -u src/external/bsd/libevent/man/bufferevent_ssl.h.3:1.1.1.1 src/external/bsd/libevent/man/bufferevent_ssl.h.3:1.2
--- src/external/bsd/libevent/man/bufferevent_ssl.h.3:1.1.1.1	Thu Apr 11 16:05:55 2013
+++ src/external/bsd/libevent/man/bufferevent_ssl.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/bufferevent_ssl.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/bufferevent_ssl.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -59,10 +59,12 @@ OpenSSL support for bufferevents\&. 
 
 .PP
 Return the most recent OpenSSL error reported on an SSL bufferevent\&. 
-.SS "struct \fBbufferevent\fP* bufferevent_openssl_filter_new (struct \fBevent_base\fP *base, struct \fBbufferevent\fP *underlying, struct ssl_st *ssl, enum \fBbufferevent_ssl_state\fPstate, intoptions)\fC [read]\fP"
+.SS "struct \fBbufferevent\fP* bufferevent_openssl_filter_new (struct \fBevent_base\fP *base, struct \fBbufferevent\fP *underlying, struct ssl_st *ssl, enum \fBbufferevent_ssl_state\fPstate, intoptions)"
 
 .PP
-Create a new SSL bufferevent to send its data over another bufferevent\&. \fBParameters:\fP
+Create a new SSL bufferevent to send its data over another bufferevent\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP An \fBevent_base\fP to use to detect reading and writing\&. It must also be the base for the underlying bufferevent\&. 
 .br
@@ -81,14 +83,16 @@ A new bufferevent on success, or NULL on
 .RE
 .PP
 
-.SS "struct ssl_st* bufferevent_openssl_get_ssl (struct \fBbufferevent\fP *bufev)\fC [read]\fP"
+.SS "struct ssl_st* bufferevent_openssl_get_ssl (struct \fBbufferevent\fP *bufev)"
 
 .PP
 Return the underlying openssl SSL * object for an SSL bufferevent\&. 
-.SS "struct \fBbufferevent\fP* bufferevent_openssl_socket_new (struct \fBevent_base\fP *base, \fBevutil_socket_t\fPfd, struct ssl_st *ssl, enum \fBbufferevent_ssl_state\fPstate, intoptions)\fC [read]\fP"
+.SS "struct \fBbufferevent\fP* bufferevent_openssl_socket_new (struct \fBevent_base\fP *base, \fBevutil_socket_t\fPfd, struct ssl_st *ssl, enum \fBbufferevent_ssl_state\fPstate, intoptions)"
 
 .PP
-Create a new SSL bufferevent to send its data over an SSL * on a socket\&. \fBParameters:\fP
+Create a new SSL bufferevent to send its data over an SSL * on a socket\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP An \fBevent_base\fP to use to detect reading and writing 
 .br
Index: src/external/bsd/libevent/man/deprecated.3
diff -u src/external/bsd/libevent/man/deprecated.3:1.1.1.1 src/external/bsd/libevent/man/deprecated.3:1.2
--- src/external/bsd/libevent/man/deprecated.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/deprecated.3	Thu Jan 29 07:26:03 2015
@@ -1,8 +1,9 @@
-.TH "deprecated" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "deprecated" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
 deprecated \- Deprecated List 
+
 .IP "\fBGlobal \fBevbuffer_readline\fP (struct evbuffer *buffer)\fP" 1c
 This function is deprecated because its behavior is not correct for almost any protocol, and also because it's wholly subsumed by \fBevbuffer_readln()\fP\&. 
 .IP "\fBGlobal \fBevbuffer_setcb\fP (struct evbuffer *buffer, evbuffer_cb cb, void *cbarg)\fP" 1c
@@ -71,12 +72,12 @@ This function is deprecated; you probabl
 This function is deprecated as of Libevent 2\&.0\&.9\&. Use evhttp_uri_parse and evhttp_parse_query_str instead\&. 
 .IP "\fBGlobal \fBevhttp_start\fP (const char *address, unsigned short port)\fP" 1c
 It does not allow an event base to be specified 
-.IP "\fBGroup \fBMisnamed functions\fP \fP" 1c
+.IP "\fBModule \fBMisnamed functions\fP \fP" 1c
 These macros are deprecated because their names don't follow Libevent's naming conventions\&. Use evtag_encode_int and evtag_encode_int64 instead\&. 
-.IP "\fBGroup \fBsignal_* macros\fP \fP" 1c
+.IP "\fBModule \fBsignal_* macros\fP \fP" 1c
 These macros are deprecated because their naming is inconsistent with the rest of Libevent\&. Use the evsignal_* macros instead\&.
 .PP
-.IP "\fBGroup \fBtimeout_* macros\fP \fP" 1c
+.IP "\fBModule \fBtimeout_* macros\fP \fP" 1c
 These macros are deprecated because their naming is inconsistent with the rest of Libevent\&. Use the evtimer_* macros instead\&.
 .PP
 .PP
Index: src/external/bsd/libevent/man/dns.h.3
diff -u src/external/bsd/libevent/man/dns.h.3:1.1.1.1 src/external/bsd/libevent/man/dns.h.3:1.2
--- src/external/bsd/libevent/man/dns.h.3:1.1.1.1	Thu Apr 11 16:05:55 2013
+++ src/external/bsd/libevent/man/dns.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/dns.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/dns.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -325,12 +325,8 @@ Searching appears to be a single lookup 
 To disable searching:
 .IP "1." 4
 Never set it up\&. If you never call evdns_resolv_conf_parse or evdns_search_add then no searching will occur\&.
-.PP
-.PP
 .IP "2." 4
 If you do call evdns_resolv_conf_parse then don't pass DNS_OPTION_SEARCH (or DNS_OPTIONS_ALL, which implies it)\&.
-.PP
-.PP
 .IP "3." 4
 When calling evdns_resolve, pass the DNS_QUERY_NO_SEARCH flag\&.
 .PP
@@ -369,7 +365,8 @@ The request was canceled because the DNS
 .SS "typedef void(* evdns_callback_type)(int result, char type, int count, int ttl, void *addresses, void *arg)"
 
 .PP
-The callback that contains the results from a lookup\&. .IP "\(bu" 2
+The callback that contains the results from a lookup\&. 
+.IP "\(bu" 2
 result is one of the DNS_ERR_* values (DNS_ERR_NONE for success)
 .IP "\(bu" 2
 type is either DNS_IPv4_A or DNS_PTR or DNS_IPv6_AAAA
@@ -384,7 +381,9 @@ addresses needs to be cast according to 
 .SS "typedef void(* evdns_debug_log_fn_type)(int is_warning, const char *msg)"
 
 .PP
-A callback that is invoked when a log message is generated\&. \fBParameters:\fP
+A callback that is invoked when a log message is generated\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIis_warning\fP indicates if the log message is a 'warning' 
 .br
@@ -411,10 +410,12 @@ A callback to implement a DNS server\&. 
 
 .SH "Function Documentation"
 .PP 
-.SS "struct evdns_server_port* evdns_add_server_port_with_base (struct \fBevent_base\fP *base, \fBevutil_socket_t\fPsocket, intflags, \fBevdns_request_callback_fn_type\fPcallback, void *user_data)\fC [read]\fP"
+.SS "struct evdns_server_port* evdns_add_server_port_with_base (struct \fBevent_base\fP *base, \fBevutil_socket_t\fPsocket, intflags, \fBevdns_request_callback_fn_type\fPcallback, void *user_data)"
 
 .PP
-Create a new DNS server port\&. \fBParameters:\fP
+Create a new DNS server port\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP The event base to handle events for the server port\&. 
 .br
@@ -448,7 +449,7 @@ Remove all configured nameservers, and s
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_resume()\fP 
 .RE
@@ -469,7 +470,7 @@ Get the number of configured nameservers
 the number of configured nameservers 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_nameserver_add()\fP 
 .RE
@@ -487,7 +488,7 @@ Shut down the asynchronous DNS resolver 
 \fIfail_requests\fP if zero, active requests will be aborted; if non-zero, active requests will return DNS_ERR_SHUTDOWN\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_new()\fP 
 .RE
@@ -518,7 +519,7 @@ Add a nameserver\&. The address should b
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_nameserver_ip_add()\fP 
 .RE
@@ -552,13 +553,13 @@ If no port is specified, it defaults to 
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_nameserver_add()\fP 
 .RE
 .PP
 
-.SS "struct evdns_base* evdns_base_new (struct \fBevent_base\fP *event_base, intinitialize_nameservers)\fC [read]\fP"
+.SS "struct evdns_base* evdns_base_new (struct \fBevent_base\fP *event_base, intinitialize_nameservers)"
 
 .PP
 Initialize the asynchronous DNS library\&. This function initializes support for non-blocking name resolution by calling \fBevdns_resolv_conf_parse()\fP on UNIX and evdns_config_windows_nameservers() on Windows\&.
@@ -575,7 +576,7 @@ Initialize the asynchronous DNS library\
 evdns_base object if successful, or NULL if an error occurred\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_free()\fP 
 .RE
@@ -594,7 +595,7 @@ If this function encounters an error, th
 .RS 4
 \fIbase\fP the evdns_base to which to apply this operation 
 .br
-\fIflags\fP any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC| DNS_OPTIONS_HOSTSFILE|DNS_OPTIONS_ALL 
+\fIflags\fP any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC| DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL 
 .br
 \fIfilename\fP the path to the resolv\&.conf file 
 .RE
@@ -604,16 +605,18 @@ If this function encounters an error, th
 0 if successful, or various positive error codes if an error occurred (see above) 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 resolv\&.conf(3), evdns_config_windows_nameservers() 
 .RE
 .PP
 
-.SS "struct evdns_request* evdns_base_resolve_ipv4 (struct evdns_base *base, const char *name, intflags, \fBevdns_callback_type\fPcallback, void *ptr)\fC [read]\fP"
+.SS "struct evdns_request* evdns_base_resolve_ipv4 (struct evdns_base *base, const char *name, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup an A record for a given name\&. \fBParameters:\fP
+Lookup an A record for a given name\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP the evdns_base to which to apply this operation 
 .br
@@ -631,16 +634,18 @@ Lookup an A record for a given name\&. \
 an evdns_request object if successful, or NULL if an error occurred\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_ipv6()\fP, \fBevdns_resolve_reverse()\fP, \fBevdns_resolve_reverse_ipv6()\fP, \fBevdns_cancel_request()\fP 
 .RE
 .PP
 
-.SS "struct evdns_request* evdns_base_resolve_ipv6 (struct evdns_base *base, const char *name, intflags, \fBevdns_callback_type\fPcallback, void *ptr)\fC [read]\fP"
+.SS "struct evdns_request* evdns_base_resolve_ipv6 (struct evdns_base *base, const char *name, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup an AAAA record for a given name\&. \fBParameters:\fP
+Lookup an AAAA record for a given name\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP the evdns_base to which to apply this operation 
 .br
@@ -658,16 +663,18 @@ Lookup an AAAA record for a given name\&
 an evdns_request object if successful, or NULL if an error occurred\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_ipv4()\fP, \fBevdns_resolve_reverse()\fP, \fBevdns_resolve_reverse_ipv6()\fP, \fBevdns_cancel_request()\fP 
 .RE
 .PP
 
-.SS "struct evdns_request* evdns_base_resolve_reverse (struct evdns_base *base, const struct in_addr *in, intflags, \fBevdns_callback_type\fPcallback, void *ptr)\fC [read]\fP"
+.SS "struct evdns_request* evdns_base_resolve_reverse (struct evdns_base *base, const struct in_addr *in, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup a PTR record for a given IP address\&. \fBParameters:\fP
+Lookup a PTR record for a given IP address\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP the evdns_base to which to apply this operation 
 .br
@@ -685,16 +692,18 @@ Lookup a PTR record for a given IP addre
 an evdns_request object if successful, or NULL if an error occurred\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_reverse_ipv6()\fP, \fBevdns_cancel_request()\fP 
 .RE
 .PP
 
-.SS "struct evdns_request* evdns_base_resolve_reverse_ipv6 (struct evdns_base *base, const struct in6_addr *in, intflags, \fBevdns_callback_type\fPcallback, void *ptr)\fC [read]\fP"
+.SS "struct evdns_request* evdns_base_resolve_reverse_ipv6 (struct evdns_base *base, const struct in6_addr *in, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup a PTR record for a given IPv6 address\&. \fBParameters:\fP
+Lookup a PTR record for a given IPv6 address\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP the evdns_base to which to apply this operation 
 .br
@@ -712,7 +721,7 @@ Lookup a PTR record for a given IPv6 add
 an evdns_request object if successful, or NULL if an error occurred\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_reverse_ipv6()\fP, \fBevdns_cancel_request()\fP 
 .RE
@@ -733,7 +742,7 @@ Resume normal operation and continue any
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_clear_nameservers_and_suspend()\fP 
 .RE
@@ -742,7 +751,9 @@ Resume normal operation and continue any
 .SS "void evdns_base_search_add (struct evdns_base *base, const char *domain)"
 
 .PP
-Add a domain to the list of search domains\&. \fBParameters:\fP
+Add a domain to the list of search domains\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIdomain\fP the domain to be added to the search list 
 .RE
@@ -758,7 +769,7 @@ Obtain nameserver information using the 
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolv_conf_parse()\fP Clear the list of search domains\&. 
 .RE
@@ -802,14 +813,16 @@ In versions before Libevent 2\&.0\&.3-al
 .SS "void evdns_cancel_request (struct evdns_base *base, struct evdns_request *req)"
 
 .PP
-Cancels a pending DNS resolution request\&. \fBParameters:\fP
+Cancels a pending DNS resolution request\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP the evdns_base that was used to make the request 
 .br
 \fIreq\fP the evdns_request that was returned by calling a resolve function 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_base_resolve_ipv4()\fP, \fBevdns_base_resolve_ipv6\fP, \fBevdns_base_resolve_reverse\fP 
 .RE
@@ -822,7 +835,9 @@ Close down a DNS server port, and free a
 .SS "const char* evdns_err_to_string (interr)"
 
 .PP
-Convert a DNS error code to a string\&. \fBParameters:\fP
+Convert a DNS error code to a string\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIerr\fP the DNS error code 
 .RE
@@ -833,7 +848,7 @@ a string containing an explanation of th
 .RE
 .PP
 
-.SS "struct evdns_getaddrinfo_request* evdns_getaddrinfo (struct evdns_base *dns_base, const char *nodename, const char *servname, const struct \fBevutil_addrinfo\fP *hints_in, \fBevdns_getaddrinfo_cb\fPcb, void *arg)\fC [read]\fP"
+.SS "struct evdns_getaddrinfo_request* evdns_getaddrinfo (struct evdns_base *dns_base, const char *nodename, const char *servname, const struct \fBevutil_addrinfo\fP *hints_in, \fBevdns_getaddrinfo_cb\fPcb, void *arg)"
 
 .PP
 Make a non-blocking getaddrinfo request using the dns_base in 'dns_base'\&. If we can answer the request immediately (with an error or not!), then we invoke cb immediately and return NULL\&. Otherwise we return an evdns_getaddrinfo_request and invoke cb later\&.
Index: src/external/bsd/libevent/man/dns_compat.h.3
diff -u src/external/bsd/libevent/man/dns_compat.h.3:1.1.1.1 src/external/bsd/libevent/man/dns_compat.h.3:1.2
--- src/external/bsd/libevent/man/dns_compat.h.3:1.1.1.1	Thu Apr 11 16:05:55 2013
+++ src/external/bsd/libevent/man/dns_compat.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/dns_compat.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/dns_compat.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -97,10 +97,12 @@ Potentially non-threadsafe versions of t
 
 .SH "Function Documentation"
 .PP 
-.SS "struct evdns_server_port* evdns_add_server_port (\fBevutil_socket_t\fPsocket, intflags, \fBevdns_request_callback_fn_type\fPcallback, void *user_data)\fC [read]\fP"
+.SS "struct evdns_server_port* evdns_add_server_port (\fBevutil_socket_t\fPsocket, intflags, \fBevdns_request_callback_fn_type\fPcallback, void *user_data)"
 
 .PP
-As evdns_server_new_with_base\&. \fBDeprecated\fP
+As evdns_server_new_with_base\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because it does not allow the caller to specify which even_base it uses\&. The recommended function is \fBevdns_add_server_port_with_base()\fP\&.
 .RE
@@ -122,7 +124,7 @@ This function is deprecated because it d
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resume()\fP 
 .RE
@@ -144,16 +146,18 @@ This function is deprecated because it d
 the number of configured nameservers 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_nameserver_add()\fP 
 .RE
 .PP
 
-.SS "struct evdns_base* evdns_get_global_base (void)\fC [read]\fP"
+.SS "struct evdns_base* evdns_get_global_base (void)"
 
 .PP
-Return the global evdns_base created by \fBevent_init()\fP and used by the other deprecated functions\&. \fBDeprecated\fP
+Return the global evdns_base created by \fBevent_init()\fP and used by the other deprecated functions\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because use of the global evdns_base is error-prone\&. 
 .RE
@@ -175,7 +179,7 @@ This function is deprecated because it a
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_shutdown()\fP 
 .RE
@@ -202,7 +206,7 @@ This function is deprecated because it d
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_nameserver_ip_add()\fP 
 .RE
@@ -224,7 +228,7 @@ This function is deprecated because it d
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_nameserver_add()\fP 
 .RE
@@ -257,7 +261,7 @@ This function is deprecated because it d
 0 if successful, or various positive error codes if an error occurred (see above) 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 resolv\&.conf(3), evdns_config_windows_nameservers() 
 .RE
@@ -266,7 +270,9 @@ resolv\&.conf(3), evdns_config_windows_n
 .SS "int evdns_resolve_ipv4 (const char *name, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup an A record for a given name\&. \fBDeprecated\fP
+Lookup an A record for a given name\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because it does not allow the caller to specify which evdns_base it applies to\&. The recommended function is \fBevdns_base_resolve_ipv4()\fP\&.
 .RE
@@ -288,7 +294,7 @@ This function is deprecated because it d
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_ipv6()\fP, \fBevdns_resolve_reverse()\fP, \fBevdns_resolve_reverse_ipv6()\fP 
 .RE
@@ -297,7 +303,9 @@ This function is deprecated because it d
 .SS "int evdns_resolve_ipv6 (const char *name, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup an AAAA record for a given name\&. \fBParameters:\fP
+Lookup an AAAA record for a given name\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIname\fP a DNS hostname 
 .br
@@ -313,7 +321,7 @@ Lookup an AAAA record for a given name\&
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_ipv4()\fP, \fBevdns_resolve_reverse()\fP, \fBevdns_resolve_reverse_ipv6()\fP 
 .RE
@@ -322,7 +330,9 @@ Lookup an AAAA record for a given name\&
 .SS "int evdns_resolve_reverse (const struct in_addr *in, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup a PTR record for a given IP address\&. \fBDeprecated\fP
+Lookup a PTR record for a given IP address\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because it does not allow the caller to specify which evdns_base it applies to\&. The recommended function is \fBevdns_base_resolve_reverse()\fP\&.
 .RE
@@ -344,7 +354,7 @@ This function is deprecated because it d
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_reverse_ipv6()\fP 
 .RE
@@ -353,7 +363,9 @@ This function is deprecated because it d
 .SS "int evdns_resolve_reverse_ipv6 (const struct in6_addr *in, intflags, \fBevdns_callback_type\fPcallback, void *ptr)"
 
 .PP
-Lookup a PTR record for a given IPv6 address\&. \fBDeprecated\fP
+Lookup a PTR record for a given IPv6 address\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because it does not allow the caller to specify which evdns_base it applies to\&. The recommended function is \fBevdns_base_resolve_reverse_ipv6()\fP\&.
 .RE
@@ -375,7 +387,7 @@ This function is deprecated because it d
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_resolve_reverse_ipv6()\fP 
 .RE
@@ -397,7 +409,7 @@ This function is deprecated because it d
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_clear_nameservers_and_suspend()\fP 
 .RE
@@ -406,7 +418,9 @@ This function is deprecated because it d
 .SS "void evdns_search_add (const char *domain)"
 
 .PP
-Add a domain to the list of search domains\&. \fBDeprecated\fP
+Add a domain to the list of search domains\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because it does not allow the caller to specify which evdns_base it applies to\&. The recommended function is \fBevdns_base_search_add()\fP\&.
 .RE
@@ -421,7 +435,9 @@ This function is deprecated because it d
 .SS "void evdns_search_clear (void)"
 
 .PP
-Clear the list of search domains\&. \fBDeprecated\fP
+Clear the list of search domains\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because it does not allow the caller to specify which evdns_base it applies to\&. The recommended function is \fBevdns_base_search_clear()\fP\&. 
 .RE
@@ -488,7 +504,7 @@ This function is deprecated because it d
 \fIfail_requests\fP if zero, active requests will be aborted; if non-zero, active requests will return DNS_ERR_SHUTDOWN\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevdns_init()\fP 
 .RE
Index: src/external/bsd/libevent/man/evbuffer_cb_info.3
diff -u src/external/bsd/libevent/man/evbuffer_cb_info.3:1.1.1.1 src/external/bsd/libevent/man/evbuffer_cb_info.3:1.2
--- src/external/bsd/libevent/man/evbuffer_cb_info.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/evbuffer_cb_info.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "evbuffer_cb_info" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "evbuffer_cb_info" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -31,7 +31,9 @@ Structure passed to an evbuffer_cb_func 
 .PP 
 Structure passed to an evbuffer_cb_func evbuffer callback\&. 
 
-\fBSee Also:\fP
+
+.PP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_cb_func\fP, \fBevbuffer_add_cb()\fP 
 .RE
Index: src/external/bsd/libevent/man/evbuffer_iovec.3
diff -u src/external/bsd/libevent/man/evbuffer_iovec.3:1.1.1.1 src/external/bsd/libevent/man/evbuffer_iovec.3:1.2
--- src/external/bsd/libevent/man/evbuffer_iovec.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/evbuffer_iovec.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "evbuffer_iovec" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "evbuffer_iovec" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -29,7 +29,7 @@ Describes a single extent of memory insi
 
 Used for direct-access functions\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevbuffer_reserve_space\fP, \fBevbuffer_commit_space\fP, \fBevbuffer_peek\fP 
 .RE
Index: src/external/bsd/libevent/man/evbuffer_ptr.3
diff -u src/external/bsd/libevent/man/evbuffer_ptr.3:1.1.1.1 src/external/bsd/libevent/man/evbuffer_ptr.3:1.2
--- src/external/bsd/libevent/man/evbuffer_ptr.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/evbuffer_ptr.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "evbuffer_ptr" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "evbuffer_ptr" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
Index: src/external/bsd/libevent/man/event.h.3
diff -u src/external/bsd/libevent/man/event.h.3:1.1.1.1 src/external/bsd/libevent/man/event.h.3:1.2
--- src/external/bsd/libevent/man/event.h.3:1.1.1.1	Thu Apr 11 16:05:56 2013
+++ src/external/bsd/libevent/man/event.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/event.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/event.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -267,7 +267,7 @@ Aliases for working with signal events 
 .br
 .RI "\fIChecks if the event loop was told to exit by \fBevent_loopexit()\fP\&. \fP"
 .ti -1c
-.RI "struct timeval * \fBevent_base_init_common_timeout\fP (struct \fBevent_base\fP *base, const struct timeval *duration)"
+.RI "const struct timeval * \fBevent_base_init_common_timeout\fP (struct \fBevent_base\fP *base, const struct timeval *duration)"
 .br
 .RI "\fIPrepare an \fBevent_base\fP to use a large number of timeouts with the same duration\&. \fP"
 .ti -1c
@@ -470,7 +470,7 @@ A callback function for an event\&. It r
 \fIarg\fP A user-supplied argument\&.
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_new()\fP 
 .RE
@@ -479,7 +479,9 @@ A callback function for an event\&. It r
 .SS "typedef void(* event_fatal_cb)(int err)"
 
 .PP
-A function to be called if Libevent encounters a fatal internal error\&. \fBSee Also:\fP
+A function to be called if Libevent encounters a fatal internal error\&. 
+.PP
+\fBSee also:\fP
 .RS 4
 \fBevent_set_fatal_callback\fP 
 .RE
@@ -488,7 +490,9 @@ A function to be called if Libevent enco
 .SS "typedef void(* event_log_cb)(int severity, const char *msg)"
 
 .PP
-A callback function used to intercept Libevent's log messages\&. \fBSee Also:\fP
+A callback function used to intercept Libevent's log messages\&. 
+.PP
+\fBSee also:\fP
 .RS 4
 \fBevent_set_log_callback\fP 
 .RE
@@ -501,7 +505,7 @@ A callback function used to intercept Li
 .PP
 A flag passed to \fBevent_config_set_flag()\fP\&. These flags change the behavior of an allocated \fBevent_base\fP\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_config_set_flag()\fP, \fBevent_base_new_with_config()\fP, \fBevent_method_feature\fP 
 .RE
@@ -583,7 +587,7 @@ If the event in the ev argument already 
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_del()\fP, \fBevent_assign()\fP, \fBevent_new()\fP 
 .RE
@@ -622,7 +626,7 @@ The arguments for this function, and the
 0 if success, or -1 on invalid arguments\&.
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_new()\fP, \fBevent_add()\fP, \fBevent_del()\fP, \fBevent_base_once()\fP, \fBevent_get_struct_event_size()\fP 
 .RE
@@ -631,7 +635,7 @@ The arguments for this function, and the
 .SS "int event_base_dispatch (struct \fBevent_base\fP *)"
 
 .PP
-Event dispatching loop\&. This loop will run the event base until either there are no more added events, or until something calls \fBevent_base_loopbreak()\fP or \fBevent_base_loopexit()\fP\&.
+Event dispatching loop\&. This loop will run the event base until either there are no more pending or active, or until something calls \fBevent_base_loopbreak()\fP or \fBevent_base_loopexit()\fP\&.
 .PP
 \fBParameters:\fP
 .RS 4
@@ -640,10 +644,10 @@ Event dispatching loop\&. This loop will
 .PP
 \fBReturns:\fP
 .RS 4
-0 if successful, -1 if an error occurred, or 1 if no events were registered\&. 
+0 if successful, -1 if an error occurred, or 1 if we exited because no events were pending or active\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loop()\fP 
 .RE
@@ -665,7 +669,7 @@ Deallocate all memory associated with an
 .PP
 Return a bitmask of the features implemented by an event base\&. This will be a bitwise OR of one or more of the values of event_method_feature
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_method_feature\fP 
 .RE
@@ -674,7 +678,9 @@ Return a bitmask of the features impleme
 .SS "const char* event_base_get_method (const struct \fBevent_base\fP *)"
 
 .PP
-Get the kernel event notification mechanism used by Libevent\&. \fBParameters:\fP
+Get the kernel event notification mechanism used by Libevent\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIeb\fP the \fBevent_base\fP structure returned by \fBevent_base_new()\fP 
 .RE
@@ -706,7 +712,7 @@ Checks if the event loop was told to abo
 true if \fBevent_base_loopbreak()\fP was called on this event base, or 0 otherwise 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loopbreak()\fP 
 .PP
@@ -729,7 +735,7 @@ Checks if the event loop was told to exi
 true if \fBevent_base_loopexit()\fP was called on this event base, or 0 otherwise 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loopexit()\fP 
 .PP
@@ -737,7 +743,7 @@ true if \fBevent_base_loopexit()\fP was 
 .RE
 .PP
 
-.SS "struct timeval* event_base_init_common_timeout (struct \fBevent_base\fP *base, const struct timeval *duration)\fC [read]\fP"
+.SS "const struct timeval* event_base_init_common_timeout (struct \fBevent_base\fP *base, const struct timeval *duration)"
 
 .PP
 Prepare an \fBevent_base\fP to use a large number of timeouts with the same duration\&. Libevent's default scheduling algorithm is optimized for having a large number of timeouts with their durations more or less randomly distributed\&. But if you have a large number of timeouts that all have the same duration (for example, if you have a large number of connections that all have a 10-second timeout), then you can improve Libevent's performance by telling Libevent about it\&.
@@ -750,7 +756,7 @@ To do this, call this function with the 
 .PP
 Wait for events to become active, and run their callbacks\&. This is a more flexible version of \fBevent_base_dispatch()\fP\&.
 .PP
-By default, this loop will run the event base until either there are no more added events, or until something calls \fBevent_base_loopbreak()\fP or evenet_base_loopexit()\&. You can override this behavior with the 'flags' argument\&.
+By default, this loop will run the event base until either there are no more pending or active events, or until something calls \fBevent_base_loopbreak()\fP or \fBevent_base_loopexit()\fP\&. You can override this behavior with the 'flags' argument\&.
 .PP
 \fBParameters:\fP
 .RS 4
@@ -761,10 +767,10 @@ By default, this loop will run the event
 .PP
 \fBReturns:\fP
 .RS 4
-0 if successful, -1 if an error occurred, or 1 if no events were registered\&. 
+0 if successful, -1 if an error occurred, or 1 if we exited because no events were pending or active\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loopexit()\fP, \fBevent_base_dispatch()\fP, \fBEVLOOP_ONCE\fP, \fBEVLOOP_NONBLOCK\fP 
 .RE
@@ -787,7 +793,7 @@ Subsequent invocations of \fBevent_loop(
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loopexit()\fP 
 .RE
@@ -812,27 +818,29 @@ Subsequent invocations of \fBevent_base_
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loopbreak()\fP 
 .RE
 .PP
 
-.SS "struct \fBevent_base\fP* event_base_new (void)\fC [read]\fP"
+.SS "struct \fBevent_base\fP* event_base_new (void)"
 
 .PP
-Create and return a new \fBevent_base\fP to use with the rest of Libevent\&. \fBReturns:\fP
+Create and return a new \fBevent_base\fP to use with the rest of Libevent\&. 
+.PP
+\fBReturns:\fP
 .RS 4
 a new \fBevent_base\fP on success, or NULL on failure\&.
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_free()\fP, \fBevent_base_new_with_config()\fP 
 .RE
 .PP
 
-.SS "struct \fBevent_base\fP* event_base_new_with_config (const struct \fBevent_config\fP *)\fC [read]\fP"
+.SS "struct \fBevent_base\fP* event_base_new_with_config (const struct \fBevent_config\fP *)"
 
 .PP
 Initialize the event API\&. Use \fBevent_base_new_with_config()\fP to initialize a new event base, taking the specified configuration under consideration\&. The configuration object can currently be used to avoid certain event notification mechanisms\&.
@@ -847,7 +855,7 @@ Initialize the event API\&. Use \fBevent
 an initialized \fBevent_base\fP that can be used to registering events, or NULL if no event base can be created with the requested \fBevent_config\fP\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_new()\fP, \fBevent_base_free()\fP, \fBevent_init()\fP, \fBevent_assign()\fP 
 .RE
@@ -866,7 +874,7 @@ Note that in Libevent 2\&.0 and earlier,
 .br
 \fIfd\fP a file descriptor to monitor, or -1 for no fd\&. 
 .br
-\fIevents\fP event(s) to monitor; can be any of EV_READ | EV_WRITE, or EV_TIMEOUT 
+\fIevents\fP \fBevent(s)\fP to monitor; can be any of EV_READ | EV_WRITE, or EV_TIMEOUT 
 .br
 \fIcallback\fP callback function to be invoked when the event occurs 
 .br
@@ -902,7 +910,7 @@ Note that urgent-priority events can sta
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_priority_set()\fP 
 .RE
@@ -947,13 +955,15 @@ Enters an event method that should be av
 .SS "void event_config_free (struct \fBevent_config\fP *cfg)"
 
 .PP
-Deallocates all memory associated with an event configuration object\&. \fBParameters:\fP
+Deallocates all memory associated with an event configuration object\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIcfg\fP the event configuration object to be freed\&. 
 .RE
 .PP
 
-.SS "struct \fBevent_config\fP* event_config_new (void)\fC [read]\fP"
+.SS "struct \fBevent_config\fP* event_config_new (void)"
 
 .PP
 Allocates a new event configuration object\&. The event configuration object can be used to change the behavior of an event base\&.
@@ -963,7 +973,7 @@ Allocates a new event configuration obje
 an \fBevent_config\fP object that can be used to store configuration, or NULL if an error is encountered\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_new_with_config()\fP, \fBevent_config_free()\fP, \fBevent_config\fP 
 .RE
@@ -976,14 +986,13 @@ Enters a required event method feature t
 .PP
 .nf
 
-     event_config_require_features(cfg, EV_FEATURE_ET);
-     base = event_base_new_with_config(cfg);
-     if (base == NULL) {
-We can't get edge-triggered behavior here\&.
-       event_config_require_features(cfg, 0);
-       base = event_base_new_with_config(cfg);
-     }
-   
+  event_config_require_features(cfg, EV_FEATURE_ET);
+  base = event_base_new_with_config(cfg);
+  if (base == NULL) {
+    // We can't get edge-triggered behavior here\&.
+    event_config_require_features(cfg, 0);
+    base = event_base_new_with_config(cfg);
+  }
 .fi
 .PP
 .PP
@@ -999,7 +1008,7 @@ We can't get edge-triggered behavior her
 0 on success, -1 on failure\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_method_feature\fP, \fBevent_base_new_with_config()\fP 
 .RE
@@ -1008,7 +1017,9 @@ We can't get edge-triggered behavior her
 .SS "int event_config_set_flag (struct \fBevent_config\fP *cfg, intflag)"
 
 .PP
-Sets one or more flags to configure what parts of the eventual \fBevent_base\fP will be initialized, and how they'll work\&. \fBSee Also:\fP
+Sets one or more flags to configure what parts of the eventual \fBevent_base\fP will be initialized, and how they'll work\&. 
+.PP
+\fBSee also:\fP
 .RS 4
 event_base_config_flags, \fBevent_base_new_with_config()\fP 
 .RE
@@ -1039,7 +1050,7 @@ When debugging mode is enabled, informs 
 .PP
 This function must only be called on a non-added event\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_enable_debug_mode()\fP 
 .RE
@@ -1060,7 +1071,7 @@ Remove an event from the set of monitore
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_add()\fP 
 .RE
@@ -1075,7 +1086,7 @@ Debug mode can currently catch the follo
 .PP
 Note that debugging mode uses memory to track every event that has been initialized (via event_assign, event_set, or event_new) but not yet released (via event_free or event_debug_unassign)\&. If you want to use debug mode, and you find yourself running out of memory, you will need to use event_debug_unassign to explicitly stop tracking events that are no longer considered set-up\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_debug_unassign()\fP 
 .RE
@@ -1143,7 +1154,7 @@ Warning: This function is only useful fo
 .RE
 .PP
 
-.SS "struct \fBevent\fP* event_new (struct \fBevent_base\fP *, \fBevutil_socket_t\fP, short, \fBevent_callback_fn\fP, void *)\fC [read]\fP"
+.SS "struct \fBevent\fP* event_new (struct \fBevent_base\fP *, \fBevutil_socket_t\fP, short, \fBevent_callback_fn\fP, void *)"
 
 .PP
 Allocate and asssign a new event structure, ready to be added\&. The function \fBevent_new()\fP returns a new event that can be used in future calls to \fBevent_add()\fP and \fBevent_del()\fP\&. The fd and events arguments determine which conditions will trigger the event; the callback and callback_arg arguments tell Libevent what to do when the event becomes active\&.
@@ -1178,7 +1189,7 @@ When the event becomes active, the event
 a newly allocated struct event that must later be freed with \fBevent_free()\fP\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_free()\fP, \fBevent_add()\fP, \fBevent_del()\fP, \fBevent_assign()\fP 
 .RE
@@ -1187,7 +1198,9 @@ a newly allocated struct event that must
 .SS "int event_pending (const struct \fBevent\fP *ev, shortevents, struct timeval *tv)"
 
 .PP
-Checks if a specific event is pending or scheduled\&. \fBParameters:\fP
+Checks if a specific event is pending or scheduled\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIev\fP an event struct previously passed to \fBevent_add()\fP 
 .br
@@ -1205,7 +1218,9 @@ true if the event is pending on any of t
 .SS "int event_priority_set (struct \fBevent\fP *, int)"
 
 .PP
-Assign a priority to an event\&. \fBParameters:\fP
+Assign a priority to an event\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIev\fP an event struct 
 .br
@@ -1217,7 +1232,7 @@ Assign a priority to an event\&. \fBPara
 0 if successful, or -1 if an error occurred 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_priority_init()\fP 
 .RE
@@ -1238,7 +1253,7 @@ Reinitialize the event base after a fork
 0 if successful, or -1 if some events could not be re-added\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_new()\fP 
 .RE
@@ -1253,7 +1268,9 @@ Libevent will (almost) always log an _EV
 .SS "void event_set_log_callback (\fBevent_log_cb\fPcb)"
 
 .PP
-Redirect Libevent's log messages\&. \fBParameters:\fP
+Redirect Libevent's log messages\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIcb\fP a function taking two arguments: an integer severity between _EVENT_LOG_DEBUG and _EVENT_LOG_ERR, and a string\&. If cb is NULL, then the default log is used\&.
 .RE
Index: src/external/bsd/libevent/man/event_base.3
diff -u src/external/bsd/libevent/man/event_base.3:1.1.1.1 src/external/bsd/libevent/man/event_base.3:1.2
--- src/external/bsd/libevent/man/event_base.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/event_base.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event_base" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event_base" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -19,7 +19,7 @@ The \fBevent_base\fP lies at the center 
 .PP
 This is an opaque structure; you can allocate one using \fBevent_base_new()\fP or \fBevent_base_new_with_config()\fP\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_new()\fP, \fBevent_base_free()\fP, \fBevent_base_loop()\fP, \fBevent_base_new_with_config()\fP 
 .RE
Index: src/external/bsd/libevent/man/event_compat.h.3
diff -u src/external/bsd/libevent/man/event_compat.h.3:1.1.1.1 src/external/bsd/libevent/man/event_compat.h.3:1.2
--- src/external/bsd/libevent/man/event_compat.h.3:1.1.1.1	Thu Apr 11 16:05:56 2013
+++ src/external/bsd/libevent/man/event_compat.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/event_compat.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/event_compat.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -33,6 +33,8 @@ Potentially non-threadsafe versions of t
 .PP
 .RI "\fBtimeout_* macros\fP"
 .br
+
+.PP
 \fBDeprecated\fP
 .RS 4
 These macros are deprecated because their naming is inconsistent with the rest of Libevent\&. Use the evtimer_* macros instead\&.
@@ -62,6 +64,8 @@ These macros are deprecated because thei
 .PP
 .RI "\fBsignal_* macros\fP"
 .br
+
+.PP
 \fBDeprecated\fP
 .RS 4
 These macros are deprecated because their naming is inconsistent with the rest of Libevent\&. Use the evsignal_* macros instead\&.
@@ -153,7 +157,7 @@ This function is deprecated because it i
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_dispatch()\fP, \fBevent_init()\fP 
 .RE
@@ -162,19 +166,21 @@ This function is deprecated because it i
 .SS "const char* event_get_method (void)"
 
 .PP
-Get the kernel event notification mechanism used by Libevent\&. \fBDeprecated\fP
+Get the kernel event notification mechanism used by Libevent\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is obsolete, and has been replaced by \fBevent_base_get_method()\fP\&. Its use is deprecated because it relies on the 'current' base configured by \fBevent_init()\fP\&.
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_get_method()\fP 
 .RE
 .PP
 
-.SS "struct \fBevent_base\fP* event_init (void)\fC [read]\fP"
+.SS "struct \fBevent_base\fP* event_init (void)"
 
 .PP
 Initialize the event API\&. The event API needs to be initialized with \fBevent_init()\fP before it can be used\&. Sets the global current base that gets used for events that have no base associated with them\&.
@@ -185,7 +191,7 @@ This function is deprecated because it r
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_set()\fP, \fBevent_base_new()\fP 
 .RE
@@ -202,7 +208,7 @@ This function is deprecated because it u
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loop()\fP, \fBevent_init()\fP 
 .RE
@@ -219,7 +225,7 @@ This function is deprecated because it u
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_loopbreak()\fP, \fBevent_init()\fP 
 .RE
@@ -236,7 +242,7 @@ This function is deprecated because it u
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_init\fP, \fBevent_base_loopexit()\fP 
 .RE
@@ -245,13 +251,15 @@ This function is deprecated because it u
 .SS "int event_once (\fBevutil_socket_t\fP, short, void(*)(\fBevutil_socket_t\fP, short, void *), void *, const struct timeval *)"
 
 .PP
-Schedule a one-time event to occur\&. \fBDeprecated\fP
+Schedule a one-time event to occur\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is obsolete, and has been replaced by \fBevent_base_once()\fP\&. Its use is deprecated because it relies on the 'current' base configured by \fBevent_init()\fP\&.
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_once()\fP 
 .RE
@@ -260,13 +268,15 @@ This function is obsolete, and has been 
 .SS "int event_priority_init (int)"
 
 .PP
-Set the number of different event priorities\&. \fBDeprecated\fP
+Set the number of different event priorities\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 This function is deprecated because it is easily confused by multiple calls to \fBevent_init()\fP, and because it is not safe for multithreaded use\&. The replacement is \fBevent_base_priority_init()\fP\&.
 .RE
 .PP
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_base_priority_init()\fP 
 .RE
@@ -275,7 +285,9 @@ This function is deprecated because it i
 .SS "void event_set (struct \fBevent\fP *, \fBevutil_socket_t\fP, short, void(*)(\fBevutil_socket_t\fP, short, void *), void *)"
 
 .PP
-Prepare an event structure to be added\&. \fBDeprecated\fP
+Prepare an event structure to be added\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 \fBevent_set()\fP is not recommended for new code, because it requires a subsequent call to \fBevent_base_set()\fP to be safe under most circumstances\&. Use \fBevent_assign()\fP or \fBevent_new()\fP instead\&. 
 .RE
Index: src/external/bsd/libevent/man/event_config.3
diff -u src/external/bsd/libevent/man/event_config.3:1.1.1.1 src/external/bsd/libevent/man/event_config.3:1.2
--- src/external/bsd/libevent/man/event_config.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/event_config.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event_config" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event_config" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -17,7 +17,7 @@ Configuration for an \fBevent_base\fP\&.
 
 There are many options that can be used to alter the behavior and implementation of an \fBevent_base\fP\&. To avoid having to pass them all in a complex many-argument constructor, we provide an abstract data type wrhere you set up configation information before passing it to \fBevent_base_new_with_config()\fP\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevent_config_new()\fP, \fBevent_config_free()\fP, \fBevent_base_new_with_config()\fP, \fBevent_config_avoid_method()\fP, \fBevent_config_require_features()\fP, \fBevent_config_set_flag()\fP, \fBevent_config_set_num_cpus_hint()\fP 
 .RE
Index: src/external/bsd/libevent/man/evthread_condition_callbacks.3
diff -u src/external/bsd/libevent/man/evthread_condition_callbacks.3:1.1.1.1 src/external/bsd/libevent/man/evthread_condition_callbacks.3:1.2
--- src/external/bsd/libevent/man/evthread_condition_callbacks.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/evthread_condition_callbacks.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "evthread_condition_callbacks" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "evthread_condition_callbacks" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
Index: src/external/bsd/libevent/man/evthread_lock_callbacks.3
diff -u src/external/bsd/libevent/man/evthread_lock_callbacks.3:1.1.1.1 src/external/bsd/libevent/man/evthread_lock_callbacks.3:1.2
--- src/external/bsd/libevent/man/evthread_lock_callbacks.3:1.1.1.1	Thu Apr 11 16:05:58 2013
+++ src/external/bsd/libevent/man/evthread_lock_callbacks.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "evthread_lock_callbacks" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "evthread_lock_callbacks" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
Index: src/external/bsd/libevent/man/evutil_addrinfo.3
diff -u src/external/bsd/libevent/man/evutil_addrinfo.3:1.1.1.1 src/external/bsd/libevent/man/evutil_addrinfo.3:1.2
--- src/external/bsd/libevent/man/evutil_addrinfo.3:1.1.1.1	Thu Apr 11 16:05:58 2013
+++ src/external/bsd/libevent/man/evutil_addrinfo.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "evutil_addrinfo" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "evutil_addrinfo" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
Index: src/external/bsd/libevent/man/http.h.3
diff -u src/external/bsd/libevent/man/http.h.3:1.1.1.1 src/external/bsd/libevent/man/http.h.3:1.2
--- src/external/bsd/libevent/man/http.h.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/http.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/http.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/http.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -249,7 +249,7 @@ Basic support for HTTP serving\&.  
 .br
 .RI "\fIReturns the connection object associated with the request or NULL\&. \fP"
 .ti -1c
-.RI "struct evhttp_uri * \fBevhttp_request_get_evhttp_uri\fP (const struct evhttp_request *req)"
+.RI "const struct evhttp_uri * \fBevhttp_request_get_evhttp_uri\fP (const struct evhttp_request *req)"
 .br
 .RI "\fIReturns the request URI (parsed) \fP"
 .ti -1c
@@ -476,13 +476,13 @@ Can be called multiple times to have the
 0 on success, -1 on failure\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_bind_socket()\fP 
 .RE
 .PP
 
-.SS "struct evhttp_bound_socket* evhttp_accept_socket_with_handle (struct evhttp *http, \fBevutil_socket_t\fPfd)\fC [read]\fP"
+.SS "struct evhttp_bound_socket* evhttp_accept_socket_with_handle (struct evhttp *http, \fBevutil_socket_t\fPfd)"
 
 .PP
 Like \fBevhttp_accept_socket()\fP, but returns a handle for referencing the socket\&. The returned pointer is not valid after \fIhttp\fP is freed\&.
@@ -499,7 +499,7 @@ Like \fBevhttp_accept_socket()\fP, but r
 Handle for the socket on success, NULL on failure\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_accept_socket()\fP, \fBevhttp_del_accept_socket()\fP 
 .RE
@@ -508,7 +508,9 @@ Handle for the socket on success, NULL o
 .SS "int evhttp_add_header (struct evkeyvalq *headers, const char *key, const char *value)"
 
 .PP
-Adds a header to a list of existing headers\&. \fBParameters:\fP
+Adds a header to a list of existing headers\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIheaders\fP the evkeyvalq object to which to add a header 
 .br
@@ -522,7 +524,7 @@ Adds a header to a list of existing head
 0 on success, -1 otherwise\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_find_header()\fP, \fBevhttp_clear_headers()\fP 
 .RE
@@ -540,7 +542,7 @@ Add a server alias to an http object\&. 
 \fIalias\fP the alias to add 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 evhttp_add_remove_alias() 
 .RE
@@ -569,13 +571,13 @@ It is possible to have hierarchical vhos
 0 on success, -1 on failure 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_remove_virtual_host()\fP 
 .RE
 .PP
 
-.SS "struct evhttp_bound_socket* evhttp_bind_listener (struct evhttp *http, struct evconnlistener *listener)\fC [read]\fP"
+.SS "struct evhttp_bound_socket* evhttp_bind_listener (struct evhttp *http, struct evconnlistener *listener)"
 
 .PP
 The most low-level evhttp_bind/accept method: takes an evconnlistener, and returns an evhttp_bound_socket\&. The listener will be freed when the bound socket is freed\&. 
@@ -598,13 +600,13 @@ Binds an HTTP server on the specified ad
 0 on success, -1 on failure\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_accept_socket()\fP 
 .RE
 .PP
 
-.SS "struct evhttp_bound_socket* evhttp_bind_socket_with_handle (struct evhttp *http, const char *address, ev_uint16_tport)\fC [read]\fP"
+.SS "struct evhttp_bound_socket* evhttp_bind_socket_with_handle (struct evhttp *http, const char *address, ev_uint16_tport)"
 
 .PP
 Like \fBevhttp_bind_socket()\fP, but returns a handle for referencing the socket\&. The returned pointer is not valid after \fIhttp\fP is freed\&.
@@ -623,7 +625,7 @@ Like \fBevhttp_bind_socket()\fP, but ret
 Handle for the socket on success, NULL on failure\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_bind_socket()\fP, \fBevhttp_del_accept_socket()\fP 
 .RE
@@ -632,7 +634,9 @@ Handle for the socket on success, NULL o
 .SS "\fBevutil_socket_t\fP evhttp_bound_socket_get_fd (struct evhttp_bound_socket *bound_socket)"
 
 .PP
-Get the raw file descriptor referenced by an evhttp_bound_socket\&. \fBParameters:\fP
+Get the raw file descriptor referenced by an evhttp_bound_socket\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbound_socket\fP a handle returned by evhttp_{bind,accept}_socket_with_handle 
 .RE
@@ -642,7 +646,7 @@ Get the raw file descriptor referenced b
 the file descriptor used by the bound socket 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_bind_socket_with_handle()\fP, \fBevhttp_accept_socket_with_handle()\fP 
 .RE
@@ -664,13 +668,15 @@ A request cannot be canceled if its call
 .SS "void evhttp_clear_headers (struct evkeyvalq *headers)"
 
 .PP
-Removes all headers from the header list\&. \fBParameters:\fP
+Removes all headers from the header list\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIheaders\fP the evkeyvalq object from which to remove all headers 
 .RE
 .PP
 
-.SS "struct evhttp_connection* evhttp_connection_base_new (struct \fBevent_base\fP *base, struct evdns_base *dnsbase, const char *address, unsigned shortport)\fC [read]\fP"
+.SS "struct evhttp_connection* evhttp_connection_base_new (struct \fBevent_base\fP *base, struct evdns_base *dnsbase, const char *address, unsigned shortport)"
 
 .PP
 A connection object that can be used to for making HTTP requests\&. The connection object tries to resolve address and establish the connection when it is given an http request object\&.
@@ -740,7 +746,7 @@ If you created this bound socket with ev
 \fIbound_socket\fP a handle returned by evhttp_{bind,accept}_socket_with_handle 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_bind_socket_with_handle()\fP, \fBevhttp_accept_socket_with_handle()\fP 
 .RE
@@ -767,7 +773,9 @@ a newly allocated URI-encoded string or 
 .SS "const char* evhttp_find_header (const struct evkeyvalq *headers, const char *key)"
 
 .PP
-Finds the value belonging to a header\&. \fBParameters:\fP
+Finds the value belonging to a header\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIheaders\fP the evkeyvalq object in which to find the header 
 .br
@@ -779,7 +787,7 @@ Finds the value belonging to a header\&.
 a pointer to the value for the header or NULL if the header count not be found\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_add_header()\fP, \fBevhttp_remove_header()\fP 
 .RE
@@ -795,7 +803,7 @@ Free the previously created HTTP server\
 \fIhttp\fP the evhttp server object to be freed 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_start()\fP 
 .RE
@@ -840,16 +848,18 @@ Make an HTTP request over the specified 
 0 on success, -1 on failure 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_cancel_request()\fP 
 .RE
 .PP
 
-.SS "struct evhttp* evhttp_new (struct \fBevent_base\fP *base)\fC [read]\fP"
+.SS "struct evhttp* evhttp_new (struct \fBevent_base\fP *base)"
 
 .PP
-Create a new HTTP server\&. \fBParameters:\fP
+Create a new HTTP server\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP (optional) the event base to receive the HTTP events 
 .RE
@@ -859,7 +869,7 @@ Create a new HTTP server\&. \fBParameter
 a pointer to a newly initialized evhttp server structure 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_free()\fP 
 .RE
@@ -922,7 +932,9 @@ The first entry is: key='q', value='test
 .SS "int evhttp_remove_header (struct evkeyvalq *headers, const char *key)"
 
 .PP
-Removes a header from a list of existing headers\&. \fBParameters:\fP
+Removes a header from a list of existing headers\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIheaders\fP the evkeyvalq object from which to remove a header 
 .br
@@ -934,7 +946,7 @@ Removes a header from a list of existing
 0 if the header was removed, -1 otherwise\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_find_header()\fP, \fBevhttp_add_header()\fP 
 .RE
@@ -943,14 +955,16 @@ Removes a header from a list of existing
 .SS "int evhttp_remove_server_alias (struct evhttp *http, const char *alias)"
 
 .PP
-Remove a server alias from an http object\&. \fBParameters:\fP
+Remove a server alias from an http object\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIhttp\fP the evhttp object 
 .br
 \fIalias\fP the alias to remove 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_add_server_alias()\fP 
 .RE
@@ -959,7 +973,9 @@ Remove a server alias from an http objec
 .SS "int evhttp_remove_virtual_host (struct evhttp *http, struct evhttp *vhost)"
 
 .PP
-Removes a virtual host from the http server\&. \fBParameters:\fP
+Removes a virtual host from the http server\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIhttp\fP the evhttp object from which to remove the virtual host 
 .br
@@ -971,7 +987,7 @@ Removes a virtual host from the http ser
 0 on success, -1 on failure 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_add_virtual_host()\fP 
 .RE
@@ -981,7 +997,7 @@ Removes a virtual host from the http ser
 
 .PP
 Frees the request object and removes associated events\&. 
-.SS "struct evhttp_connection* evhttp_request_get_connection (struct evhttp_request *req)\fC [read]\fP"
+.SS "struct evhttp_connection* evhttp_request_get_connection (struct evhttp_request *req)"
 
 .PP
 Returns the connection object associated with the request or NULL\&. The user needs to either free the request explicitly or call \fBevhttp_send_reply_end()\fP\&. 
@@ -989,7 +1005,7 @@ Returns the connection object associated
 
 .PP
 Returns the host associated with the request\&. If a client sends an absolute URI, the host part of that is preferred\&. Otherwise, the input headers are searched for a Host: header\&. NULL is returned if no absolute URI or Host: header is provided\&. 
-.SS "struct evhttp_request* evhttp_request_new (void(*)(struct evhttp_request *, void *)cb, void *arg)\fC [read]\fP"
+.SS "struct evhttp_request* evhttp_request_new (void(*)(struct evhttp_request *, void *)cb, void *arg)"
 
 .PP
 Creates a new request object that needs to be filled in with the request parameters\&. The callback is executed when the request completed or an error occurred\&. 
@@ -1000,7 +1016,9 @@ Takes ownership of the request object\&.
 .SS "void evhttp_request_set_chunked_cb (struct evhttp_request *, void(*)(struct evhttp_request *, void *)cb)"
 
 .PP
-Enable delivery of chunks to requestor\&. \fBParameters:\fP
+Enable delivery of chunks to requestor\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIcb\fP will be called after every read of data with the same argument as the completion callback\&. Will never be called on an empty response\&. May drain the input buffer; it will be drained automatically on return\&. 
 .RE
@@ -1009,7 +1027,9 @@ Enable delivery of chunks to requestor\&
 .SS "void evhttp_send_error (struct evhttp_request *req, interror, const char *reason)"
 
 .PP
-Send an HTML error message to the client\&. \fBParameters:\fP
+Send an HTML error message to the client\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIreq\fP a request object 
 .br
@@ -1052,7 +1072,9 @@ Send another data chunk as part of an on
 .SS "void evhttp_send_reply_end (struct evhttp_request *req)"
 
 .PP
-Complete a chunked reply, freeing the request as appropriate\&. \fBParameters:\fP
+Complete a chunked reply, freeing the request as appropriate\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIreq\fP a request object 
 .RE
@@ -1093,7 +1115,9 @@ By default this includes the following m
 .SS "int evhttp_set_cb (struct evhttp *http, const char *path, void(*)(struct evhttp_request *, void *)cb, void *cb_arg)"
 
 .PP
-Set a callback for a specified URI\&. \fBParameters:\fP
+Set a callback for a specified URI\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIhttp\fP the http sever on which to set the callback 
 .br
@@ -1136,7 +1160,9 @@ XXX Document\&. 
 .SS "void evhttp_set_timeout (struct evhttp *http, inttimeout_in_secs)"
 
 .PP
-Set the timeout for an HTTP request\&. \fBParameters:\fP
+Set the timeout for an HTTP request\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIhttp\fP an evhttp object 
 .br
@@ -1154,7 +1180,7 @@ Free all memory allocated for a parsed u
 \fIuri\fP container with parsed data 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_uri_parse()\fP 
 .RE
@@ -1193,13 +1219,13 @@ Join together the uri parts from parsed 
 an joined uri as string or NULL on error 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_uri_parse()\fP 
 .RE
 .PP
 
-.SS "struct evhttp_uri* evhttp_uri_parse_with_flags (const char *source_uri, unsignedflags)\fC [read]\fP"
+.SS "struct evhttp_uri* evhttp_uri_parse_with_flags (const char *source_uri, unsignedflags)"
 
 .PP
 Helper function to parse a URI-Reference as specified by RFC3986\&. This function matches the URI-Reference production from RFC3986, which includes both URIs like
@@ -1228,7 +1254,7 @@ Note also that most URI schemes will hav
 uri container to hold parsed data, or NULL if there is error 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevhttp_uri_free()\fP 
 .RE
Index: src/external/bsd/libevent/man/http_compat.h.3
diff -u src/external/bsd/libevent/man/http_compat.h.3:1.1.1.1 src/external/bsd/libevent/man/http_compat.h.3:1.2
--- src/external/bsd/libevent/man/http_compat.h.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/http_compat.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/http_compat.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/http_compat.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -45,7 +45,7 @@ Potentially non-threadsafe versions of t
 
 .SH "Function Documentation"
 .PP 
-.SS "struct evhttp_connection* evhttp_connection_new (const char *address, unsigned shortport)\fC [read]\fP"
+.SS "struct evhttp_connection* evhttp_connection_new (const char *address, unsigned shortport)"
 
 .PP
 A connection object that can be used to for making HTTP requests\&. The connection object tries to establish the connection when it is given an http request object\&.
@@ -59,16 +59,20 @@ It does not allow an event base to be sp
 .SS "void evhttp_connection_set_base (struct evhttp_connection *evcon, struct \fBevent_base\fP *base)"
 
 .PP
-Associates an event base with the connection - can only be called on a freshly created connection object that has not been used yet\&. \fBDeprecated\fP
+Associates an event base with the connection - can only be called on a freshly created connection object that has not been used yet\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 XXXX Why? 
 .RE
 .PP
 
-.SS "struct evhttp* evhttp_start (const char *address, unsigned shortport)\fC [read]\fP"
+.SS "struct evhttp* evhttp_start (const char *address, unsigned shortport)"
 
 .PP
-Start an HTTP server on the specified address and port\&. \fBDeprecated\fP
+Start an HTTP server on the specified address and port\&. 
+.PP
+\fBDeprecated\fP
 .RS 4
 It does not allow an event base to be specified
 .RE
Index: src/external/bsd/libevent/man/rpc.h.3
diff -u src/external/bsd/libevent/man/rpc.h.3:1.1.1.1 src/external/bsd/libevent/man/rpc.h.3:1.2
--- src/external/bsd/libevent/man/rpc.h.3:1.1.1.1	Thu Apr 11 16:05:56 2013
+++ src/external/bsd/libevent/man/rpc.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/rpc.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/rpc.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -225,7 +225,7 @@ A specific RPC can then be registered wi
 .PP
 when the server receives an appropriately formatted RPC, the user callback is invoked\&. The callback needs to fill in the reply structure\&.
 .PP
-void FunctionCB(\fBEVRPC_STRUCT(SendCommand)\fP* rpc, void *arg);
+void FunctionCB(EVRPC_STRUCT(SendCommand)* rpc, void *arg);
 .PP
 To send the reply, call \fBEVRPC_REQUEST_DONE(rpc)\fP;
 .PP
@@ -262,7 +262,7 @@ Generates the code for receiving and sen
 \fIreplystruct\fP the name of the RPC reply structure 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBEVRPC_HEADER()\fP 
 .RE
@@ -298,7 +298,7 @@ Creates the definitions and prototypes f
 \fIreplystruct\fP the name of the RPC reply structure 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBEVRPC_GENERATE()\fP 
 .RE
@@ -403,9 +403,9 @@ register RPCs with the HTTP Server regis
 .PP
 .nf
 do { \
-  struct evrpc_req_generic *_req = (struct evrpc_req_generic *)(rpc_req); \
+  struct evrpc_req_generic *_req = (struct evrpc_req_generic *)(rpc_req); \\
   evrpc_request_done(_req);                 \
-} while (/*CONSTCOND*/0)
+} while (0)
 .fi
 .PP
 Creates the reply to an RPC request\&. EVRPC_REQUEST_DONE is used to answer a request; the reply is expected to have been filled in\&. The request and reply pointers become invalid after this call has finished\&.
@@ -435,7 +435,9 @@ an struct evhttp_request object that can
 .SS "#define EVRPC_STRUCT(rpcname)   struct evrpc_req__##rpcname"
 
 .PP
-The type of a specific RPC Message\&. \fBParameters:\fP
+The type of a specific RPC Message\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIrpcname\fP the name of the RPC message 
 .RE
@@ -444,7 +446,9 @@ The type of a specific RPC Message\&. \f
 .SS "#define EVRPC_UNREGISTER(base, name)   evrpc_unregister_rpc((base), #name)"
 
 .PP
-Unregisters an already registered RPC\&. \fBParameters:\fP
+Unregisters an already registered RPC\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP the evrpc_base object from which to unregister an RPC 
 .br
@@ -456,7 +460,7 @@ Unregisters an already registered RPC\&.
 -1 on error or 0 when successful\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBEVRPC_REGISTER()\fP 
 .RE
@@ -465,7 +469,9 @@ Unregisters an already registered RPC\&.
 .SS "#define EVTAG_ASSIGN(msg, member, value)   (*(msg)->base->member##_assign)((msg), (value))"
 
 .PP
-Assigns a value to the member in the message\&. \fBParameters:\fP
+Assigns a value to the member in the message\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fImsg\fP the message to which to assign a value 
 .br
@@ -478,7 +484,9 @@ Assigns a value to the member in the mes
 .SS "#define EVTAG_ASSIGN_WITH_LEN(msg, member, value, len)   (*(msg)->base->member##_assign)((msg), (value), (len))"
 
 .PP
-Assigns a value to the member in the message\&. \fBParameters:\fP
+Assigns a value to the member in the message\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fImsg\fP the message to which to assign a value 
 .br
@@ -493,7 +501,9 @@ Assigns a value to the member in the mes
 .SS "#define EVTAG_GET(msg, member, pvalue)   (*(msg)->base->member##_get)((msg), (pvalue))"
 
 .PP
-Returns the value for a member\&. \fBParameters:\fP
+Returns the value for a member\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fImsg\fP the message from which to get the value 
 .br
@@ -511,7 +521,9 @@ Returns the value for a member\&. \fBPar
 .SS "#define EVTAG_GET_WITH_LEN(msg, member, pvalue, plen)   (*(msg)->base->member##_get)((msg), (pvalue), (plen))"
 
 .PP
-Returns the value for a member\&. \fBParameters:\fP
+Returns the value for a member\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fImsg\fP the message from which to get the value 
 .br
@@ -531,7 +543,9 @@ Returns the value for a member\&. \fBPar
 .SS "#define EVTAG_HAS(msg, member)   ((msg)->member##_set == 1)"
 
 .PP
-Determines if the member has been set in the message\&. \fBParameters:\fP
+Determines if the member has been set in the message\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fImsg\fP the message to inspect 
 .br
@@ -608,7 +622,7 @@ The add functions return handles that ca
 a handle to the hook so it can be removed later 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevrpc_remove_hook()\fP 
 .RE
@@ -624,7 +638,7 @@ Frees the evrpc base\&. For now, you are
 \fIbase\fP the evrpc_base object to be freed 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevrpc_init\fP 
 .RE
@@ -669,10 +683,12 @@ retrieves meta data previously associate
 .RE
 .PP
 
-.SS "struct evhttp_connection* evrpc_hook_get_connection (void *ctx)\fC [read]\fP"
+.SS "struct evhttp_connection* evrpc_hook_get_connection (void *ctx)"
 
 .PP
-returns the connection object associated with the request \fBParameters:\fP
+returns the connection object associated with the request 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIctx\fP the context provided to the hook call 
 .RE
@@ -683,10 +699,12 @@ a pointer to the evhttp_connection objec
 .RE
 .PP
 
-.SS "struct evrpc_base* evrpc_init (struct evhttp *server)\fC [read]\fP"
+.SS "struct evrpc_base* evrpc_init (struct evhttp *server)"
 
 .PP
-Creates a new rpc base from which RPC requests can be received\&. \fBParameters:\fP
+Creates a new rpc base from which RPC requests can be received\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIserver\fP a pointer to an existing HTTP server 
 .RE
@@ -696,7 +714,7 @@ Creates a new rpc base from which RPC re
 a newly allocated evrpc_base struct 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevrpc_free()\fP 
 .RE
@@ -717,7 +735,7 @@ Makes an RPC request based on the provid
 0 on success, -1 otherwise\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBEVRPC_MAKE_REQUEST()\fP, \fBEVRPC_MAKE_CTX()\fP 
 .RE
@@ -739,18 +757,20 @@ Adds a connection over which rpc can be 
 .SS "void evrpc_pool_free (struct evrpc_pool *pool)"
 
 .PP
-frees an rpc connection pool \fBParameters:\fP
+frees an rpc connection pool 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIpool\fP a pointer to an evrpc_pool allocated via \fBevrpc_pool_new()\fP 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevrpc_pool_new()\fP 
 .RE
 .PP
 
-.SS "struct evrpc_pool* evrpc_pool_new (struct \fBevent_base\fP *base)\fC [read]\fP"
+.SS "struct evrpc_pool* evrpc_pool_new (struct \fBevent_base\fP *base)"
 
 .PP
 creates an rpc connection pool a pool has a number of connections associated with it\&. rpc requests are always made via a pool\&.
@@ -765,7 +785,7 @@ creates an rpc connection pool a pool ha
 a newly allocated struct evrpc_pool object 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevrpc_pool_free()\fP 
 .RE
@@ -804,7 +824,7 @@ Any connection already in the pool will 
 .PP
 Function for registering a generic RPC with the RPC base\&. Do not call this function directly, use \fBEVRPC_REGISTER()\fP instead\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBEVRPC_REGISTER()\fP 
 .RE
@@ -815,7 +835,7 @@ Function for registering a generic RPC w
 .PP
 Low level function for registering an RPC with a server\&. Use \fBEVRPC_REGISTER()\fP instead\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBEVRPC_REGISTER()\fP 
 .RE
@@ -824,7 +844,9 @@ Low level function for registering an RP
 .SS "int evrpc_remove_hook (void *vbase, enum \fBEVRPC_HOOK_TYPE\fPhook_type, void *handle)"
 
 .PP
-removes a previously added hook \fBParameters:\fP
+removes a previously added hook 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIvbase\fP a pointer to either struct evrpc_base or struct evrpc_pool 
 .br
@@ -838,7 +860,7 @@ removes a previously added hook \fBParam
 1 on success or 0 on failure 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBevrpc_add_hook()\fP 
 .RE
@@ -847,7 +869,9 @@ removes a previously added hook \fBParam
 .SS "int evrpc_resume_request (void *vbase, void *ctx, enum \fBEVRPC_HOOK_RESULT\fPres)"
 
 .PP
-resume a paused request \fBParameters:\fP
+resume a paused request 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIvbase\fP a pointer to either struct evrpc_base or struct evrpc_pool 
 .br
@@ -860,7 +884,7 @@ resume a paused request \fBParameters:\f
 .PP
 Function for sending a generic RPC request\&. Do not call this function directly, use \fBEVRPC_MAKE_REQUEST()\fP instead\&.
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBEVRPC_MAKE_REQUEST()\fP 
 .RE
Index: src/external/bsd/libevent/man/rpc_compat.h.3
diff -u src/external/bsd/libevent/man/rpc_compat.h.3:1.1.1.1 src/external/bsd/libevent/man/rpc_compat.h.3:1.2
--- src/external/bsd/libevent/man/rpc_compat.h.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/rpc_compat.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/rpc_compat.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/rpc_compat.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
Index: src/external/bsd/libevent/man/tag.h.3
diff -u src/external/bsd/libevent/man/tag.h.3:1.1.1.1 src/external/bsd/libevent/man/tag.h.3:1.2
--- src/external/bsd/libevent/man/tag.h.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/tag.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/tag.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/tag.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -103,7 +103,9 @@ Encode an integer and store it in an evb
 .SS "int evtag_unmarshal_header (struct \fBevbuffer\fP *evbuf, ev_uint32_t *ptag)"
 
 .PP
-Unmarshals the header and returns the length of the payload\&. \fBParameters:\fP
+Unmarshals the header and returns the length of the payload\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIevbuf\fP the buffer from which to unmarshal data 
 .br
Index: src/external/bsd/libevent/man/tag_compat.h.3
diff -u src/external/bsd/libevent/man/tag_compat.h.3:1.1.1.1 src/external/bsd/libevent/man/tag_compat.h.3:1.2
--- src/external/bsd/libevent/man/tag_compat.h.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/tag_compat.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/tag_compat.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/tag_compat.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -14,6 +14,8 @@ Obsolete/deprecated functions from \fBta
 .PP
 .RI "\fBMisnamed functions\fP"
 .br
+
+.PP
 \fBDeprecated\fP
 .RS 4
 These macros are deprecated because their names don't follow Libevent's naming conventions\&. Use evtag_encode_int and evtag_encode_int64 instead\&.
Index: src/external/bsd/libevent/man/thread.h.3
diff -u src/external/bsd/libevent/man/thread.h.3:1.1.1.1 src/external/bsd/libevent/man/thread.h.3:1.2
--- src/external/bsd/libevent/man/thread.h.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/thread.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/thread.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/thread.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -147,7 +147,9 @@ If you're going to call this function, y
 .SS "int evthread_make_base_notifiable (struct \fBevent_base\fP *base)"
 
 .PP
-Make sure it's safe to tell an event base to wake up from another thread or a signal handler\&. \fBReturns:\fP
+Make sure it's safe to tell an event base to wake up from another thread or a signal handler\&. 
+.PP
+\fBReturns:\fP
 .RS 4
 0 on success, -1 on failure\&. 
 .RE
@@ -162,7 +164,9 @@ Note that if you're using Windows or the
 .SS "void evthread_set_id_callback (unsigned long(*)(void)id_fn)"
 
 .PP
-Sets the function for determining the thread id\&. \fBParameters:\fP
+Sets the function for determining the thread id\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIbase\fP the event base for which to set the id function 
 .br
Index: src/external/bsd/libevent/man/util.h.3
diff -u src/external/bsd/libevent/man/util.h.3:1.1.1.1 src/external/bsd/libevent/man/util.h.3:1.2
--- src/external/bsd/libevent/man/util.h.3:1.1.1.1	Thu Apr 11 16:05:57 2013
+++ src/external/bsd/libevent/man/util.h.3	Thu Jan 29 07:26:03 2015
@@ -1,4 +1,4 @@
-.TH "event2/util.h" 3 "Wed Apr 10 2013" "libevent" \" -*- nroff -*-
+.TH "event2/util.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -350,6 +350,10 @@ These values are possible error codes fo
 .br
 .RI "\fISeed the secure random number generator if needed, and return 0 on success or -1 on failure\&. \fP"
 .ti -1c
+.RI "int \fBevutil_secure_rng_set_urandom_device_file\fP (char *fname)"
+.br
+.RI "\fISet a filename to use in place of /dev/urandom for seeding the secure PRNG\&. \fP"
+.ti -1c
 .RI "int \fBevutil_snprintf\fP (char *buf, size_t buflen, const char *format,\&.\&.\&.)"
 .br
 .RI "\fIReplacement for snprintf to get consistent behavior on platforms for which the return value of snprintf does not conform to C99\&. \fP"
@@ -408,7 +412,7 @@ do {                               \
             (vvp)->tv_sec++;                \
             (vvp)->tv_usec -= 1000000;          \
         }                           \
-    } while (/*CONSTCOND*/0)
+    } while (0)
 .fi
 .SS "#define evutil_timercmp(tvp, uvp, cmp)"
 \fBValue:\fP
@@ -431,7 +435,7 @@ do {                              \
             (vvp)->tv_sec--;                \
             (vvp)->tv_usec += 1000000;          \
         }                           \
-    } while (/*CONSTCOND*/0)
+    } while (0)
 .fi
 .SH "Function Documentation"
 .PP 
@@ -446,7 +450,9 @@ As strncasecmp, but always compares the 
 .SS "int evutil_closesocket (\fBevutil_socket_t\fPsock)"
 
 .PP
-Do the platform-specific call needed to close a socket returned from socket() or accept()\&. \fBParameters:\fP
+Do the platform-specific call needed to close a socket returned from socket() or accept()\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIsock\fP The socket to be closed 
 .RE
@@ -503,7 +509,9 @@ This differs from Windows's interpretati
 .SS "int evutil_make_socket_closeonexec (\fBevutil_socket_t\fPsock)"
 
 .PP
-Do platform-specific operations as needed to close a socket upon a successful execution of one of the exec*() functions\&. \fBParameters:\fP
+Do platform-specific operations as needed to close a socket upon a successful execution of one of the exec*() functions\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIsock\fP The socket to be closed 
 .RE
@@ -517,7 +525,9 @@ Do platform-specific operations as neede
 .SS "int evutil_make_socket_nonblocking (\fBevutil_socket_t\fPsock)"
 
 .PP
-Do platform-specific operations as needed to make a socket nonblocking\&. \fBParameters:\fP
+Do platform-specific operations as needed to make a socket nonblocking\&. 
+.PP
+\fBParameters:\fP
 .RS 4
 \fIsock\fP The socket to make nonblocking 
 .RE
@@ -579,13 +589,23 @@ If you call this function as a \fIreplac
 .SS "void evutil_secure_rng_get_bytes (void *buf, size_tn)"
 
 .PP
-Generate n bytes of secure pseudorandom data, and store them in buf\&. By default, Libevent uses an ARC4-based random number generator, seeded using the platform's entropy source (/dev/urandom on Unix-like systems; CryptGenRandom on Windows)\&. 
+Generate n bytes of secure pseudorandom data, and store them in buf\&. Current versions of Libevent use an ARC4-based random number generator, seeded using the platform's entropy source (/dev/urandom on Unix-like systems; CryptGenRandom on Windows)\&. This is not actually as secure as it should be: ARC4 is a pretty lousy cipher, and the current implementation provides only rudimentary prediction- and backtracking-resistance\&. Don't use this for serious cryptographic applications\&. 
 .SS "int evutil_secure_rng_init (void)"
 
 .PP
 Seed the secure random number generator if needed, and return 0 on success or -1 on failure\&. It is okay to call this function more than once; it will still return 0 if the RNG has been successfully seeded and -1 if it can't be seeded\&.
 .PP
 Ordinarily you don't need to call this function from your own code; Libevent will seed the RNG itself the first time it needs good random numbers\&. You only need to call it if (a) you want to double-check that one of the seeding methods did succeed, or (b) you plan to drop the capability to seed (by chrooting, or dropping capabilities, or whatever), and you want to make sure that seeding happens before your program loses the ability to do it\&. 
+.SS "int evutil_secure_rng_set_urandom_device_file (char *fname)"
+
+.PP
+Set a filename to use in place of /dev/urandom for seeding the secure PRNG\&. Return 0 on success, -1 on failure\&.
+.PP
+Call this function BEFORE calling any other initialization or RNG functions\&.
+.PP
+(This string will \fINOT\fP be copied internally\&. Do not free it while any user of the secure RNG might be running\&. Don't pass anything other than a real /dev/\&.\&.\&.random device file here, or you might lose security\&.)
+.PP
+This API is unstable, and might change in a future libevent version\&. 
 .SS "int evutil_sockaddr_cmp (const struct sockaddr *sa1, const struct sockaddr *sa2, intinclude_port)"
 
 .PP

Reply via email to