1076 Commits

Author SHA1 Message Date
Azat Khuzhin
42aefeb0af test: add regress for evhttp_connection_set_family() with AF_INET and AF_UNSPEC 2014-03-27 00:50:04 +04:00
Azat Khuzhin
177b8a7ce8 test: add family argument for http_connection_test_() 2014-03-27 00:49:58 +04:00
Nick Mathewson
6066f985cc Merge pull request #121 from azat/dns-regress-leaks
regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests
2014-03-26 11:02:52 -04:00
Azat Khuzhin
2fdc5f299f regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests 2014-03-23 15:12:29 +04:00
Trond Norbye
dc82c8d372 Renamed sin to saddr due to name conflict
During building on MSVC 2013 I got a compiler error by a
type conflict for sin:

test-fdleak.c(60) : error C2365: 'sin' : redefinition; previous definition was 'function'
test-fdleak.c(134) : error C2070: 'double (__cdecl *)()': illegal sizeof operand
test-fdleak.c(134) : error C2198: 'evconnlistener_new_bind' : too few arguments for call
test-fdleak.c(148) : error C2070: 'double (__cdecl *)()': illegal sizeof operand
test-fdleak.c(148) : error C2168: 'memcpy' : too few actual parameters for intrinsic function
test-fdleak.c(149) : error C2224: left of '.sin_family' must have struct/union type
test-fdleak.c(212) : error C2070: 'double (__cdecl *)()': illegal sizeof operand
test-fdleak.c(212) : error C2198: 'bufferevent_socket_connect' : too few arguments for call
test-fdleak.c(239) : error C2070: 'double (__cdecl *)()': illegal sizeof operand
test-fdleak.c(239) : error C2168: 'memset' : too few actual parameters for intrinsic function
test-fdleak.c(240) : error C2224: left of '.sin_family' must have struct/union type
test-fdleak.c(241) : error C2224: left of '.sin_addr' must have struct/union type
test-fdleak.c(242) : error C2224: left of '.sin_port' must have struct/union type

The simplest solution to this problem would be to rename
the variable.
2014-03-21 14:26:10 +01:00
Nick Mathewson
6a1c4d501b Correctly skip ipv6 http test on systems without ipv6 2014-03-18 18:36:32 -04:00
Nick Mathewson
e5302ac716 Remove integer-overflow unit tests
There's not much point checking undefined behavior.
2014-03-18 12:35:39 -04:00
Nick Mathewson
58fc9b6c0a Fix ubsan warnings when parsing ipv4/ipv6 addrs
left-shifting a one-byte integer by 24 invokes undefined behavior.
Let's not do that.
2014-03-18 11:35:50 -04:00
Nick Mathewson
860c71c892 Fix an illegal read error in the evbuffer_add_reference tests
Found with AddressSanitizer
2014-03-18 11:13:45 -04:00
Nick Mathewson
2578ec14f5 Avoid double-close paths in http tests
Coverity spotted that there were some paths through the test
functions that would double-close some sockets.
2014-03-13 10:46:59 -04:00
Nick Mathewson
b6f15ccea6 Add missing include to regress_finalize.h 2014-03-12 18:19:07 -04:00
Nick Mathewson
21477e408f Skip http/ipv6_for_domain test when we have no ipv6 support 2014-03-12 18:13:19 -04:00
Nick Mathewson
4947c1852f Heap-allocate zlib data structure in regress_zlib tests 2014-03-12 14:29:15 -04:00
Nick Mathewson
7a80476768 Update to the latest version of tinytest
This brings us up to tinytest 709a36ba63ff16d8
2014-03-06 18:09:00 -05:00
Nick Mathewson
239d8345be Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES
Patch from Harlan Stenn.
2014-03-06 10:18:09 -05:00
Joakim Soderberg
e212c5486d Check for OSX when checking for clang. 2014-01-22 13:19:49 +01:00
Nick Mathewson
5c142a7ee9 Merge remote-tracking branch 'origin/pr/98' 2014-01-21 14:53:47 -05:00
Nick Mathewson
4cb44fdf56 Merge remote-tracking branch 'joakimsoderberg/new_cmake'
Conflicts:
	sample/https-client.c
2014-01-21 14:26:01 -05:00
Nick Mathewson
c2076824a3 Fix a c90 warning 2014-01-21 12:21:37 -05:00
Joakim Söderberg
4e1439588f Change all uses of WIN32 to _WIN32 2014-01-21 11:30:27 +01:00
Diego Giagio
b1b69ac7c1 Implemented EV_CLOSED event for epoll backend (EPOLLRDHUP).
- Added new EV_CLOSED event - detects premature connection close
  by clients without the necessity of reading all the pending
  data. Does not depend on EV_READ and/or EV_WRITE.

- Added new EV_FEATURE_EARLY_CLOSED feature for epoll.
  Must be supported for listening to EV_CLOSED event.

- Added new regression test: test-closed.c

- All regression tests passed (test/regress and test/test.sh)

