|
026ac5d5
|
2010-11-26T13:29:56
|
|
add http-server to gitignore
|
|
4881778c
|
2010-11-26T13:28:48
|
|
Fix a misplaced ) in http_server.c
|
|
d40aa673
|
2010-11-26T12:59:02
|
|
Merge branch '20_empty_body'
|
|
4e794d5d
|
2010-10-18T13:44:05
|
|
Add a basic example of how to write a static HTTP server.
|
|
2e5a175b
|
2010-11-25T23:03:46
|
|
Merge remote branch 'github/20_once_fixes'
|
|
32390732
|
2010-11-23T19:40:23
|
|
Fix snprintf related failures on IRIX.
|
|
1cd45e56
|
2010-11-23T19:26:34
|
|
If not WIN32, include <sys/socket.h> in event2/util.h.
|
|
c2e5e22c
|
2010-11-23T14:09:03
|
|
xlC doesn't obey C99 comments here. autoconf isn't invoking full C99
mode.
|
|
c4dc3353
|
2010-11-23T00:22:01
|
|
Add some checks since lack of TAILQ_FOREACH doesn't imply lack of FIRST,
END, NEXT, or INSERT_BEFORE. Quiet some warnings in XL C.
|
|
2e2a3d7b
|
2010-11-23T19:09:08
|
|
Reworked AIX __ss_family workaround to use AC_STRUCT_MEMBER.
|
|
a3a9f6b2
|
2010-11-22T20:44:10
|
|
select comes from <sys/select.h> according to POSIX.1-2001, or from a
variety of other standard headers on older systems, but not <select.h>.
AIX build fix.
|
|
ec5c5aec
|
2010-11-23T20:31:28
|
|
Handle evhttp PUT/POST requests with an empty body
When we call evhttp_get_bodylen() [when transfer-encoding isn't set],
having req->ntoread == -1 means that we have no content-length. But a
request with no content-length has no body! We were treating the
absent content-length as meaning "read till closed", which only holds
for replies, not requests.
This patch also allows PATCH requests to have a body.
|
|
652024b6
|
2010-11-23T13:08:07
|
|
Remove _event_initialized(); make event_initialized() a function(); make it consistent on windows and non-windows
|
|
88be27dc
|
2010-11-23T12:26:46
|
|
Document event_get_assignment
|
|
e431bcd6
|
2010-11-23T12:26:34
|
|
Note that reentrant calls to libevent from logging cbs may fail badly
|
|
7bcace2d
|
2010-11-22T21:02:34
|
|
Fix some irix compilation warnings spotted by Kevin Bowling
|
|
150d7d0a
|
2010-11-22T20:24:03
|
|
Merge remote branch 'kev009/master'
|
|
e8749823
|
2010-11-22T16:40:31
|
|
Fix IRIX build. sa_family collides with a #define in sys/socket.h on IRIX.
|
|
26049c2f
|
2010-11-22T16:24:52
|
|
Merge remote branch 'github/20_getaddrinfo_cancel_v2'
|
|
da1bf528
|
2010-11-22T16:24:09
|
|
Add a stress test for getaddrinfo_cancel
|
|
568ac4fd
|
2010-11-22T15:52:34
|
|
Merge remote branches 'github/20_epoll_nochangelist_v4', 'github/20_openssl_closeonfree' and 'github/20_cloexec'
|
|
ece974fb
|
2010-11-22T14:13:24
|
|
Reorder backends in test.sh to match preference order in event.c
|
|
aed7e029
|
2010-11-22T14:10:01
|
|
Make unit tests for epoll-with-changelist pass
The only changes needed were to handle the fact that the methodname
"epoll (with changelist)" matches the environment variable
EVENT_NOEPOLL rather than the imaginary "EVENT_EPOLL (WITH CHANGELIST)".
|
|
9531763a
|
2010-11-14T17:52:16
|
|
Disable changelist for epoll by default because of Linux dup() bug; add an option and/or an envvar to reenable it for speed.
Rename option to control epoll changelist; make epoll changelist off by default
|
|
3ab578f8
|
2010-11-20T01:41:34
|
|
Make sure the CLOEXEC flag is set on fds we open for base notification
|
|
3a67d0bf
|
2010-11-19T17:09:30
|
|
Resolve an evport bug in the thread/forking test
|
|
d51b2fc6
|
2010-11-19T12:14:18
|
|
Make evdns_getaddrinfo_cancel threadsafe
|
|
c7cfbcf4
|
2010-11-19T12:01:05
|
|
Fix some more cancel-related bugs in getaddrinfo_async
Also imposed a new rule to make this much much simpler: no freeing
the getaddrinfo request until both dns callbacks have been invoked.
|
|
abf01ed1
|
2010-11-19T11:33:48
|
|
Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL
|
|
49418612
|
2010-11-16T12:55:10
|
|
Use the US-English "canceled", not the UK "cancelled".
|
|
8faf223a
|
2010-11-17T00:09:10
|
|
Fix a memory leak in evhttp_uri_free.
|
|
4f228a1f
|
2010-11-14T19:52:18
|
|
Fix bug in bufferevent_connect on an openssl bufferevent that already had an fd
The problem was that we were using openssl's BIO code's shutdown flag
whenever BEV_OPT_CLOSE_ON_FREE was set. This made the BIO close the
socket when it was freed... but it would be freed whenever we did a
setfd on the bufferevent_openssl, even the no-op setfd in
bufferevent_connect.
So instead, we just set the shutdown flag to 0, and handle closing the
fd ourselves.
Spotted by Linus Nordberg
|
|
057a5146
|
2010-11-14T19:34:49
|
|
Clarify EVLOOP_* documentation to be more precise.
|
|
2d5e1bd0
|
2010-11-14T19:32:13
|
|
Do not let EVLOOP_ONCE exit the loop until all deferred callbacks have run
|
|
0617a818
|
2010-11-14T19:25:54
|
|
Make EVLOOP_ONCE ignore internal events
Merely getting an internal notification event from having an event
added or deleted from another thread should not cause
event_base_loop(base, EVLOOP_ONCE) to exit; previously, it did.
|
|
1ac5b230
|
2010-11-09T15:18:59
|
|
Only clear underlying callbacks when the user hasn't reset them.
|
|
fc7b1b00
|
2010-11-09T11:43:47
|
|
When closing a filtering bufferevent, clear callbacks on the underlying bufferevent
Previously, if BEV_OPT_CLOSE_ON_FREE wasn't set on a
bufferevent_filter or a filtering bufferevent_openssl, when we went
to free the filtering bufferevent, we'd leave the underlying
bufferevent unchanged. That's not so good, since the callbacks are
set to activate stuff in the filtering bufferevent that we're about
to free. Instead, set all the callbacks to NULL.
|
|
5c8a59e8
|
2010-11-09T10:19:05
|
|
Merge remote branches 'github/20_evdns_cancel_segfault_v2', 'github/20_http_close_detect', 'github/20_http_versions', 'github/20_more_http_methods', 'github/20_shutdown_iocp_listener' and 'github/20_win64_fixes'
|
|
a38140be
|
2010-11-09T10:14:32
|
|
Refactor http version parsing into a single function
Based on a suggestion by Chris Davis to make
evhttp_parse_response_line tolerate odd versions too.
|
|
3db6bc00
|
2010-11-09T10:03:00
|
|
Remove some debugging puts() calls from allow_methods test
|
|
52aa419b
|
2010-11-04T15:40:44
|
|
Set SO_UPDATE_ACCEPT_CONTEXT on sockets from AcceptEx so that shutdown() can work
Based on patch (and lots of debugging work) by Kelly Brock.
|
|
229714d1
|
2010-11-04T16:04:28
|
|
Fix a mistake in http documentation found by Julien Blache
|
|
05124879
|
2010-11-04T14:05:08
|
|
Never call evhttp_readcb while writing.
|
|
c76640b5
|
2010-06-01T04:45:55
|
|
Don't disable reading from the HTTP connection after sending the request to be notified of connection-close in time
|
|
75e3320e
|
2010-11-04T12:41:13
|
|
Units test for unexpected evhttp methods.
|
|
536311a4
|
2010-11-04T12:39:41
|
|
evhttp: Return 501 when we get an unrecognized method, not 400.
|
|
f5b391e2
|
2010-11-04T11:53:34
|
|
Tweak interface for allowed methods
|
|
75a73414
|
2010-11-04T11:25:35
|
|
Define enumerators for all HTTP methods, including PATCH from RFC5789
This patch defines enumerators for all HTTP methods that exist
(including PATCH introduced in RFC 5789).
It also makes them bit-masky (that's not a word, is it?), breaking
binary- but not source-code compatibility.
evhttp now stores a bitmask specifying for which methods requests to
dispatch and which ones to reject with "405 Method Not Allowed".
By default that's the ones we currently have (GET, POST, HEAD, PUT,
DELETE), thereby keeping functional compatibility (besides the minor
change that one of the other methods will now cause 405 instead of
400. But I believe that could even be considered a bug-fix).
evhttp is extended by evhttp_set_allowed_methods() with which the
user can change that bitmask.
no regressions here and my test-app still works. Haven't yet
actually tested any of the new methods.
What's obviously missing here is the special logic for the methods:
OPTIONS: We should be fine here - I believe our current dispatch
logic should work fine. Some convenience functions would be fine
though.
TRACE: I'm pretty certain we should never dispatch this to the
callbacks and simply implement the necessary functionality built-in.
CONNECT: Pretty straight-forward to implement (and considering the
framework in which we implement it very efficient too). Should
probably go built-in.
PATCH: Except for checking the RFC against our pre-dispatch logic
(there just might be some "MUST not have Some-Header" lurking
somewhere) there is nothing to be done here, this is completely up
to the user. Nothing to do.
|
|
9ed30de7
|
2010-11-03T12:37:37
|
|
Don't free evdns_request handles until after the callback is invoked
Previously, once the callback was scheduled, it was unsafe to cancel
a request, but there was no way to tell that. Now it is safe to
cancel a request until the callback is invoked, at which point it
isn't.
Found and diagnosed by Denis Bilenko.
|
|
34b84b97
|
2010-11-03T14:38:45
|
|
Fix more wn64 warnings.
|
|
78762383
|
2010-11-03T15:18:34
|
|
Merge branch 'http_nolegacy_v2'
|
|
985430ae
|
2010-11-03T15:17:57
|
|
Remove need for http_compat.h in http tests
|
|
0b137f45
|
2010-11-03T15:14:29
|
|
Stop accessing http request struct directly from in the unit tests.
|
|
22e0a9b2
|
2010-11-03T15:12:08
|
|
Add evhttp_response_code to remove one more reason to include http_struct.h
|
|
c91622d1
|
2010-11-03T15:04:44
|
|
Stop using event_compat.h in regress_http
|
|
9bb82393
|
2010-11-03T14:31:23
|
|
Convert the rest of the http tests to be non-legacy unit tests.
|
|
353402a8
|
2010-11-03T14:13:20
|
|
Rename the confusing "base" static variable in regress_http.c
|
|
8505a744
|
2010-11-03T13:55:20
|
|
Start porting http tests to not use legacy interfaces
|
|
647e094c
|
2010-11-02T15:19:12
|
|
Replace exact-version checks for HTTP/1.1 with >= or < checks
|
|
aa5f55fa
|
2010-11-02T13:50:57
|
|
reset "chunked" flag when sending non-chunked reply
|
|
ba014569
|
2010-11-02T12:42:35
|
|
Use the label_len local variable in evdns instead of recalculating it over and over
|
|
a3245afe
|
2010-11-01T14:23:33
|
|
Fix win32 build in response to fixes from win64 build.
|
|
74a91e5a
|
2010-11-01T14:16:39
|
|
fix signed/unsigned warnings in http.c
|
|
f8095d64
|
2010-11-01T14:15:34
|
|
Fix a typo in 7484df61c981fc33db2~
|
|
545a6114
|
2010-11-01T13:59:04
|
|
Fix even more win64 warnings: buffer, event_tagging, http, evdns, evrpc
|
|
7484df61
|
2010-11-01T13:43:43
|
|
Fix even more win64 warnings
|
|
b6a158ca
|
2010-11-01T11:48:57
|
|
Rename "size" variables in win32select that were really fd counts.
|
|
f8064762
|
2010-10-28T10:11:25
|
|
Increase the skew tolerance to 2 seconds in thread/deferred_cb_skew
This is to make the test not fail on Sebastian Hahn's Win7 box.
|
|
7b40a000
|
2010-10-28T10:08:17
|
|
Make sure IOCP evconnlistener uses virtual events.
|
|
598d1336
|
2010-10-27T22:57:53
|
|
Try to clear up more size_t vs int/long issues.
|
|
b81217f7
|
2010-10-27T17:37:32
|
|
Fix signal handler types for win64.
|
|
1ae82cd8
|
2010-10-27T17:32:41
|
|
Set _EVENT_SIZEOF_VOID_P correctly on win32 and win64
|
|
f817bfa4
|
2010-10-27T17:31:52
|
|
Fix some ints to evutil_socket_t; make tests pass on win64.
|
|
19c71e74
|
2010-10-27T10:36:08
|
|
Fix som event_warns that should have been event_warnx
|
|
e8a903ce
|
2010-10-27T10:27:04
|
|
Merge remote branch 'trondn/master'
|
|
f5ad31c1
|
2010-10-27T12:47:07
|
|
Check return value for ioctlsocket on win32
|
|
5d389dc0
|
2010-10-26T22:27:57
|
|
Fix some uses of int for socket in regress
|
|
84a7053e
|
2010-10-26T21:33:22
|
|
Merge remote branch 'github/20_http_read_after_write'
|
|
73bf07fe
|
2010-10-26T21:33:13
|
|
Merge remote branch 'github/20_abi_breaks'
|
|
093fb989
|
2010-10-26T21:33:05
|
|
Merge remote branch 'github/20_ratelim_size'
|
|
4f20eeaa
|
2010-10-26T21:32:53
|
|
Merge remote branch 'github/20_chain_realign'
|
|
fbaf0770
|
2010-10-26T12:09:20
|
|
Fix bugs in posix thread-id calculation when sizeof(pthread_t) != sizeof(long)
When pthread_t was smaller, our calculated thread IDs would include
uninitialized RAM, and so our unit tests would fail because thread_ids
would never match one another.
When pthread_t was larger and alignment was big-endian, our calculated
thread IDs would only have the most significant bytes of the
pthread_t, when in practice all the entropy is in the low-order bytes.
Found with help from Dagobert Michelsen.
|
|
ac1931ac
|
2010-10-26T11:07:26
|
|
Remove event-config.h from .gitignore; it moved to include/event2
|
|
e56ff65a
|
2010-10-26T11:01:58
|
|
Fix a minor syntax error that most compilers didn't care about
|
|
a4063c06
|
2010-10-26T10:38:30
|
|
Note that 2.0.9 will break the ABI, and make changes we were postponing.
We had to turn a couple of 32-bit size arguments into 64-bit arguments
or size_t arguments (since otherwise we would have had to do it post
2.0.x-stable, and that would be worse).
|
|
2cbb1a16
|
2010-10-26T10:27:29
|
|
Make rate-limits go up to SIZE_MAX/EV_SSIZE_MAX, not just INT32_MAX
Someday, when networks are far faster and people frequently want a
burst value greater than 2GB per tick, this will seem very forsightful
indeed.
For now, it breaks ABI, but not source. Fixes bug 3092096.
|
|
e4f34e8a
|
2010-10-25T22:36:23
|
|
Correct logic for realigning a chain in evbuffer_add
The old logic was both too eager to realign (it would move a whole
chain to save a byte) and too reluctant to realign (it would only
realign when data would fit into the misaligned portion, without
considering the space at the end of the chain).
The new logic matches that from evbuffer_expand_singlechain: it only
realigns a chain when not much data is to be moved, and there's a
bunch of space to be regained.
Spotted by Yan Lin.
|
|
74c0e862
|
2010-10-25T21:53:15
|
|
Avoid missed-request bug when entire http request arrives before data is flushed
The trigger for starting to read the first line of a request used to
be, "When data has arrived and we're looking for the first line."
But that's not good enough: if the entire next request gets read
into our bufev->inbuf while we're still processing the current
request, we'll never see any more data arrive, and so will never
process it.
So the fix is to make sure that whenever we hit evhttp_send_done, we
call evhttp_read_cb. We can't call it directly, though, since
evhttp_send_done is reachable from the user API, and evhttp_read_cb
can invoke user functions, and we don't want to force everyone to
have reentrant callbacks. So, we use a deferred_cb.
Found by Ivan Andropov. This is bug 3008344.
|
|
8e342e56
|
2010-10-25T16:09:11
|
|
Correctly count req->body_size on http usage without Content-Length
There was a dumb bug where we would look at the length of the input
buffer immediately _after_ we drained it.
|
|
58a1cc6b
|
2010-10-25T16:00:47
|
|
Fix a bug where we would read too much data in HTTP bodies or requests.
We were using evbuffer_add_buffer, which moved the entire buffer
contents. But if we had a valid content_length, we only wanted to
move up to the amount of data remaining in ntoread. Our bug would
make us put our ntoread in the negative, which would in turn make us
read all data until the connection closed.
Found by Denis Bilenko. Should fix bug 2963172.
|
|
525da3e1
|
2010-10-25T15:49:42
|
|
Fix Content-Length when trying send more than 100GB of data (!) on an evhttp.
|
|
f1250eb6
|
2010-10-25T15:23:41
|
|
add a requested docstring for event_rpcgen.CommandLine.__init__
|
|
9c71a341
|
2010-10-25T15:13:32
|
|
Merge remote branch 'github/http_and_listener'
|
|
ac7e52d8
|
2010-10-25T14:29:30
|
|
Make evbuffer_add_file take ev_off_t, not off_t
This change has no effect on non-windows platforms, since those
either define off_t to 64-bits, or allow you to decide whether
it should be 64-bits yourself via some LARGEFILE-like macro.
On Windows, however, off_t is always 32-bit, so it's a bad choice
for "file size" or "file offset" values. Instead, I'm adding
an ev_off_t type, and using it in the one place where we used
off_t to mean "the size of a file" or "an offset into a file" in the
API.
This breaks ABI compatibility on Windows.
|
|
006efa7d
|
2010-10-25T11:50:51
|
|
Functions to actually use evhttp_bound_socket with/as evconnlistener.
|
|
46ee061c
|
2010-10-25T11:47:05
|
|
Add a function to change a listener's callback.
You can also now initialize listeners with no callbacks set; if so,
they won't get enabled until the callback is set to non-NULL.
|
|
2c66983a
|
2010-10-24T11:51:14
|
|
Simplify the logic for choosing EPOLL_CTL_ADD vs EPOLL_CTL_MOD
Previously, we chose "ADD" whenever old_events==new_events, (since
we expected the add to fail with EEXIST), or whenever old_events
was==0, and MOD otherwise (i.e., when old_events was nonzero and not
equal to new_events).
But now that we retry failed MOD events as ADD *and* failed ADD
events as MOD, the important thing is now to try to guess right the
largest amount of the time, since guessing right means we do only
one syscall, but guessing wrong means we do two.
When old_events is 0, ADD is probably right (unless we're hitting
the dup bug, when we'll fall back).
And when old_events is set and != new_events, MOD is almost
certainly right for the same reasons as before.
But when old_events is equal to new events, then MOD will work fine
unless we closed and reopened the fd, in which case we'll have to
fall back to the ADD case. (Redundant del/add pairs are more common
than closes for most use cases.)
This change lets us avoid calculating new_events, which ought to
save a little time in epoll.c
|
|
c281aba3
|
2010-10-24T11:38:29
|
|
Fix a nasty bug related to use of dup() with epoll on Linux
Current versions of the Linux kernel don't seem to remove the struct
epitem for a given (file,fd) combo when the fd is closed unless the
file itself is also completely closed. This means that if you do:
fd = dup(fd_orig);
add(fd);
close(fd);
dup2(fd_orig, fd);
add(fd);
you will get an EEXIST when you should have gotten a success. This
could cause warnings and dropped events when using dup and epoll.
The solution is pretty simple: when we get an EEXIST from
EPOLL_CTL_ADD, we retry with EPOLL_CTL_MOD.
Unit test included to demonstrate the bug.
Found due to the patient efforts of Gilad Benjamini; diagnosed with
help from Nicholas Marriott.
|
|
bf11e7dd
|
2010-10-21T15:33:13
|
|
Merge branch 'http_uri_parse'
|
|
bc98f5e6
|
2010-10-21T14:53:21
|
|
Unit tests for evhttp_uri_set*
|