2100 Commits

Author SHA1 Message Date
Nick Mathewson
e6af35d762 Correctly terminate IO on an async bufferevent on bufferevent_free 2011-08-28 14:39:12 -04:00
Nick Mathewson
0ff2c5a922 Have test-ratelim.c support IOCP 2011-08-28 14:39:12 -04:00
Nick Mathewson
a98da7bfc9 Make IOCP rate-limiting group support stricter and less surprising.
Previously, we wouldn't decrement read/write buckets because of IOCP
reads and writes until those reads and writes were complete.  That's
not so bad on the per-connection front.  But for group limits, the
old approach makes us launch a huge amount of reads and writes
whenever the group limit becomes positive, and then decrement the
limit to a hugely negative number as they complete.

With this patch, we decrement our read buckets whenever we launch an
IOCP read or write, based on the maximum that tried to read or
write.  Later, when the operations finish, we re-increment the
bucket based on the portion of the request that couldn't finish.
2011-08-28 14:39:11 -04:00
Nick Mathewson
c75341b077 Support negative arguments to _bufferevent_decrement_(read/write)_buckets() 2011-08-28 14:39:11 -04:00
Nick Mathewson
2f51dc0311 Cleanup on 7c11e51e1ab: fix strtol usage 2011-08-28 14:03:10 -04:00
Nick Mathewson
6056d6e0df Cleanup on 7c11e51e1ab: restore c90 declaration compliance 2011-08-28 14:02:40 -04:00
Harlan Stenn
7c11e51e1a Clean up some problems identified by Coverity. 2011-08-28 13:44:33 -04:00
Nick Mathewson
5b18f13048 Make rate limiting work with common_timeout logic 2011-08-24 16:17:05 -04:00
Nick Mathewson
6736852eaa Merge branch '20_iocp_fixes' into patches-2.0 2011-08-18 15:09:44 -04:00
Nick Mathewson
6acfbdd83a Make overlapped reads result in evbuffer callbacks getting invoked 2011-08-18 13:15:46 -04:00
Nick Mathewson
495c227f59 IOCP: don't launch reads or writes on an unconnected socket 2011-08-18 11:41:55 -04:00
Dave Hart
04656ea85a Try to fix 'make distcheck' errors when building out-of-tree 2011-08-17 22:04:38 -04:00
Nick Mathewson
e067d0e3ac Merge branch '20_low_ratelim' into patches-2.0 2011-08-17 21:47:19 -04:00
Michael Herf
643922e907 Solaris sendfile: correctly detect amount of data sent
Original message:

   Solaris sendfile seems to fail when sending moderately large (<1GB)
   files. Not a 32/64 problem, but a buffer problem.

   Anyone else ever try this? It is definitely broken in http-server.c.

   It seems to be broken in the following way:

   When sendfile sends partial data (EAGAIN, would block), "res" is
   always -1, rather than the amount sent.

   Here's a patch that reads from the "offset" pointer instead to
   discover what was sent. This seems to work:
2011-08-15 13:39:10 -04:00
Leonid Evdokimov
aff6ba15a1 Fix request_finished memory leak with debugging turned on. 2011-08-15 11:12:57 -04:00
Leonid Evdokimov
9b724b288a Fix evsig_dealloc memory leak with debugging turned on. 2011-08-15 11:12:52 -04:00
Leonid Evdokimov
50be5a14b5 Another docstring fix. 2011-08-15 11:11:10 -04:00
Nick Mathewson
6d5440e80e Fix handling of group rate limits under 64 bytes of burst
The "min_share" logic, which was designed to prevent piles of
extremely small writes when running up against a group rate limit,
could lead to confusing behavior if you ever set a min_share less
than your burst rate.  If that happened, then as soon as your group
rate limit was exhausted, you'd stop reading/writing, and never
start again, since the amount readable/writeable would never
actually hit min_share.

We now cap min_share at the rate per tick.

