3094 Commits

Author SHA1 Message Date
Joakim Soderberg
67e5d74983 Fix the make "verify" target on Windows.
Windows does not have the "unset" command, but this doesn't matter since
the problem that requires us to use unset doesn't happen on Windows.

Also did some minor cosmetic changes, and dependcy changes.
2013-12-16 18:10:32 +01:00
Joakim Soderberg
e053c4f029 Added a "make verify" target.
This is more than for cosmetic purposes to match how it's done with autoconf.

Due to the fact that we use environment variables to turn off certain backends during the tests, simply running "ctest" or "make test" can result in failed tests.

This is because if you do "EVENT_NOEPOLL=yes && export EVENT_NOEPOLL" and then run the tests, when running the epoll tests, the EPOLL backend will be turned off. There is no way of unsetting an environment variable for a test in CMake, you can only set them. And since libevent simply checks if the environment variable is set (it doesn't check the actual value of it), this won't work.

So to remedy this, we create the "make verify" target that first unsets all the EVENT_NO* environment variables, and then runs ctest.

Also bumped the required CMake version from 2.6 to 2.8, since the set_test_properties(bla PROPERTIES ENVIRONMENT "SOME_VAR") requires 2.8

Added some explicit dependencies for the test programs to libevent, so they don't just fail if you try to run the tests without first doing "make"
2013-12-16 16:44:13 +00:00
Joakim Soderberg
7ea4159d29 Only test the event backends available on the system.
Fix how the CMake project adds the tests using the different backends. At
first we tried to do it exactly as it's done in test/test.sh.

However, test.sh uses a special program test-init to decide if a given
backend is available or not before running the actual tests. Doing it this way
will not be possible using CMake. Since then we would have to have the
test-init executable compiled at the time we run CMake, to know what tests
we should add. (And since CMake generates the make/project files that
compiles the executables, there's a catch 22).

Instead of deciding what tests to run this way, we simply use the result
of the CMake system introspection (that figures out what backends are
available) to decide what backend tests to add.
2013-12-16 16:37:51 +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
9bbce0b63c Only include WIN32 getopt where it is used.
getopt is only used in the benchmark tests, don't include it in the core
lib...
2013-12-16 11:34:14 +01:00
Joakim Soderberg
c259d53c82 Add copyright and licensing files for CMake modules. 2013-12-16 11:27:13 +01:00
Joakim Soderberg
dbf2b5171a Use evutil_closesocket instead. 2013-12-16 11:26:29 +01:00
Joakim Soderberg
19222e5247 Added some GCC specific options.
- Added sample applications.
- Fixed the https-client to work on Windows kind of (No cert validation).
2013-12-13 16:27:10 +00:00
Joakim Soderberg
58fcd42880 Link libm on unix platforms. 2013-12-13 12:39:50 +00:00
Joakim Soderberg
ce14defeb6 Generate a dummy evconfig-private.h so things build properly.
Windows used to have an empty file for this before.
2013-12-13 13:33:43 +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
Joakim Soderberg
3d10541474 Fix non-C89 variable declaration.
Microsofts C compiler does not support the C99 standard, so variables has
to be declared at the start of a scope.
2013-12-09 16:58:16 +01:00
Nick Mathewson
45eba6ffd5 Rename flush_outdated_host_addresses to clear_host_addresses
"flush" can imply writing something out to a file or connection before
clearing it; "clear" always means "remove".  It's also potentially
misleading to say "outdated" here, since the function removes _all_
addresses regardless, not just certain outdated ones.

Also, don't free the lock in this function.  Also reindent the function.
2013-12-06 10:50:17 -05:00
Nick Mathewson
aeb8d345b4 Merge remote-tracking branch 'origin/pr/86' 2013-12-06 10:37:53 -05:00
Kuldeep Gupta
f03d3535af bug fix for issues #293 evdns_base_load_hosts doesn't remove outdated addresses
As mentioned at https://sourceforge.net/p/levent/bugs/293/
created a small function "evdns_base_flush_outdated_host_addresses" which removes all the previous host addresses, if user wants to clean up the list of hosts can call and use this function.
Defination of this function is part of another patch.
2013-12-06 17:06:20 +05:30
Kuldeep Gupta
954d2f94c0 bug fix for issues #293 evdns_base_load_hosts doesn't remove outdated adresses
As mentioned at https://sourceforge.net/p/levent/bugs/293/
 created a small function "evdns_base_flush_outdated_host_addresses" which removes all the previous requests of hosts , if user wants to clean up the list of hosts can call and use this function. 
Requires function declaration to be added in include/event2/dns.h
 Adding it in another patch for the same bug.
2013-12-06 16:53:16 +05:30
Nick Mathewson
c11e7d9191 start writing a changelog for 2.1.4-(beta?) 2013-12-05 17:25:56 -05:00
Nick Mathewson
735d838b0a Merge remote-tracking branch 'origin/patches-2.0' 2013-12-05 17:14:54 -05:00
Nick Mathewson
f9284c3e3c update the 2.0 changelog 2013-12-05 17:14:05 -05:00
Nick Mathewson
ccf432b912 Try another doxygen tweak 2013-11-21 11:47:34 -05:00
Nick Mathewson
6e67b51023 Small doxygen tweaks 2013-11-21 11:30:04 -05:00
Nick Mathewson
a60632a1ec Merge remote-tracking branch 'origin/patches-2.0' 2013-11-01 14:21:54 -04:00
Nick Mathewson
3b77d62829 Avoid redundant invocations of init_extension_functions for IOCP 2013-11-01 14:20:25 -04:00
Nick Mathewson
515ed87943 Merge branch 'pr_81' 2013-10-14 11:22:40 -04:00
Azat Khuzhin
4dd500cdf4 regress_http: add tests for evhttp_connection_get_addr() 2013-10-14 11:22:30 -04:00
Azat Khuzhin
0c7f0405e3 http: implement new evhttp_connection_get_addr() api.
Basically tcp final handshake looks like this:
    (C - client, S - server)
    ACK[C] - FIN/ACK[S] - FIN/ACK[S] - ACK [C]

However there are servers, that didn't close connection like this,
while it is still _considered_ as valid, and using libevent http layer
we can do requests to such servers.

Modified handshake:
    (C - client, S - server)
    ACK[C] - RST/ACK[S] - RST/ACK[S]

And in this case we can't extract IP address from socket, because it is
already closed, and getpeername() will return: "transport endpoint is not connected".
So we need to store address that we are connecting to, after we know it,
and that is what this patch do.

I have reproduced it, however it have some extra packages.
(I will try to fix it)
https://github.com/azat/nfq-examples/blob/master/nfqnl_rst_fin.c
2013-10-14 11:22:29 -04:00
Nick Mathewson
4464bd2396 Tweak indentation 2013-10-10 16:10:50 -04:00
Nick Mathewson
206124a23c Merge remote-tracking branch 'origin/pr/79' 2013-10-10 16:09:45 -04:00
Nick Mathewson
9721137775 Merge pull request #80 from azat/tests-add-event-debug-logging-all
regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset
2013-10-02 08:45:54 -07:00
Azat Khuzhin
611e28b6ee regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset 2013-10-01 20:22:27 +04:00
Nicolas Martyanoff
5a5acd9a70 add a http default content type option 2013-09-30 18:11:26 +02:00
Nick Mathewson
a093137809 Merge remote-tracking branch 'origin/patches-2.0' 2013-09-19 10:48:27 -04:00
Nick Mathewson
e64a2b0b11 Fix another arc4random_buf-related warning 2013-09-19 10:48:09 -04:00
Nick Mathewson
ee063766f6 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	evutil_rand.c
2013-09-19 10:45:58 -04:00
Nick Mathewson
5cb3865a40 Fix a compiler warning when checking for arc4random_buf linker breakage.
Patch by Ralph Castain.
2013-09-19 10:43:54 -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
b04d13cd72 Merge remote-tracking branch 'origin/patches-2.0' 2013-09-09 12:06:53 -04:00
Nate Rosenblum
5eb178855a Avoid racy bufferevent activation
The evhttp_send_reply method invokes evhttp_write_buffer with a
callback that may release the underlying request object and
bufferevent upon completion. This cleanup callback is invoked by the
underlying bufferevent's write callback. Improperly enabling write
events before referencing the bufferevent could lead to use after free
and memory corruption.
2013-09-09 11:59:00 -04:00
maksqwe
ebfd8a8967 Fix reinit of fds with EV_WRITE but not EV_READ.
Bugfix on 2.1.1-alpha.
2013-09-04 12:22:18 -04:00
Nick Mathewson
911abf3dd2 Check CLOCK_MONOTONIC_* at runtime if needed.
(We need this to avoid compile errors on cygwin.  Fixes github issue
75.)
2013-08-19 10:14:43 -04:00
Nick Mathewson
3807a30b03 Merge remote-tracking branch 'origin/patches-2.0'
Conflicts:
	util-internal.h
2013-08-19 10:05:14 -04:00
Nick Mathewson
c83efb801f Merge remote-tracking branch 'public/20_memclear' into patches-2.0 2013-08-19 10:02:55 -04:00
Nick Mathewson
f5ced88cec Really remove RNG seeds from the stack 2013-08-19 10:02:26 -04:00
Nick Mathewson
c149a1a5e7 Merge remote-tracking branch 'origin/patches-2.0' 2013-08-13 11:14:11 -04:00
Nick Mathewson
bb524712f6 Oops; revert testing code 2013-08-13 11:12:25 -04:00
Nick Mathewson
9695e9c192 Avoid other RNG initialization FS reads when urandom file is specified 2013-08-13 10:59:27 -04:00