3840 Commits

Author SHA1 Message Date
Jan Beich
77ec05e50d test/bench*: prefix event-config.h macros after 0dda56a48e94 2017-01-29 23:02:41 +03:00
Jan Beich
d9118c8daa test/bench_httpclient: restore SO_LINGER usage after 0dda56a48e94 2017-01-29 23:02:41 +03:00
Azat Khuzhin
7bc822cad9 Include openssl-compat.h into dist archive
Refs: nmathewson/Libevent@140
Refs: http://archives.seul.org/libevent/users/Jan-2017/msg00001.html
2017-01-29 22:13:46 +03:00
Azat Khuzhin
fe2c2622c3 Make EVENT_STAGE_NAME non cached
It did not work before correctly anyway, since cmake do not reset cache
entries by default, so that reset to "beta" didn't work.

But I don't think that making this variable cached is useful, so let's
remove this.
2017-01-29 20:35:57 +03:00
Azat Khuzhin
0344edf62d Do not overwrite version from GIT if it is older then defaults 2017-01-29 20:35:57 +03:00
Azat Khuzhin
efcfa046ae Bump version in master to 2.2.0-alpha-dev
And according to f8d80a285cf941505277d9060d0357b5b7e543d2 ("Bump version
to 2.1.3-alpha-dev") numeric version have 1 at the end, since it means
"-dev".
2017-01-29 20:33:55 +03:00
Azat Khuzhin
94e7dcebc3 Fix -Werror=implicit-fallthrough (fixes gcc-7)
Fixes: #447
2017-01-29 17:58:31 +03:00
Azat Khuzhin
e7ff4ef2b4 Merge branch 'release-2.1.8-stable-pull'
* release-2.1.8-stable-pull:
  Bump version to 2.1.8-stable everywhere
  VERSION_INFO should me equal to library version
  Bump whatsnew-2.1 document
  Update ChangeLog for 2.1.8-stable
  README: update AUTHORS
release-2.1.8-stable
2017-01-26 02:37:15 +03:00
Azat Khuzhin
9b63b5d410 Bump version to 2.1.8-stable everywhere
P.S. in referenced commit I made a mistake and instead of *-rc* I wrote
*-beta*.

See-also: f4489b8323cda0bf8eed7c1353911a852d7a947c ("Bump version to
2.1.7-beta everywhere")
2017-01-26 02:36:00 +03:00
Azat Khuzhin
bed52ff6ff VERSION_INFO should me equal to library version
This reverts commit 43243b9d55efcd0e6e2767a5c45bc7da46cff60c (I
shouldn't do this).
2017-01-26 02:36:00 +03:00
Azat Khuzhin
227bfe5626 Bump whatsnew-2.1 document 2017-01-26 02:36:00 +03:00
Azat Khuzhin
d9eb42e082 Update ChangeLog for 2.1.8-stable
$ git log --format='    o %s (%h %cN)' HEAD...refs/tags/release-2.1.7-rc
2017-01-26 02:36:00 +03:00
Azat Khuzhin
50824ae2a0 README: update AUTHORS
$ git log --format='%an' HEAD...refs/tags/release-2.1.6-beta | sort -u | xargs -n1 -i bash -c 'fgrep -q "{}" README.md || echo {}'
2017-01-22 16:14:30 +03:00
Azat Khuzhin
59e217dfe1 Merge branch 'automake-tests-parallel-v4' (*includes ci bits also*)
This patch set runs tests in parallel (on travis/appveyor/vagrant), it
includes cmake/autotools(automake).

It should significantly decrease time that tests tooks on travis-ci (3-4
times lower, right now it is about 14-17 hours - too long!), but not
without downsides, now because travis-ci workers has limited resources
we will have more timing-related failures, but this is another storry,
anyway ~16 hours is not acceptable. Anyway if machine has enough
resources it is great to have ability to run tests in parallel (which
automake couldn't do before).

Changes for common test env:
- autotools: before 17m / after 3m
- cmake:     before 15m / after 87 sec

* automake-tests-parallel-v4:
  Run tests in parallel (they are lightweight), on CI and vagrant boxes
  travis-ci: install cmake from xenial (CTEST_PARALLEL_LEVEL support)
  test: register different tests in automake
  test: run different tests under different options (in a wrapper)
  automake: do not use serial-tests if parallel-test-harness available

Fixes: #439
2017-01-22 04:12:04 +03:00
Azat Khuzhin
9c9be3994d vagrant/netbsd: missing libtool 2017-01-22 03:58:15 +03:00
Azat Khuzhin
108b5fef41 Run tests in parallel (they are lightweight), on CI and vagrant boxes
By default 20 parllel jobs, but one caveat for travis-ci, osx boxes
there slower and have less resources then linux (discovered during
testing), so limit number of parallel jobs to 4 there, and also install
travis_wait, so that travis-ci will not fail the build when there is no
output for 10 minutes, since for osx boxes it is very likely.

Refs: travis-ci/travis-ci@7202
2017-01-22 03:22:27 +03:00
Azat Khuzhin
2a67f4fc12 travis-ci: install cmake from xenial (CTEST_PARALLEL_LEVEL support)
cmake supports it since 3.0 I guess.

And it must be trusty (not precise), otherwise it fails:
  dpkg: error processing
  /var/cache/apt/archives/ifupdown_0.8.10ubuntu1_amd64.deb (--unpack):
   trying to overwrite '/etc/init.d/networking', which is also in package netbase 4.47ubuntu1

Link: https://travis-ci.org/azat/libevent/jobs/193744023
2017-01-22 03:22:27 +03:00
Azat Khuzhin
ea1d30cac4 test: register different tests in automake
Before this patch we have one test.sh (well test-script.sh), and tooks
very long to run it sequentially, but they are pretty lightweight, so we
should run then in parallel.
2017-01-22 03:22:07 +03:00
Azat Khuzhin
54d7473f91 test: run different tests under different options (in a wrapper) 2017-01-22 03:21:43 +03:00
Azat Khuzhin
a7513cc968 automake: do not use serial-tests if parallel-test-harness available
Revert: 61179dec7716975a151c6dae4524ae504d05780e ("automake: define
serial-tests only if automake have this option") Revert:
Revert: 44d755e00e249c09914cf35089c16735df82e270 ("test/automake: don't
use paralell test harness (since automake 1.12)")
2017-01-22 02:58:02 +03:00
Azat Khuzhin
43243b9d55 Bump VERSION_INFO so that libraries symlinks will have the same version
Fixes: f4489b8323cda0bf8eed7c1353911a852d7a947c ("Bump version to 2.1.7-beta
everywhere")
2017-01-20 21:24:54 +03:00
Azat Khuzhin
d6bafbbeb2 test/dns: replace servname since solaris does not have "http"
Yes, by default solaris (solaris10.dev 5.10 Generic_147148-26 i86pc i386 i86pc)
does not have "http" in /etc/services
2017-01-20 02:16:50 +03:00
Azat Khuzhin
83e0f43b03 Merge branch 'openssl-filter-fixes-v4'
* openssl-filter-fixes-v4:
  be: fix with filtered bufferevents and connect() without EAGAIN
  test/ssl: fix bufferevent_getfd() for bufferevent_openssl_filter_new()
  be_openssl: Fix writing into filted openssl bufferevent after connected
  test/https: separate cases for https client with filtered openssl bufferevent
  test/ssl: cover case when we writing to be_openssl after connecting

Fixes: #428
2017-01-19 20:53:18 +03:00
Azat Khuzhin
9a0a3a3e65 be: fix with filtered bufferevents and connect() without EAGAIN
With filtered bufferevents (i.e. not real one, that have socket), we can
trigger incorrect callback in this case. Let's look at example with http
and bufferevent_openssl_filter_new():
- bev = bufferevent_openssl_filter_new()
- http layer trying to connect() to localhost with bev
  # at this time, bev have writecb/readcb NULL but ev_write/ev_read has
  # timeout with 45 secs, default HTTP connect timeout
- and when connect() retruns without EAGAIN (BSD'ism) we called
  event_active() before (with EV_WRITE), and this will call ev_write
  timeout only, while it is more correct to act on bufferevent instead
  of plain event, so let's trigger EV_WRITE for bufferevent which will
  do the job (and let's do this deferred).

Fixes: http/https_simple # under solaris
2017-01-19 20:53:05 +03:00
Azat Khuzhin
09b6201304 test/ssl: fix bufferevent_getfd() for bufferevent_openssl_filter_new() 2017-01-19 20:53:05 +03:00
Azat Khuzhin
8939676706 be_openssl: Fix writing into filted openssl bufferevent after connected
The main problems was due to when bufferevent_openssl has underlying (i.e.
created with bufferevent_openssl_filter_new()) some events was
disabled/suspended, while with openssl, READ can require WRITE and vice-versa
hence this issues.

The BEV_CTRL_GET_FD hunk to fix http subsystem, since it depends from what
bufferevent_getfd() returns.

Fixes: #428
Fixes: ssl/bufferevent_filter_write_after_connect
Fixes: http/https_filter_chunk_out
Fixes: da52933550fd4736aa1c213b6de497e2ffc31e34 ("be_openssl: don't call
do_write() directly from outbuf_cb")
2017-01-19 20:53:05 +03:00
Azat Khuzhin
d77fcea15f test/https: separate cases for https client with filtered openssl bufferevent
- http/https_filter_chunk_out # now hang
- http/https_filter_basic     # works, since writes only before connect()
2017-01-19 20:53:05 +03:00
Azat Khuzhin
d047c2412e test/ssl: cover case when we writing to be_openssl after connecting
Right now it fails because of regression for filtered openssl
bufferevent, and by it I mean ssl/bufferevent_filter_write_after_connect
test, and by fails - hang.

Regression-for: da52933550fd4736aa1c213b6de497e2ffc31e34 ("be_openssl:
don't call do_write() directly from outbuf_cb")
2017-01-19 20:53:05 +03:00
Azat Khuzhin
3c7422fc52 test/thread: netbsd is too slow, increase timeout for conditions_simple 2017-01-19 20:51:38 +03:00
Azat Khuzhin
0786253115 test/dns: run async resolving after sync one (to avoid timeouts)
If system resolver (sync one) will respond too slow, then we can fail async
request and evdns will retransmit tham again, but evdns server will accept that
failed requets, so we will have not 2 requests but 4.

Reproduced on centos box sometimes.
2017-01-19 20:50:22 +03:00
Azat Khuzhin
36da6877f0 vagrant/netbsd: more reliable way of installing packages
Link: http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/pkgsrc.html#installing-binary-packages
2017-01-19 20:46:07 +03:00
Azat Khuzhin
26f416c1a5 test/http: turn off some tests that based on backlog filling (falky)
Since this technique does not work well everywhere, anyway it fails from time
to time.

See: https://travis-ci.org/libevent/libevent/jobs/186426446
2017-01-08 05:22:02 +03:00
Breaker
3821cca1a6 Update README.md
The default option of  EVENT__DISABLE_OPENSSL:BOOL is `OFF`
2016-12-23 16:19:35 +08:00
Azat Khuzhin
4798de6c64 test: fix util/date_rfc1123 under win32
Refs: #417
v2: check when gmtime() returns NULL
v3: fix overflow cases
2016-12-22 18:10:24 +03:00
Azat Khuzhin
4545807db4 Fix UB in evutil_date_rfc1123()
As pointed in https://github.com/libevent/libevent/pull/417#issuecomment-267860738
  "code is unsafe because in evutil_date_rfc1123() the pointer to the
  automatic variable struct tm cur is used outside the scope it defined."

Checked with `clang -fsanitize=address -fsanitize-address-use-after-scope`
and test that call evutil_date_rfc1123() with tm==NULL
2016-12-22 14:46:38 +03:00
Azat Khuzhin
68def4352c Merge branch 'date-rfc1123'
Follow RFC2616 (Date header should be in RFC1123 format).

But to reproduce this bug, program that uses libevent http-server should
call `setlocale(LC_ALL, "")` to properly initliaze locale, so that
strftime() retruns locale-specific dates.

* date-rfc1123:
  add tests for evutil_date_rfc1123().
  http: do not use local settings for Date header

Closes: #417
2016-12-19 01:31:20 +03:00
Vis Virial
360aa233f0 add tests for evutil_date_rfc1123(). 2016-12-19 00:58:49 +03:00
Vis Virial
db60ade81d http: do not use local settings for Date header 2016-12-19 00:55:50 +03:00
johnsonlee
23f9a20e8d Fix incorrect MIME type 2016-12-13 11:54:09 +08:00
Azat Khuzhin
32adf4347d be_openssl: make be_openssl_set_fd() static (no prototype required) 2016-12-07 01:48:54 +03:00
Azat Khuzhin
86fa007066 Merge branch 'be-openssl-fd-reset-fix-v2'
Two issues:
- dirty_shutdown for openssl 1.1
- BEV_CTRL_SET_FD for bufferevent_openssl didn't reset state

* be-openssl-fd-reset-fix-v2:
  Fix dirty_shutdown for openssl 1.1
  Fix reusing bufferevent_openssl after fd was reseted (i.e. on new connection)
  test/https: fix ssl dirty bypass for https_simple
  test/https: cover multiple request over the same connection
  test/http: sanity check for http_request_empty_done()

Reported-by: liutao74748@163.com
ML: http://archives.seul.org/libevent/users/Nov-2016/msg00041.html
2016-12-07 01:43:35 +03:00
Azat Khuzhin
d94b1762c5 Fix dirty_shutdown for openssl 1.1
SSL_read() returns -1, even when underlying read() return 0
2016-12-07 01:34:27 +03:00
Azat Khuzhin
5ab9518f15 Fix reusing bufferevent_openssl after fd was reseted (i.e. on new connection)
For example if you trying to issue multiple requests over the same
evhttp_conneciton, and if connection already closed (IOW it should be
re-connected), than you will get into trouble since it will got wrong
openssl state. This patch addresses this issue by restoring state to
initial if SETFD called with -1 fd.
2016-12-07 01:34:14 +03:00
Azat Khuzhin
cfe2ab22f2 test/https: fix ssl dirty bypass for https_simple
Tests:
- http/https_simple_dirty # not affected, since dirty is the default
- http/https_simple       # affected

v2: fix compilation with -DEVENT__DISABLE_OPENSSL=ON
2016-12-07 01:30:41 +03:00
Azat Khuzhin
45247e6fd9 test/https: cover multiple request over the same connection
Introduce two new tests:
- http/https_connection         # fail
- http/https_persist_connection # ok

Reported-by: liutao74748@163.com
2016-12-07 01:24:40 +03:00
Azat Khuzhin
e6ae069b48 test/http: sanity check for http_request_empty_done() 2016-12-07 01:24:40 +03:00
Azat Khuzhin
18a161f0e7 Merge branch 'openssl-1.1-init-fixes-v2'
* openssl-1.1-init-fixes-v2:
  sample/le-proxy: use TLS_method instead of SSLv23_method (latest deprecated)
  test: fix building under openssl 1.1 (init functions has been deprecated)
  le-proxy: fix building under openssl 1.1 (init functions has been deprecated)

Reported-by: varun.net@gmail.com
ML: http://archives.seul.org/libevent/users/Nov-2016/msg00002.html
2016-12-07 01:14:24 +03:00
Azat Khuzhin
fa58cb1da0 sample/le-proxy: use TLS_method instead of SSLv23_method (latest deprecated) 2016-12-07 01:14:16 +03:00
Azat Khuzhin
532a47ce1e test: fix building under openssl 1.1 (init functions has been deprecated)
Refs: #397
2016-12-07 01:14:16 +03:00
Azat Khuzhin
122bf144cf le-proxy: fix building under openssl 1.1 (init functions has been deprecated)
Refs: #397
2016-12-07 01:14:16 +03:00