- strace output of test-closed using EV_CLOSED:
    socketpair(PF_LOCAL, SOCK_STREAM, 0, [6, 7]) = 0
    sendto(6, "test string\0", 12, 0, NULL, 0) = 12
    shutdown(6, SHUT_WR)                    = 0
    epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
    epoll_wait(3, {{EPOLLRDHUP, {u32=7, u64=7}}}, 32, 3000) = 1
    epoll_ctl(3, EPOLL_CTL_MOD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
    fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...})
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYM...
    write(1, "closed_cb: detected connection close "..., 45) = 45
2014-01-17 23:20:42 -02:00
Joakim Soderberg
24d646666b Fix so that old nmake project still builds. 2014-01-14 17:53:47 +01:00
Nick Mathewson
d240328d60 Fix even more coverity warnings. 2014-01-08 13:02:37 -05:00
Nick Mathewson
860767e841 Fix a couple of compilation warnings in regress_http.c 2014-01-08 12:46:09 -05:00
Nick Mathewson
544cf8888a Whoops; fix compilation in bench.c 2014-01-08 11:58:50 -05:00
Nick Mathewson
ff7f739685 Fix coverity warnings in benchmark tools.
Again, not harmful, but best to stay warning-free.
2014-01-08 11:54:56 -05:00
Nick Mathewson
867f401f9b Fix a pile of coverity warnings in the unit tests
Most of these problems can only trigger when the tests fail, but it's
good hygiene to keep the code warning-free in any case.
2014-01-08 11:51:22 -05:00
Nick Mathewson
8d15f57f61 Merge remote-tracking branch 'asweeny86/on-complete-cb' 2014-01-07 16:59:26 -05:00
Andrew Sweeney
b85f398704 Update unit test to make sure that the callback happens after the output data is written 2014-01-06 21:19:15 -05:00
Nick Mathewson
f9e091bf4e Merge remote-tracking branch 'asweeny86/event-count-max' 2014-01-06 12:11:30 -05:00
Andrew Sweeney
b083ca0551 Provide on request complete callback facility
This patch provides the ability to receive a callback on the completion of a
request.  The callback takes place immediately before the request's resources
are released.
2014-01-05 20:35:46 -05:00
Andrew Sweeney
26230a2d21 Added unit test for max event counts 2014-01-05 16:30:35 -05:00
Nick Mathewson
b4ef3def6f Merge remote-tracking branch 'mistotebe/bufferevent_trigger' 2013-12-24 10:33:58 -05:00
Nick Mathewson
87fa2b004a Unit tests for active_by_fd; unsupport active_by_fd(TIMEOUT)
[It turns out that event_base_active_by_fd(TIMEOUT) didn't actually
work right. Feel free to add it back in as a patch.]
2013-12-23 20:46:38 -05:00
Joakim Soderberg
0ef1d04e44 Get rid of unknown pragma warnings. 2013-12-17 14:32:07 +01:00
Joakim Söderberg
69c3516be6 Get rid of deprecation warnings for OpenSSL on OSX 10.7+ 2013-12-17 13:28:23 +01:00
Joakim Soderberg
8f2af50f38 Don't segfault on no found event backend. 2013-12-16 13:45:45 +01:00
Joakim Soderberg
78da644f3d Fix bench_cascade program on Windows. 2013-12-16 11:35:31 +01:00
Joakim Soderberg
dbf2b5171a Use evutil_closesocket instead. 2013-12-16 11:26:29 +01:00
Joakim Soderberg
99c1dc3233 More work on adding tests to CMake project 2013-12-12 18:21:11 +01:00
Joakim Soderberg
e9fc014c86 Add all tests and benchmarks to CMake project.
Also fixed some minor issues with what's built.
2013-12-12 16:33:20 +01:00
Joakim Soderberg
e415196a7d Initial CMake commit. 2013-12-09 18:05:32 +01:00
Ondřej Kuzník
a7384c7824 Add an option to trigger bufferevent event callbacks 2013-12-03 23:39:13 +00:00
Ondřej Kuzník
61ee18b8b1 Add an option to trigger bufferevent I/O callbacks 2013-12-03 23:39:13 +00:00
Ondřej Kuzník
4ce242bd00 Add watermark introspection 2013-12-03 23:39:13 +00:00
Azat Khuzhin
4dd500cdf4 regress_http: add tests for evhttp_connection_get_addr() 2013-10-14 11:22:30 -04:00
Azat Khuzhin
611e28b6ee regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset 2013-10-01 20:22:27 +04:00
Nick Mathewson
0a051ef93c Merge remote-tracking branch 'rosslagerwall/tree-build' 2013-09-16 12:29:48 -04:00
Ross Lagerwall
243386ccc2 rpcgen: Generate regress.gen.[c,h] in build rather than src dir
Currently an out-of-tree build will either write to the src dir or reuse
the existing regress.gen.[c,h].  But if building from a read-only git
tree (or if the git dir is cleaned), these files will not exist and the
build fails.  So write the files to the build dir.  If the system does
not have python, the regress.gen.[c,h] will be used from the src dir if
they exist.
2013-09-15 21:48:15 +02:00
Nick Mathewson
e193c959de test_evutil_rtrim: add another missing check. 2013-08-06 19:42:20 -04:00