Found by George Kadianakis
2011-08-11 15:15:17 -04:00
Sebastian Hahn
5d1b255b14 Ignore deprecation warnings on OS X
Starting with Lion, Apple decided to deprecate the system openssl. We
can start requiring users to install their own openssl once OS X doesn't
ship with it anymore.
2011-08-10 19:13:39 +02:00
Mitchell Livingston
b4423029b9 Allow OS-neutral builds for platforms where some versions have arc4random_buf 2011-08-08 22:03:34 -04:00
Joachim Bauch
4a343943bd Propagate errors on the underlying bufferevent to the user. 2011-08-03 12:08:58 -04:00
Nick Mathewson
1183f7e24e Fix typo in event_compat.h comments. 2011-08-01 10:27:56 -04:00
Nick Mathewson
a2fdf9b04f Bump version to 2.0.13-stable-dev 2011-07-18 23:37:59 -04:00
Nick Mathewson
80414e22a7 Bump version to 2.0.13-dev release-2.0.13-stable 2011-07-18 18:19:25 -04:00
Nick Mathewson
62b8ce5877 acks and changelog for 2.0.13-stable 2011-07-18 17:05:20 -04:00
Nick Mathewson
b3b425eb10 Give Makefile.am echo a non-null argument. msys likes this 2011-07-18 12:45:50 -04:00
Nick Mathewson
00a7a0e478 Fix a warning in evutil_rand when building with threads disabled 2011-07-17 21:48:38 -04:00
Nick Mathewson
4a5c82d617 Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS
Reported by Dagobert Michelsen.
2011-07-15 10:20:01 -04:00
Nick Mathewson
d5bd604a8b Add doxygen to .gitignore 2011-07-05 14:57:08 -04:00
Nick Mathewson
caf695afdb Fix up test_evutil_snprintf 2011-07-05 14:55:09 -04:00
Nick Mathewson
af6a05f723 Merge remote-tracking branch 'github/20_size_fmt' into patches-2.0 2011-07-05 14:51:24 -04:00
Nick Mathewson
341e1b03a8 Merge branch 'doxygen' into patches-2.0 2011-07-05 13:04:30 -04:00
Nick Mathewson
aea0555b76 Update Doxyfile to produce more useful output 2011-07-05 13:01:31 -04:00
Nick Mathewson
2888faccd1 Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy 2011-07-05 13:01:07 -04:00
Nick Mathewson
49d1136205 Fix select.c compilation on systems with no NFDBITS 2011-07-05 00:15:51 -04:00
Nick Mathewson
e7fe92709e Merge remote-tracking branch 'github/20_global_locks_init' into patches-2.0 2011-07-04 12:16:08 -04:00
Mark Ellzey
f87f56894d Speed up invoke_callbacks on evbuffers when there are no callbacks
This fixes a performance regression against 1.4
2011-07-04 11:47:24 -04:00
Joachim Bauch
e050703d47 Fix bug in SSL bufferevents backed by a bev with a write high-watermarks
Original mail:

   the logic that handles write watermarks in "bio_bufferevent_write"
   is not working. It currently doesn't write any data if the high
   watermark is *above* the amount of data to write (i.e. when there
   is actually enough room available).
2011-07-04 11:36:14 -04:00
Nicholas Marriott
8ee9f9c1cf Fix a few warnings on OpenBSD
- redeclaration of dst_size

- arpa/inet.h requires netinet/in.h first

- don't use a local with the same name as a global - it isn't needed so
  remove it
2011-07-02 21:49:07 -04:00
Nick Mathewson
e934096490 Fix AIX build issue with TAILQ_FOREACH definition
Reported by Lawnstein Chan.
2011-06-22 11:22:35 -04:00
Harlan Stenn
e23cda3dae Don't install event_rpcgen.py when --disable-libevent-install is used 2011-06-21 10:05:28 -04:00
Nick Mathewson
79ff78d2e7 Merge branch '20_kqueue_badf' into patches-2.0 2011-06-16 13:19:43 -04:00
Nick Mathewson
b031adf112 Don't break when building tests from git without python installed 2011-06-14 14:52:53 -04:00
Nick Mathewson
812d42e886 Simplify windows commandname logic in tinytest
Instead of using a dup'd pointer, let's use a static array, so we
don't need to free it.  This patch also makes tinytest build on
non-windows again.
2011-06-11 01:39:31 -04:00
Ed Day
57def3460a Fix tinytest invocation from windows shell
Original post:

  This post is in response to a posting last December on a Windows
  regression fork failure ([Libevent-users] Re: Libevent 2.0.10-stable
  is released by Dongsheng Song).  I noticed the question was not
  answered and I recently experienced the same error myself when
  trying to run the Windows regression tests myself.

  I checked the return status from the CreateProcess call and found it
  was "file not found".  This led me to look at the command-line I was
  using which was .\regress in a Visual Studio 2008 command prompt
  window.  Windows could not find the file because it did not have the
  .exe extension on the end.  The code that builds the command should
  be modified to ensure the extension is present.
2011-06-11 01:31:59 -04:00
Nick Mathewson
3203f88c5f Use the correct printf args when formatting size_t
Based on a patch from Mansour Moufid
2011-06-08 17:37:45 -04:00
Mansour Moufid
446cc7a0a1 Check if the evhttp_new_object' function in http.c' returns NULL. 2011-06-08 16:46:21 -04:00
Nick Mathewson
1fd34ab424 Report kqueue ebadf, epipe, and eperm as EV_READ events
When asked to add one side of a pipe, and the other side has been
closed, kqueue on NetBSD will say EBADF; kqueue on FreeBSD will say
EPIPE, and kqueue on OpenBSD will say EPERM.  So treat all of these
as EV_READ events, to give the user an opportunity to notice that
the pipe is closed.

Diagnosed by Nicholas Marriott and Dale Rahn; based on a patch by
Nicholas Marriott.
2011-06-08 15:34:52 -04:00
Nick Mathewson
09fe97da3b Replace an assertion for event_base_free(NULL) with a check-and-warn
event_base_free(NULL) means "free the current event base".
Previously, it would assert if there was no 'current' base.  Now it
just warns and returns.

Reported by Gilad Benjamini
2011-06-08 14:24:45 -04:00
Nick Mathewson
89d5e09e4d Add some missing checks for mm_calloc failures
Found by Gilad Benjamini
2011-06-08 14:23:37 -04:00