Log

Author Commit Date CI Message
Azat Khuzhin e8a2da96 2015-09-02T14:19:16 be_openssl: don't call set_open_callbacks() if fd == -1 This must be illegal, firstly we must do set_do handshake and only after this we could read/write.
Azat Khuzhin 2a8a7112 2015-09-02T12:42:29 be_openssl: introduce be_openssl_auto_fd() helper
Azat Khuzhin 510da71f 2015-09-02T12:40:26 be_openssl: introduce set_open_callbacks_auto() This will split cases when we need to extract fd (cases when we have fd==-1 passed to set_open_callbacks()), and cases when we mustn't have to do this -- SET_FD via be_openssl_ctrl().
Azat Khuzhin 40b03798 2015-08-22T21:38:18 be_openssl: get rid off hackish "fd_is_set", to fix some corner cases This patch is a cleanup and a bug fix, it drops ```fd_is_set``` flag, and replace it with some checks to event_initialized(), and now we will not call event_assign() on already added event, plus we will delete event when we really have to (this patch fixes the case when server is down, IOW before this patch we will not call event_del() because ```fd_is_set``` was reset to 0) and this will fix some issues with retries in http layer for ssl. Reported-in: #258 Fixes: regress ssl/bufferevent_socketpair_timeout Fixes: regress ssl/bufferevent_socketpair_timeout_freed_fd
Azat Khuzhin af85ecfc 2015-09-02T19:18:08 Merge branch 'test-regress-be-openssl-v2' This patchset is a bunch of regression tests for bufferevent openssl layer, some of them already show some bugs, that bugs will be fixed in the next patches. * test-regress-be-openssl-v2: test/regress_ssl: check events fd/pending after timeout triggered test/regress_ssl: cover case when server didn't up (failed with timeout) test/regress_ssl: covert that we can't change fd with underlying test/regress_ssl: cover that events (read/write) at finish not pending test/regress_ssl: cover fd manipulations test/regress_ssl: convert open_ssl_bufevs() to mask test/regress_ssl: convert client/server to mask too test/regress_ssl: cover "allow_dirty_shutdown" test/regress_ssl: convert regress_bufferevent_openssl() to bitmask
Azat Khuzhin cdafdf01 2015-09-02T17:49:41 test/regress_ssl: check events fd/pending after timeout triggered In this case client can't connect to server, and this bring to the front some bugs with assigning on already added events (because of ```fd_is_set``` stuff), for more info see #258, since this is the reproducible for it.
Azat Khuzhin 74845f11 2015-09-02T17:36:20 test/regress_ssl: cover case when server didn't up (failed with timeout)
Azat Khuzhin df507afa 2015-09-02T17:17:43 test/regress_ssl: covert that we can't change fd with underlying
Azat Khuzhin 762edb46 2015-09-02T17:06:51 test/regress_ssl: cover that events (read/write) at finish not pending
Azat Khuzhin b78a8297 2015-09-02T12:35:51 test/regress_ssl: cover fd manipulations
Azat Khuzhin 46bba731 2015-09-02T12:31:15 test/regress_ssl: convert open_ssl_bufevs() to mask
Azat Khuzhin 34559913 2015-09-02T12:26:40 test/regress_ssl: convert client/server to mask too
Azat Khuzhin 04303273 2015-09-02T11:34:13 test/regress_ssl: cover "allow_dirty_shutdown"
Azat Khuzhin 342e116f 2015-09-02T11:22:43 test/regress_ssl: convert regress_bufferevent_openssl() to bitmask
Ed Schouten ce1776c9 2015-08-25T15:29:37 Test against SO_REUSEADDR (along with _WIN32). This makes the code build on other systems that also don't have SO_REUSEADDR without requiring special code. [ azat: partially revert WIN32 check since SO_REUSEADDR on win32 differs from unix semantics. ] Closes #275
Azat Khuzhin 25e56fdb 2015-08-25T17:01:42 tests/regress_ssl: drop duplicated assert
Christopher Wiley 2828bdb9 2015-07-24T08:42:06 Always define missing TAILQ functions from sys/queue.h On both Android and Ubuntu machines, TAILQ_END is not defined. This header also does not seem to be part of standard BSD sys/queue.h Fix this by always defining missing TAILQ_ macros rather than conditioning on a particular macro. Fixes #267
Ed Schouten fd36647a 2015-08-25T15:24:39 Don't use BSD u_* types. These types are not part of POSIX. As we only use them in a small number of places, we'd better replace them by C standard types. This makes a larger part of the code build for CloudABI.
Ed Schouten 193c7de5 2015-08-25T15:32:25 Remove BSD-ism: TIMEVAL_TO_TIMESPEC(). Systems like CloudABI implement kqueue() but do not provide the BSD-specific TIMEVAL_TO_TIMESPEC() macro. Change the code to perform this manually, as it is not hard to do this conversion.
Azat Khuzhin c2122919 2015-08-19T23:27:51 be: include all variations of headers for sockaddr_in6 struct Fixes: c42bc6b279fd7cd4bc9b04c86a12e2ec5512cce1 ("be: fix sockaddr_in6 type definition for win32") Fixes: e04555155816306f23829a15b747664a57330c28 ("Merge branch 'reuse-conn_address-on-retry-v11'") CI: https://ci.appveyor.com/project/nmathewson/libevent/build/2.1.5.109 Tested: manually
Azat Khuzhin dfad1a46 2015-08-19T23:00:49 http: eliminate warning about "socklen" in evhttp_connection_connect_()
Azat Khuzhin c42bc6b2 2015-08-19T22:52:22 be: fix sockaddr_in6 type definition for win32 bufferevent-internal.h:217:23: error: field 'in6' has incomplete type struct sockaddr_in6 in6; ^ CI: https://ci.appveyor.com/project/nmathewson/libevent/build/2.1.5.108
Azat Khuzhin f3d7ff5d 2015-08-19T13:22:49 sample/https-client: don't try to free uninitialized SSL sample/https-client.c:459:3: warning: ‘ssl’ may be used uninitialized in this function [-Wmaybe-uninitialized] SSL_free(ssl);
Azat Khuzhin 24a1f25a 2015-08-19T13:19:41 sample/https-client: graceful exit with freeing memory (to make valgrind happy)
Andrey Skriabin 29a04825 2015-04-02T20:42:54 https-client: correctly handle URLs with no path (like "https://host:port") path == NULL check removed Fixes: #233 Fixes: #234
Azat Khuzhin 6dc71e70 2015-08-18T21:57:28 sample/http-connect: don't use assert() to make it work with NDEBUG Otherwise it will not work for cmake release target type.
Azat Khuzhin 9f0bff3f 2015-08-18T21:30:48 test/regress_http: initialize "dns_base" to avoid reading trash Even though it is very unlikely, but it will better to fix this.
Azat Khuzhin f976d436 2015-08-18T21:29:03 sample/http-connect: made it compatible with C90
Azat Khuzhin e0455515 2015-08-18T21:19:11 Merge branch 'reuse-conn_address-on-retry-v11' There is regression tests and also this code worked/tested during crawling a huge number of pages (billions). * reuse-conn_address-on-retry-v11: be_sock: bufferevent_socket_set_conn_address(): assert instead of silent no-op http: reuse connected address only with EVHTTP_CON_REUSE_CONNECTED_ADDR be_sock: sanity check in bufferevent_socket_set_conn_address() be: replace sockaddr_storage with sockaddr_in6 for conn_address be: we don't need to use getpeername() we we have conn_address be: replace conn_address by full struct instead of pointer test/http: cover retrying with saved conn_address by shutting down dns server http: use IP address that we got before (if any) during retrying bufferevent: move conn_address out from http into bufferevent be: make @sa const for bufferevent_socket_connect() util: make @sa const for evutil_socket_connect_()
Azat Khuzhin 0ab88c2a 2015-08-18T20:41:16 be_sock: bufferevent_socket_set_conn_address(): assert instead of silent no-op
Azat Khuzhin eedbeff3 2014-12-02T14:31:03 be_sock: sanity check in bufferevent_socket_set_conn_address()
Azat Khuzhin 38896124 2014-12-02T14:24:19 be: replace sockaddr_storage with sockaddr_in6 for conn_address We need only ipv6/ipv4 for connect in bufferevent, and since sockaddr_storage is pretty big (128 bytes) it will be better to use sockaddr_in6 here (it will fit ipv4 too).
Azat Khuzhin 2c271e24 2014-11-16T00:30:11 be: we don't need to use getpeername() we we have conn_address Since getpeername() could fail.
Azat Khuzhin e5615aa7 2014-11-16T00:29:19 be: replace conn_address by full struct instead of pointer
Azat Khuzhin a50f5f0a 2015-01-01T06:27:31 http: reuse connected address only with EVHTTP_CON_REUSE_CONNECTED_ADDR
Azat Khuzhin f4874d8c 2014-11-15T20:35:40 test/http: cover retrying with saved conn_address by shutting down dns server
Azat Khuzhin 54c887d8 2014-11-12T20:23:46 http: use IP address that we got before (if any) during retrying Before this patch every time we are retrying our request we resolve domain, but we could optimize this (since UDP is slow) by using cached conn_address value, so do this.
Azat Khuzhin 8bb38425 2014-11-15T21:46:11 bufferevent: move conn_address out from http into bufferevent In http the only case when when we could store it is when we already connected, *but* if we are doing request using domain name, then we need to do request to nameserver to get IP address, and this is handled by bufferevent. So when we have IP address (from nameserver) and don't have connection to this IP address, we could already cache it to avoid extra DNS requests (since UDP is slow), and we can't do this from http layer, only from bufferevent.
Azat Khuzhin dc33c783 2014-12-02T15:05:59 be: make @sa const for bufferevent_socket_connect()
Azat Khuzhin a8d32c23 2014-12-02T15:05:36 util: make @sa const for evutil_socket_connect_()
Azat Khuzhin 1d34498e 2015-08-18T12:18:31 sample: add HTTP CONNECT tunnelling example using libevent http layer
Azat Khuzhin 22061ac1 2015-08-18T03:03:51 http: introduce evhttp_request_free_() helper
Azat Khuzhin 6540da38 2015-04-24T19:04:51 http: introduce evhttp_is_request_connection_close() helper
Mark Ellzey 1dbb55da 2015-06-21T22:05:21 Updated gitignore
Mark Ellzey bdeec440 2015-06-17T08:24:52 Merge pull request #190 from JohnOhl/evhttp-post-fix evhttp: Fix failure to send all output data for POST/PUT requests
Mark Ellzey 620ff243 2015-06-17T08:05:53 Update dns-example. There's somebody out there who is going to have a compiler from 1986 who will complain. Better to fix c99 now.
Mark Ellzey bde231d7 2015-06-17T08:00:19 Merge pull request #183 from azat/dns-example Some improvements for dns-example
Mark Ellzey 109b03f4 2015-06-07T09:39:24 Merge pull request #254 from zeliard/master Fix bench_httpclient to support win32
Seungmo Koo cb969312 2015-06-07T15:51:15 Update bench_httpclient.c *fixed: socket_geterror instead of WSAGetLastError
Mark Ellzey 57d059be 2015-06-06T02:39:29 Merge pull request #253 from ellzey/master Set correct socklen for PF_INET6 sockaddr len
zeliard 4e9325e8 2015-06-05T16:39:26 *fix: bench_httpclient to support win32
Mark Ellzey 3499ad97 2015-06-01T06:55:24 Set correct socklen for PF_INET6 sockaddr len Reported and patched by Pankaj Sharma
Mark Ellzey c6fffc75 2015-05-29T06:47:24 Merge pull request #251 from ellzey/21_err_on_thread_init_ordering Debug mode option to error on evthread init AFTER other event calls.
Mark Ellzey dcfb19a2 2015-05-15T02:58:14 Debug mode option to error on evthread init AFTER other event calls. - A handy event_enable_debug_mode() feature which will error and abort the application if any thread-aware libevent functions are called BEFORE the evthread API has been initialized (manually, or through evthread_use_windows_threads() / evthread_use_pthreads() - This is done by setting the global debug variable 'event_debug_created_threadable_ctx_' whenever the following functions are called: evthreadimpl_lock_alloc_() evthreadimpl_cond_alloc_() event_base_new_with_config() <- this checks to see if the thread callbacks are enabled first, so we have to manually set the variable. - Example: int main(int argc, char ** argv) { struct event_base * base; event_enable_debug_mode(); base = event_base_new(); evthread_use_pthreads(); return 0; } When executed, the program will throw an error and exit: [err] evthread initialization must be called BEFORE anything else!
Mark Ellzey 6c8cb5ef 2015-05-13T01:11:08 Merge pull request #245 from ellzey/21_size_and_misc_fixes Fix garbage value in socketpair util function, stdint?
Mark Ellzey d76b2311 2015-05-13T01:10:42 Merge pull request #239 from ellzey/issue237 Call underlying bev ctrl SET_FD on filtered bufferevents
Mark Ellzey 80faee9f 2015-05-13T00:52:40 Update README.md
Mark Ellzey ad4a897a 2015-05-13T00:51:07 Update README.md
Mark Ellzey a2b2e1e6 2015-05-13T00:49:08 Update README.md
Mark Ellzey 37453aba 2015-05-12T15:43:03 Update travis config for status updates
Mark Ellzey 0dfa5dc6 2015-05-12T15:33:26 Update README.md
Mark Ellzey 1cc2e295 2015-05-12T00:27:01 Use autotools for appveyor until cmake is fixed.
Mark Ellzey e84e269b 2015-05-11T22:53:05 Commented out a WIN32 threading / timing test for now - seems as if windows has some time scale issues which I am looking into. For now I am commenting out the regression test until it is fixed.
Mark Ellzey c4d440bf 2015-05-11T22:18:54 Merge branch 'master' into 21_size_and_misc_fixes
Mark Ellzey 37bb3f9f 2015-05-11T16:27:15 Merge pull request #241 from ellzey/21_fix_appveyor_ssl_link Fix download link for appveyor SSL
Mark Ellzey 107d565d 2015-05-11T12:47:40 Fix the link for appveyor OpenSSL installer (WIN32) * change and move the openssl self installer off to a site we own - the old link was 404, probably due to being replaced with a newer non-vuln version. But since we are only using this installer to auto-build with on appveyor (not as a release), then having a file we don't change and own seems to be a better solution. * reduce verbosity
Mark Ellzey d9f6140b 2015-05-11T12:34:30 Merge branch 'master' into issue237
Mark Ellzey 043ae748 2015-05-11T12:06:01 Fix garbage value in socketpair util function, stdint? * Fixed an issue with evutil_ersatz_socketpair_, listen_addr could all be compared against with agarbage values. So just memset it before using it anywhere. * Nick might punch me in the face, but if we have stdint.h; (as in EVENT__HAVE_STDINT_H is defined), might as well use those instead of the manual [U]INT[X}_MAX/MIN muck in there now.
Mark Ellzey f1b3a1e0 2015-05-09T02:44:13 Merge pull request #242 from ellzey/pullRequest118 expose bufferevent_incref/decref (with fewer modifications)
Mark Ellzey 1ed6718d 2015-05-06T14:56:31 expose bufferevent_incref/decref (with fewer modifications)
Mark Ellzey c2aa7dcb 2015-05-05T10:37:00 Call underlying bev ctrl SET_FD on filtered bufferevents If a bufferevent_filter is set on an underlying bufferevent which has ctrl functions, bufferevent_filter needs to handle this. For now I have added just BEV_CTRL_SET_FD, since this is needed for bufferevent_sock to assign file descriptors to the proper bufferevent_read/write callbacks. A good example of the problem can be found in issue #237 https://github.com/libevent/libevent/issues/237
Mark Ellzey a695a720 2015-04-27T22:43:04 Fix potential fd leak in listener_read_cb() As pointed out by harlan_ in #libevent after running a coverity sweep. If the listener is free'd, 'new_fd' is never closed.
Greg Hazel 6e7a580c 2015-03-24T17:45:52 tab
Greg Hazel 38cef641 2015-03-24T17:29:40 fix the return value of event_deferred_cb_schedule_
Nick Mathewson 31c6d45f 2015-02-17T12:37:30 Merge pull request #220 from miniupnp/fix_warnings Fix warnings
Thomas Bernard 0c7f2178 2015-02-16T23:42:54 Fix mixed declarations and code (forbidden by ISO C90)
Thomas Bernard 746d2c50 2015-02-16T23:41:53 Fix "function declaration isn’t a prototype" add "void" to argument list
Nick Mathewson d59113a4 2015-02-05T15:24:55 Merge pull request #214 from JoakimSoderberg/appveyor Forgot to install OpenSSL for appveyor
Joakim Söderberg 26164a56 2015-02-05T20:21:04 Forgot to install OpenSSL for appveyor
Nick Mathewson 874ea871 2015-02-05T13:37:24 Merge pull request #117 from JoakimSoderberg/appveyor Add support for appveyor.com windows CI
Joakim Söderberg 5f89c37e 2015-02-05T19:24:19 Add support for appveyor.com windows CI This does the same thing as Travis-CI but for windows. @nmathewson Go to: https://ci.appveyor.com/login -> Login using Github Click **+New Project** -> Choose **Github** to the left -> Find **Libevent** in the list and click **Add**
Nick Mathewson deca354c 2015-02-05T12:14:16 Merge pull request #116 from JoakimSoderberg/fix_build_tree_cmake_config This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230
Joakim Söderberg 19ba4543 2015-02-05T00:56:58 This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230 CMake configuration files are intended to be used by other projects to find the library. Specifically the CMake find_package command can use it to find all files related to the project. The idea is to support 2 different CMake configuration files for Libevent. One if you simply build libevent that is generated for the build tree. And a second one that is generated for an install target that will be installed on the system and point to where on the system the lib files and such can be find. So for instance, in the build tree the config would set the cmake variable `LIBEVENT_INCLUDE_DIRS` to `/path/to/libevent/build/include`. And for the system config it would be set to `/usr/local/include` (or whatever target the user chose when running cmake). 27bd9faf498b91923296cc91643e03ec4055c230 changed this behavior so that both configs would point to the system wide path `/usr/local/include` This meant that projects just wanting to import directly for the build tree would fail.
Nick Mathewson a77a82a0 2015-02-04T08:37:32 Merge remote-tracking branch 'azat/be-pair-fix-freeing-shared-lock-v5'
Nick Mathewson 51821e20 2015-02-04T08:33:42 Merge pull request #207 from azat/avoid-leaking-of-event_debug_map_HT_GROW Avoid leaking of event_debug_map_HT_GROW
Nick Mathewson 4472ec68 2015-02-03T15:57:31 Merge pull request #212 from xbao/master changed strtotimeval signature to avoid conflict with Android NDK sys/time.h header (#211)
Nick Mathewson 1cae3ae1 2015-02-02T13:57:50 Merge remote-tracking branch 'public/master'
Nick Mathewson 537177d3 2015-02-02T13:57:22 New function to get address for nameserver.
Xiao Bao Clark bdbc823f 2015-01-28T17:17:02 changed strtotimeval signature as per #211
Nick Mathewson 62eaa889 2015-01-27T10:07:22 Merge pull request #210 from mc-server/master Added cmake-generated files to ignore list.
Matyas Dolak 6c12bfec 2015-01-27T15:30:52 Added cmake-generated files to ignore list. These are generated by cmake on Windows with MSVC.
Azat Khuzhin a558fcdb 2015-01-26T00:31:23 be_pair/regress: cover use of shared lock (lock/unlock/free) For more info look at 92a359ee3adf4636db508e6c6d7179d4d59eaafc ("be_pair: release shared lock with the latest of bufferevent_pair")
Azat Khuzhin e5c87d18 2015-01-26T00:29:15 event_free_debug_globals_locks(): disable lock debugging This will allow to use library event after event_free_debug_globals_locks()/libevent_global_shutdown() without invalid read/write's.
Azat Khuzhin ccc55937 2015-01-26T00:28:46 evthread: evthreadimpl_disable_lock_debugging_() for libevent_global_shutdown()
Azat Khuzhin c0b34f6f 2015-01-26T00:27:41 evthread: add evthread_get_{lock,condition}_callbacks() helpers
Azat Khuzhin 92a359ee 2015-01-03T19:37:15 be_pair: release shared lock with the latest of bufferevent_pair Then next code sample will use free'd lock: evthread_use_pthreads(); ... assert(!bufferevent_pair_new(base, BEV_OPT_THREADSAFE, pair)); ... bufferevent_free(pair[0]); # refcnt == 0 -> unlink bufferevent_free(pair[1]); # refcnt == 0 -> unlink ... event_base_free() -> finalizers -> EVTHREAD_FREE_LOCK(bev1->lock) -> BEV_LOCK(bev2->lock) <-- *already freed* While if you will reverse the order: bufferevent_free(pair[1]); # refcnt == 0 -> unlink bufferevent_free(pair[0]); # refcnt == 0 -> unlink ... event_base_free() -> finalizers -> BEV_LOCK(bev2->lock)/!own_lock/BEV_UNLOCK(bev2->lock) -> EVTHREAD_FREE_LOCK(bev1->lock) (own_lock) It is ok now, but I guess that it will be better to relax order of freeing pairs.
Nick Mathewson 4d66552a 2015-01-22T12:15:01 Merge pull request #115 from jer-gentoo/master EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD
jer-gentoo 8674e4fb 2015-01-21T11:24:23 EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD Looks like EVBUFFER_PTR_ADD should have been used instead of EVBUFFER_PTR_SET.
Azat Khuzhin 3540a193 2015-01-08T04:45:49 regress_dns: drop hack for event_debug_map_HT_GROW in leak tests
Azat Khuzhin 941faaed 2015-01-08T04:45:27 event: call event_disable_debug_mode() in libevent_global_shutdown() This will avoid leaking of event_debug_map_HT_GROW I buildin it into libevent_glboal_shutdown() because event_disable_debug_mode() -> event_free_debug_globals() -> event_free_debug_globals_locks() will clean event_debug_map_lock_ that used in event_disable_debug_mode().