]> granicus.if.org Git - libevent/log
libevent
12 years agoAdd an (internal) usleep function for use by unit tests
Nick Mathewson [Tue, 24 Jan 2012 16:42:26 +0000 (11:42 -0500)]
Add an (internal) usleep function for use by unit tests

12 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Tue, 24 Jan 2012 16:17:06 +0000 (11:17 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

12 years agoOops:remove an accidentally committed "sleep(1)" in a unit test
Nick Mathewson [Tue, 24 Jan 2012 16:16:26 +0000 (11:16 -0500)]
Oops:remove an accidentally committed "sleep(1)" in a unit test

12 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Tue, 24 Jan 2012 16:04:56 +0000 (11:04 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

12 years agoWorkaround in the unit tests for an apparent epoll bug in Linux 3.2
Nick Mathewson [Tue, 24 Jan 2012 16:04:19 +0000 (11:04 -0500)]
Workaround in the unit tests for an apparent epoll bug in Linux 3.2

12 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Tue, 24 Jan 2012 15:29:31 +0000 (10:29 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

Conflicts:
event.c

Edits required in:
        evmap.c

12 years agoFix a fd leak in event_reinit()
Nick Mathewson [Mon, 23 Jan 2012 23:15:44 +0000 (18:15 -0500)]
Fix a fd leak in event_reinit()

We were supposed to be closing the ev_signal_pair sockets.

12 years agoFix a list corruption bug when using event_reinit() with signals present
Nick Mathewson [Mon, 23 Jan 2012 22:59:16 +0000 (17:59 -0500)]
Fix a list corruption bug when using event_reinit() with signals present

While re-adding all the events, event_reinit() could add a signal
event, which could then cause evsig_add() to add the
base->sig.ev_signal event.  Later on its merry path through
base->eventqueue, event_reinit() would find that same event and give
it to event_io_add a second time.  This would make the ev_io_next
list for that fd become circular.  Ouch!

12 years agoCheck event_base correctness at end of each unit test
Nick Mathewson [Mon, 23 Jan 2012 22:43:35 +0000 (17:43 -0500)]
Check event_base correctness at end of each unit test

12 years agoFix compilation of windows evutil_check_ifaddrs
Nick Mathewson [Mon, 23 Jan 2012 03:27:16 +0000 (22:27 -0500)]
Fix compilation of windows evutil_check_ifaddrs

12 years agoAdd function to check referential integrity of an event_base
Nick Mathewson [Sat, 21 Jan 2012 17:55:15 +0000 (12:55 -0500)]
Add function to check referential integrity of an event_base

12 years agoMerge remote-tracking branch 'github/linked_list'
Nick Mathewson [Fri, 20 Jan 2012 21:31:20 +0000 (16:31 -0500)]
Merge remote-tracking branch 'github/linked_list'

Conflicts:
include/event2/event_struct.h

12 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Fri, 20 Jan 2012 16:40:39 +0000 (11:40 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

12 years agoForce strict validation of HTTP version in response.
Catalin Patulea [Tue, 10 Jan 2012 23:33:58 +0000 (18:33 -0500)]
Force strict validation of HTTP version in response.

This sometimes accepted invalid versions like 'ICY' (n = 0, major = undefined, sometimes > 1).

12 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 16 Jan 2012 19:47:05 +0000 (14:47 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

12 years agoSuppress a gcc warning from ignoring fwrite return in http-sample.c
Nick Mathewson [Mon, 16 Jan 2012 19:45:31 +0000 (14:45 -0500)]
Suppress a gcc warning from ignoring fwrite return in http-sample.c

Found by Steve Snyder

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 9 Jan 2012 21:54:19 +0000 (16:54 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoFix a race condition in the dns/bufferevent_connect_hostname test.
Nick Mathewson [Mon, 9 Jan 2012 21:44:53 +0000 (16:44 -0500)]
Fix a race condition in the dns/bufferevent_connect_hostname test.

As originally written, the test would only pass if the accept()
callbacks for the evconnlistener were all invoked before the last of
the CONNECTED/ERROR callbacks for the connecting/resolving bufferevent
had its call to event_base_loopexit() complete.  But this was only
accidentally true in 2.0, and might not be true at all in 2.1 where
we schedule event_base_once() callbacks more aggressively.

Found by Sebastian Hahn.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 9 Jan 2012 17:00:04 +0000 (12:00 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoMake evconnlistener work around bug in older Linux when getting nmapped
Nick Mathewson [Mon, 9 Jan 2012 16:49:41 +0000 (11:49 -0500)]
Make evconnlistener work around bug in older Linux when getting nmapped

Older Linuxes sometimes respond to some nmap probes by having accept()
return a success but with socklen 0.  That can lead to confusing behavior
when you go to process the sockaddr.

13 years agoRemove bogus casts of socket to int before calling ev_callback
Nick Mathewson [Mon, 9 Jan 2012 16:33:38 +0000 (11:33 -0500)]
Remove bogus casts of socket to int before calling ev_callback

This should make 64-bit windows act better.

Found by Mark Heily.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Wed, 14 Dec 2011 21:28:18 +0000 (16:28 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoBackport evhttp_connection_get_bufferevent to Libevent 2.0
Arno Bakker [Wed, 14 Dec 2011 21:17:19 +0000 (16:17 -0500)]
Backport evhttp_connection_get_bufferevent to Libevent 2.0

Backport by Arno Bakker; original implementation in 8d3a8500f4

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 8 Dec 2011 19:38:04 +0000 (14:38 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoSlightly clarify evbuffer_peek documentation
Nick Mathewson [Thu, 8 Dec 2011 19:36:32 +0000 (14:36 -0500)]
Slightly clarify evbuffer_peek documentation

13 years agoFix behavior of evbuffer_peek(buf,-1,NULL,NULL,0)
Zack Weinberg [Thu, 8 Dec 2011 19:30:20 +0000 (14:30 -0500)]
Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0)

(Patch altered by nickm to not affect the behavior of
evbuffer_peek(buf,-1,NULL,vec,n_vec).)

13 years agoRemove some accidentally-committed debugging code
Nick Mathewson [Thu, 8 Dec 2011 19:11:30 +0000 (14:11 -0500)]
Remove some accidentally-committed debugging code

13 years agowhitespace fixes
Nick Mathewson [Thu, 8 Dec 2011 19:05:47 +0000 (14:05 -0500)]
whitespace fixes

13 years agoMerge remote-tracking branch 'fancycode/buffer_references'
Nick Mathewson [Thu, 8 Dec 2011 19:04:04 +0000 (14:04 -0500)]
Merge remote-tracking branch 'fancycode/buffer_references'

Conflicts:
buffer.c

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 8 Dec 2011 16:43:04 +0000 (11:43 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

Conflicts:
configure.in

13 years agocheck for sysctl before we use it
Mike Frysinger [Thu, 8 Dec 2011 16:39:48 +0000 (11:39 -0500)]
check for sysctl before we use it

Not all C libraries under Linux support the sysctl() func.

13 years agoSplit up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in
Nick Mathewson [Wed, 7 Dec 2011 23:29:06 +0000 (18:29 -0500)]
Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in

13 years agoMerge branch '21_ifaddr'
Nick Mathewson [Wed, 7 Dec 2011 23:17:34 +0000 (18:17 -0500)]
Merge branch '21_ifaddr'

13 years agoUse getifaddrs to detect our interfaces if possible
Nick Mathewson [Wed, 7 Dec 2011 23:16:32 +0000 (18:16 -0500)]
Use getifaddrs to detect our interfaces if possible

The old scheme involved connected UDP sockets and getsockname(), and is
generally best avoied.

13 years agoChanged use of refcounts to make sure referenced chains are freed in all cases.
Joachim Bauch [Wed, 7 Dec 2011 20:06:10 +0000 (21:06 +0100)]
Changed use of refcounts to make sure referenced chains are freed in all cases.

13 years agoAdd evbuffer_copyout_from to copy data from the middle of a buffer
Nick Mathewson [Wed, 7 Dec 2011 18:04:35 +0000 (13:04 -0500)]
Add evbuffer_copyout_from to copy data from the middle of a buffer

You could previously do this with evbuffer_peek() and some memcpys,
but it was a bit more work than most folks wanted to get into.

Closes sourceforge ticket 3108072

13 years agoBypass event_add when using event_base_once() for a 0-sec timeout
Nick Mathewson [Wed, 7 Dec 2011 16:49:52 +0000 (11:49 -0500)]
Bypass event_add when using event_base_once() for a 0-sec timeout

Some people use event_base_once(EV_TIMEOUT) to make a callback get
called "immediately".  But this is pretty roundabout: it uses the
timeout heap to immediately put the event onto the active queue, when
it could just use event_active.  Additionally, it can lead to
surprising re-ordering behavior.

This patch changes event_base_once so it bypasses event_add() and
called event_active() directly on a pure-timeout event with an empty
timeout.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Tue, 6 Dec 2011 18:38:40 +0000 (13:38 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoFix a silly compilation error with the sun compiler
Colin Watt [Tue, 6 Dec 2011 18:35:54 +0000 (13:35 -0500)]
Fix a silly compilation error with the sun compiler

Apparently, other compilers were allowing "return free(x)" in a
function returning void.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Tue, 6 Dec 2011 16:02:12 +0000 (11:02 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoBe absolutely sure to clear pncalls before leaving event_signal_closure
Nick Mathewson [Mon, 5 Dec 2011 20:02:27 +0000 (15:02 -0500)]
Be absolutely sure to clear pncalls before leaving event_signal_closure

I thought we'd fixed the cases where this could come up, but
apparently having an event_base_break() happen while processing
signal events could get us in trouble.

Found by Remi Gacogne.  Sourceforge issue 3451433 .

13 years agofix windows compilation issues with new file segment code
Nick Mathewson [Fri, 2 Dec 2011 06:48:14 +0000 (01:48 -0500)]
fix windows compilation issues with new file segment code

Found by Linus Nordberg

13 years agoFix two issues in the allow_dirty_shutdown code.
Nick Mathewson [Thu, 24 Nov 2011 17:31:50 +0000 (12:31 -0500)]
Fix two issues in the allow_dirty_shutdown code.

First, it shouldn't crash when it's passed a non-ssl bufferevent.

Second, it should behave correctly when it gets a true argument
other than 1.

13 years agoTweak allow_dirty_shutdown documentation
Nick Mathewson [Thu, 24 Nov 2011 17:24:38 +0000 (12:24 -0500)]
Tweak allow_dirty_shutdown documentation

13 years agoAllow users to set allow_dirty_shutdown
Catalin Patulea [Tue, 22 Nov 2011 00:57:19 +0000 (19:57 -0500)]
Allow users to set allow_dirty_shutdown

13 years agobev_ssl: Be more specific in event callbacks. evhttp in particular gets confused...
Catalin Patulea [Tue, 22 Nov 2011 00:24:50 +0000 (19:24 -0500)]
bev_ssl: Be more specific in event callbacks. evhttp in particular gets confused without at least one of BEV_EVENT_{READING|WRITING}.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Fri, 18 Nov 2011 20:35:33 +0000 (15:35 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoIncrement version to 2.0.16-stable-dev
Nick Mathewson [Fri, 18 Nov 2011 20:34:37 +0000 (15:34 -0500)]
Increment version to 2.0.16-stable-dev

13 years agoIncrement version to 2.0.16-stable release-2.0.16-stable
Nick Mathewson [Fri, 18 Nov 2011 20:27:06 +0000 (15:27 -0500)]
Increment version to 2.0.16-stable

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Fri, 18 Nov 2011 20:16:11 +0000 (15:16 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoRevise 2.0.16-stable changelog
Nick Mathewson [Fri, 18 Nov 2011 20:14:50 +0000 (15:14 -0500)]
Revise 2.0.16-stable changelog

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Fri, 18 Nov 2011 19:23:13 +0000 (14:23 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoadd comment to new consider_reading code
Nick Mathewson [Thu, 17 Nov 2011 22:42:45 +0000 (17:42 -0500)]
add comment to new consider_reading code

13 years agoAvoid spinning on OpenSSL reads
Mark Ellzey [Thu, 17 Nov 2011 16:59:41 +0000 (11:59 -0500)]
Avoid spinning on OpenSSL reads

Previously, if some sender were generating data to read on an
OpenSSL connection as fast as we could process it, we could easily
wind up looping on an openssl do_read operation without ever
considering other sockets.

The difference between this and the original method in
consider_reading() is that it only loops for a single completed
*frame* instead of looping until fd is drained or an error condition
was triggered.

{Patch split out by nickm}

13 years agoMove SSL rate-limit enforcement into bytes_to_read()
Nick Mathewson [Thu, 17 Nov 2011 16:54:07 +0000 (11:54 -0500)]
Move SSL rate-limit enforcement into bytes_to_read()

13 years agoRefactor amount-to-read calculations in buffervent_ssl consider_reading()
Mark Ellzey [Thu, 17 Nov 2011 16:45:49 +0000 (11:45 -0500)]
Refactor amount-to-read calculations in buffervent_ssl consider_reading()

Split up consider_reading()'s conditional checks into another function
can_read() for simplicity sake.

{Split into a separate patch by nickm}

13 years agoRevert "Avoid potential SSL read spinlocks"
Nick Mathewson [Tue, 15 Nov 2011 23:34:24 +0000 (18:34 -0500)]
Revert "Avoid potential SSL read spinlocks"

This reverts commit fc52dbac87f4937f8306759506d6a2ad15ca244c.

13 years agoRevert "openssl bufferevent has the same issue with writing as prior commit."
Nick Mathewson [Tue, 15 Nov 2011 23:33:50 +0000 (18:33 -0500)]
Revert "openssl bufferevent has the same issue with writing as prior commit."

This reverts commit 7353663eb7c0b2a1caaaa5acd818515f156cf2ca.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Tue, 15 Nov 2011 22:22:45 +0000 (17:22 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoAdd new entries to changelog, new credits to README
Nick Mathewson [Tue, 15 Nov 2011 22:22:12 +0000 (17:22 -0500)]
Add new entries to changelog, new credits to README

13 years agoFix DNS memleak checks when running with malloc-replacement/debugging disabled
Nick Mathewson [Tue, 15 Nov 2011 22:11:42 +0000 (17:11 -0500)]
Fix DNS memleak checks when running with malloc-replacement/debugging disabled

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 14 Nov 2011 23:22:08 +0000 (18:22 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoDon't try to make notifiable event_base when no threading fns are configured
Nick Mathewson [Mon, 14 Nov 2011 22:33:02 +0000 (17:33 -0500)]
Don't try to make notifiable event_base when no threading fns are configured

13 years agoWarn when unable to construct base because of failing make_base_notifiable
Nick Mathewson [Mon, 14 Nov 2011 22:32:22 +0000 (17:32 -0500)]
Warn when unable to construct base because of failing make_base_notifiable

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 14 Nov 2011 16:55:37 +0000 (11:55 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoopenssl bufferevent has the same issue with writing as prior commit.
Mark Ellzey [Mon, 14 Nov 2011 15:57:15 +0000 (10:57 -0500)]
openssl bufferevent has the same issue with writing as prior commit.

13 years agoAvoid potential SSL read spinlocks
Mark Ellzey [Mon, 14 Nov 2011 15:24:07 +0000 (10:24 -0500)]
Avoid potential SSL read spinlocks

OpenSSL bufferevents with deferred callbacks enabled under high load will
spinlock in the function consider_reading(). This loop continues until all
data has been read.

Because of this condition; openssl bufferevents will never return back into
event_base_loop() until SSL_read has determined data is no longer ready.

As of yet I have not found a reason why this while loop exists, so this patch
just swaps out while for if.

If needed I can write same code which would trigger this effect; optionally
libevhtp has a test.c program which can be run with the following flags:

./test -s <keyfile.pem>

curl -vvvv -k -d@<HUGE_ASS_FILE> https://127.0.0.1:8081/

The return data will include the number of times the readcb got data and the
length of that read.

Without this patch, you are likely to see a small amount of "bytes read....",
otherwise the "bytes read..." return data should show much more reasonable
numbers.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 14 Nov 2011 16:45:17 +0000 (11:45 -0500)]
Merge remote-tracking branch 'origin/patches-2.0'

Conflicts:
sample/dns-example.c

13 years agounit tests for EVBUFFER_EOL_NUL
Nick Mathewson [Mon, 14 Nov 2011 16:43:31 +0000 (11:43 -0500)]
unit tests for EVBUFFER_EOL_NUL

13 years agoNew EVBUFFER_EOL_NUL to read NUL-terminated strings from an evbuffer
Andrea Montefusco [Mon, 14 Nov 2011 16:42:52 +0000 (11:42 -0500)]
New EVBUFFER_EOL_NUL to read NUL-terminated strings from an evbuffer

13 years agoTweaks, fixups, and comments on evbuffer_add_iovec
Nick Mathewson [Fri, 11 Nov 2011 22:56:08 +0000 (17:56 -0500)]
Tweaks, fixups, and comments on evbuffer_add_iovec

13 years agoAdded evbuffer_add_iovec and unit tests.
Mark Ellzey [Tue, 25 Oct 2011 13:13:15 +0000 (09:13 -0400)]
Added evbuffer_add_iovec and unit tests.

13 years agoImprove win32 behavior of dns-sample.c codex
Gisle Vanem [Wed, 9 Nov 2011 05:17:56 +0000 (00:17 -0500)]
Improve win32 behavior of dns-sample.c codex

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 3 Nov 2011 15:45:43 +0000 (11:45 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoFix typo in whatsnew-2.0.txt
Mansour Moufid [Thu, 3 Nov 2011 15:43:49 +0000 (11:43 -0400)]
Fix typo in whatsnew-2.0.txt

13 years agoMerge remote-tracking branch 'github/20_evbuffer_remove_bug'
Nick Mathewson [Thu, 3 Nov 2011 03:15:07 +0000 (23:15 -0400)]
Merge remote-tracking branch 'github/20_evbuffer_remove_bug'

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 3 Nov 2011 03:14:24 +0000 (23:14 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoUse the free-trailing-chains function in evbuffer_insert_chain too
Nick Mathewson [Thu, 3 Nov 2011 02:50:47 +0000 (22:50 -0400)]
Use the free-trailing-chains function in evbuffer_insert_chain too

13 years agoFix an evbuffer crash in evbuffer_remove_buffer()
Nick Mathewson [Wed, 2 Nov 2011 20:09:15 +0000 (16:09 -0400)]
Fix an evbuffer crash in evbuffer_remove_buffer()

Found by Greg Hazel.

13 years agoimprove test to remove at least one buffer from src
Greg Hazel [Wed, 2 Nov 2011 22:19:05 +0000 (15:19 -0700)]
improve test to remove at least one buffer from src

13 years agounit test for remove_buffer bug
Greg Hazel [Tue, 1 Nov 2011 20:44:40 +0000 (13:44 -0700)]
unit test for remove_buffer bug

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Mon, 31 Oct 2011 02:34:00 +0000 (22:34 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoFix compile warning from saying event2/*.h inside a comment
Nick Mathewson [Mon, 31 Oct 2011 02:32:18 +0000 (22:32 -0400)]
Fix compile warning from saying event2/*.h inside a comment

Based on a patch by Adrian Chadd

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Wed, 26 Oct 2011 14:17:21 +0000 (10:17 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoepoll: close fd on alloc fail at initialization
Jamie Iles [Wed, 26 Oct 2011 12:24:30 +0000 (13:24 +0100)]
epoll: close fd on alloc fail at initialization

If the memory allocations fail then we free any other allocated
structures but don't close the file descriptor resulting in an leak of
fd's.

13 years agoevhttp: Add evhttp_foreach_bound_socket.
Samy Al Bahra [Mon, 24 Oct 2011 01:31:55 +0000 (01:31 +0000)]
evhttp: Add evhttp_foreach_bound_socket.

Applies the function specified in the first argument to all
evhttp_bound_sockets associated with a struct evhttp. The user
must not attempt to free or remove any connections, sockets or
listeners in the callback function.

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Tue, 25 Oct 2011 15:43:01 +0000 (11:43 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoUpdate copyright dates to 2011.
Nick Mathewson [Mon, 24 Oct 2011 17:18:09 +0000 (13:18 -0400)]
Update copyright dates to 2011.

13 years agoNew event_base_update_cache_time() to set cached_tv to current time
Abel Mathew [Fri, 21 Oct 2011 19:53:32 +0000 (19:53 +0000)]
New event_base_update_cache_time() to set cached_tv to current time

This function is particularly useful for selectively increasing
the accuracy of the cached time value in 'base' during callbacks
that take a long time to execute.

This function has no effect if the base is currently not in its
event loop or if timeval caching is disabled via EVENT_BASE_FLAG_NO_CACHE_TIME.

13 years agoAdd argument checks to some memory functions in `event.c'.
Mansour Moufid [Fri, 14 Oct 2011 21:16:03 +0000 (17:16 -0400)]
Add argument checks to some memory functions in `event.c'.

Add a zero check to the function `event_mm_malloc_',
i.e. simply return NULL if the sz argument is zero.
On failure, set errno to ENOMEM and return NULL.

Add a zero check to the function `event_mm_calloc_',
i.e. simply return NULL if either argument is zero.
Also add an unsigned integer multiplication check, and if an integer
overflow would occur, set errno to ENOMEM and return NULL.
On failure, set errno to ENOMEM and return NULL.

Add a NULL check to the function `event_mm_strdup_',
i.e. set errno to EINVAL and return NULL.
Also add an unsigned integer addition check, and if an integer
overflow would occur, set errno to ENOMEM and return NULL.
If a memory allocation error occurs, again set errno to ENOMEM
and return NULL.

Add unit tests to `test/regress_util.c'.

13 years agoAdd note about evhttp_send_reply_end to its doxygen
Nick Mathewson [Thu, 20 Oct 2011 02:59:47 +0000 (22:59 -0400)]
Add note about evhttp_send_reply_end to its doxygen

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 20 Oct 2011 02:44:33 +0000 (22:44 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoMore detailed message in case of libevent self-debugging failure.
Leonid Evdokimov [Wed, 19 Oct 2011 13:44:17 +0000 (17:44 +0400)]
More detailed message in case of libevent self-debugging failure.

13 years agoStyle and comment tweaks for dns/leak* tests
Nick Mathewson [Thu, 20 Oct 2011 02:41:11 +0000 (22:41 -0400)]
Style and comment tweaks for dns/leak* tests

13 years agoTest for commit aff6ba1
Leonid Evdokimov [Tue, 18 Oct 2011 13:49:40 +0000 (17:49 +0400)]
Test for commit aff6ba1

13 years agoMerge remote-tracking branch 'origin/patches-2.0'
Nick Mathewson [Thu, 20 Oct 2011 02:20:15 +0000 (22:20 -0400)]
Merge remote-tracking branch 'origin/patches-2.0'

13 years agoEmpty DNS reply with OK status is another way to say NODATA.
Leonid Evdokimov [Wed, 19 Oct 2011 18:38:37 +0000 (22:38 +0400)]
Empty DNS reply with OK status is another way to say NODATA.

Sometimes DNS reply has nothing but query section. It does not look like
error, so it should be treated as NODATA with TTL=0 as soon as there is
no SOA record to deduce negative TTL from.

13 years agoTests for 94fba5b and f72e8f6
Leonid Evdokimov [Wed, 19 Oct 2011 18:36:12 +0000 (22:36 +0400)]
Tests for 94fba5b and f72e8f6

13 years agofixed typo
Joachim Bauch [Mon, 17 Oct 2011 19:48:23 +0000 (21:48 +0200)]
fixed typo

13 years agoadded comments to describe refcounting of multicase chains
Joachim Bauch [Mon, 17 Oct 2011 19:46:12 +0000 (21:46 +0200)]
added comments to describe refcounting of multicase chains