summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Allow empty reason line in HTTP statusHEADmasterPierre Phaneuf2010-04-28
|
* Remove redundant checks for lock!=NULL before calling EVLOCK_LOCKNick Mathewson2010-04-28
| | | | | | | | | | | | | The EVLOCK_LOCK and EVLOCK_UNLOCK macros already check to make sure that the lock is present before messing with it, so there's no point in checking the lock before calling them. A good compiler should be able to simplify code like if (lock) { if (lock) acquire(lock); } , but why count on it?
* Fix compilation when openssl support is disabledNick Mathewson2010-04-28
| | | | | Previously, we'd fail if OpenSSL was present but openssl support was disabled. Now we don't.
* Catch attempts to enable debug_mode too lateNick Mathewson2010-04-28
| | | | | | | | | | Debug mode needs to be enabled before any event is setup or any event_base is created. Otherwise, we will not have recorded when events were first setup or added, and so it will look like a bug later when we delete or free them. I have already confused myself because of this requirement, so let's make Libevent catch it for the next poor forgetful developer like me.
* Make debug mode catch mixed ET and non-ET events on an fdNick Mathewson2010-04-28
| | | | | | | | Of the backends that support edge-triggered IO, most (all?) do not support attempts to mix edge-triggered and level-triggered IO on the same FD. With debugging mode enabled, we now detect and refuse attempts to add a level-triggered IO event to an fd that already has an edge-triggered IO event, and vice versa.
* Release locks on bufferevents while executing callbacksJoachim Bauch2010-04-27
| | | | | | This fixes a dead lock for me where bufferevents in different event loops use each other and access their input/output buffers (proxy-like scenario).
* Merge branch 'rpc_leaks'Nick Mathewson2010-04-24
|\
| * Fix a memory leak when unmarshalling RPC object arraysNick Mathewson2010-04-23
| | | | | | | | | | | | | | The old code would use type_var_add() for its side-effect of expanding the array, then leak the new object that was added to the array. The new code adds a static function to handle the array resizing.
| * fix a leak when unpausing evrpc requestsNick Mathewson2010-04-23
| |
* | Merge branch 'arc4seed'Nick Mathewson2010-04-24
|\ \ | |/ |/|
| * Fix a couple of bugs in the BSD sysctl arc4seed logicNick Mathewson2010-04-23
| | | | | | | | | | | | Of course, FreeBSD has its own arc4random() implementation, so this should never actually be needed. Still, it's good to paint the underside of the wagon.
| * Document evutil_secure_rng_init() and evutil_secure_rng_add_bytes()Nick Mathewson2010-04-23
| |
| * Make evutil_secure_rng_init() work even with builtin arc4randomNick Mathewson2010-04-23
| |
| * Seed the RNG using sysctl() as well as /dev/urandomNick Mathewson2010-04-23
| | | | | | | | | | | | | | | | | | | | | | William Ahern points out that if the user has chrooted, they might not have a working /dev/urandom. Linux and many of the BSDs, however, define a sysctl interface to their kernel random number generators. This patch takes a belt-and-suspenders approach and tries to do use the sysctl _and_ the /dev/urandom approach if both are present. When using the sysctl approach, it tries to bulletproof itself by checking to make sure that the buffers are actually set by the sysctl calls.
* | Make http_base_test stop leaking an event_base.Nick Mathewson2010-04-23
| |
* | Remove one last bug in last_with_datap logic. Found with valgrindNick Mathewson2010-04-23
| |
* | do not leak the request object on persistent connectionsNiels Provos2010-04-23
|/
* Make evdns logging threadsafeNick Mathewson2010-04-23
| | | | | | | | | The old logging code was littered with places where we stored messages in static char[] fields. This is fine in a single-threaded program, but if you ever tried to log evdns messages from two threads at once, you'd hit a race. This patch also refactors evdns's debug_ntop function into a more useful evutil_sockaddr_port_format() function, with unit tests.
* Add a comment to explain why evdns_request is now separte from requestNick Mathewson2010-04-23
|
* Add dns/search_cancel unit test.Christopher Davis2010-04-22
|
* Assert for valid requests as necessary.Christopher Davis2010-04-22
| | | | | A valid request has an associated handle, and the handle must point to the request.
* Free search state when finished searching to avoid an infinite loop.Christopher Davis2010-04-21
|
* Move domain search state to evdns_request.Christopher Davis2010-04-21
| | | | | It doesn't seem to make sense to copy the state to each new request in the search.
* Ensure that evdns_request is a persistent handle.Christopher Davis2010-04-21
| | | | | | | | | | When searching is enabled, evdns may make multiple requests before calling the user callback with the result. This is a problem because the same evdns_request handle is not retained for each search request, so the user cannot reliably cancel the request. This patch attempts to ensure that evdns_request persists accross search requests.
* Clean up properly when adding a signal handler fails.Gilad Benjamini2010-04-21
| | | | | | | Previously, when a signation() or signal() call failed, we would free the element we added to sh_old, but not actually clear the pointer. This would leave a dangling pointer in sh_old that could cause a crash later.
* Replace EVUTIL_CLOSESOCKET macro with a functionSebastian Sjöberg2010-04-14
| | | | | | | | | | | The EVUTIL_CLOSESOCKET() macro required you to include unistd.h in your source for POSIX. We might as well turn it into a function: an extra function call is going to be cheap in comparison with the system call. We retain the EVUTIL_CLOSESOCKET() macro as an alias for the new evutil_closesocket() function. (commit message from email by Nick and Sebastian)
* Add ctags/etags files to .gitignoreNick Mathewson2010-04-14
|
* Add void* arguments to request_new and reply_new evrpc hooksShuo Chen2010-04-14
| | | | | | | | | | | | | | This makes evprc setup more extensible, and helps with Shuo Chen's work on implementing Google protocol buffers rpc on top of Libevent 2 evrpc. This patch breaks binary compatibility with previous versions of Libevent, since it changes struct evrpc and the signature of evrpc_register_generic(). Since all compliant code should be calling evrpc_register_generic via EVRPC_REGISTER, it shouldn't break source compatibility. (Code by Shuo Chen; commit message by Nick)
* Expose the request and reply members of rpc_req_generic()Shuo Chen2010-04-14
| | | | | | | This code adds two accessor functions to evprc, and helps integrate evrpc with Google protocol buffers. (Code by Shuo Chen; commit message by nickm)
* Initialize last_with_datap correctly in evbuffer_overlappedNick Mathewson2010-04-14
| | | | Fixes bug 2985406
* Create shared libraries under WindowsGiuseppe Scrivano2010-04-13
|
* Do not inhibit automake dependencies generationGiuseppe Scrivano2010-04-13
| | | | It fixes make parallel builds.
* Fix compiler warnings under WIN32Giuseppe Scrivano2010-04-13
|
* Merge branch 'evbuffer_copyout'Nick Mathewson2010-04-13
|\
| * Add evbuffer_copyout to copy data from an evbuffer without drainingNick Mathewson2010-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The evbuffer_remove() function copies data from the front of an evbuffer into an array of char, and removes the data from the buffer. This function behaves the same, but does not remove the data. This behavior can be handy for lots of protocols, where you want the evbuffer to accumulate data until a complete record has arrived. Lots of people have asked for a function more or less like this, and though it isn't too hard to code one from evbuffer_peek(), it is apparently annoying to do it in every app you write. The evbuffer_peek() function is significantly faster, but it requires that the user be able to handle data in separate extents. This patch also reimplements evbufer_remove() as evbuffer_copyout() followed by evbuffer_drain(). I am reasonably confident that this won't be a performance hit: the memcpy() overhead should dominate the cost of walking the list an extra time.
* | Merge branch 'safetimevalms'Christopher Davis2010-04-10
|\ \ | |/ |/|
| * Always round up when there's a fractional number of msecs.Christopher Davis2010-04-09
| |
| * Add evutil_tv_to_msec for safe conversion of timevals to milliseconds.Christopher Davis2010-03-31
| | | | | | | | | | This is useful for backends that require their timeout values be in milliseconds.
* | Limit the maximum number of events on each socket to 65535Nick Mathewson2010-04-09
| | | | | | | | | | This lets us use less RAM for the evmap_io structure, which in turn can let us have fewer cache misses for evmap operations.
* | Merge branch 'comment'Nick Mathewson2010-04-09
|\ \
| * | Add a few more evmap/changelist commentsNick Mathewson2010-04-09
| |/
* | Test another case of evbuffer_prependNick Mathewson2010-04-09
| |
* | Add more unit tests for evbuffer_expandNick Mathewson2010-04-09
| |
* | Unit-test every evbuffer_add_file() implementation.Nick Mathewson2010-04-09
| | | | | | | | | | Previously, we'd only test the default one, even if the others were still compiled in.
* | Clean up a mistake in pointer manipulation in evbuffer_removeChristopher Davis2010-04-02
| |
* | Rewrite evbuffer_expand and its usersNick Mathewson2010-03-31
| | | | | | | | | | | | | | | | | | | | | | | | The previous evbuffer_expand was not only incorrect; it was inefficient too. On all questions of time vs memory tradeoffs, it chose to burn time in order to avoid wasting memory. The new code tries to be a little more balanced: it only resizes an existing chain when doing so doesn't require too much copying, and when failing to do so would waste a lot of the chain's space. This patch also rewrites evbuffer_chain_insert to work properly with last_with_datap, and adds a few convenience functions to buffer.c.
* | Fix a memory leak when appending/prepending to a buffer with unused space.Nick Mathewson2010-03-31
| |
* | Make the no_iovecs case of write_atmost compileNick Mathewson2010-03-31
| | | | | | | | | | | | Apparently nobody had tested it before on a system that had sendfile. Why would you have sendfile and not writev? Perhaps you're trying to test the no-iovecs code to make sure it still works.
* | Turn the increasingly complex *_CHAIN() macros into functionsNick Mathewson2010-03-31
| |
* | Replace last_with_data with a slightly smarter versionNick Mathewson2010-03-31
| | | | | | | | | | | | | | To implement evbuffer_expand() properly, you need to be able to replace the last chunk that has data, which means that we need to keep track of the the next pointer pointing to the last_with_data chunk, not the last_with_data chunk itself.