Jacob Champion
edb874e659
nghttp: move ContinueTimer start to on_frame_send
...
The ContinueTimer could expire before the full HEADERS frame was
actually sent. By moving the call to timer->start() to the
on_frame_send_callback(), this race is fixed.
2016-03-28 15:24:20 -07:00
Jacob Champion
3b7b6a660e
nghttp: prevent ContinueTimer double-invocation
...
If a 100 Continue interim response was received after the continue
timeout was reached, dispatch_continue() would force a double submission
of DATA frames. This patch prevents dispatch_continue() from doing
anything if the timer callback has already been invoked. This makes
ContinueTimer a single-shot mechanism, as originally intended.
2016-03-23 09:09:13 -07:00
Jacob Champion
1bc5cf5ee4
nghttp: time out on long Expect/Continue waits
...
To deal with servers that don't conform to RFC 7231 (or, potentially,
connections with a large round-trip time), don't wait forever for a 100
Continue status to come back. Currently, the timeout is hard-coded to
one second.
A ContinueTimer encapsulates the handshake timeout logic for a single
request. Somewhat counterintuitively, ContinueTimers are owned by the
HttpClient instead of the Request object, because their lifetime must be
bound to the life of the connection (which is owned by the HttpClient
and not the Requests). A Request is associated with its corresponding
ContinueTimer through a std::weak_ptr.
2016-03-22 13:10:00 -07:00
Jacob Champion
f4c7ebcbca
nghttp: implement Expect/Continue handshake
...
Requests that expect a 100 Continue will not submit their DATA frames
until the server sends the interim response.
2016-03-22 13:10:00 -07:00
Jacob Champion
feb3d1b478
nghttp: add an --expect-continue option
...
Add a placeholder for the expect-continue option, which will perform an
Expect/Continue handshake for DATA uploads.
2016-03-22 13:10:00 -07:00
Tatsuhiro Tsujikawa
7c954c1ea7
nghttpx: Workaround for Ubuntu 15.04 which does not value-initialize on std::make_shared.
2016-03-23 01:32:17 +09:00
Tatsuhiro Tsujikawa
e9f4d0eec2
nghttpx: Properly log incoming GOAWAY from backend
2016-03-23 01:16:44 +09:00
Tatsuhiro Tsujikawa
4f9c78799c
nghttpd: Fix compile error with Android NDK
2016-03-23 01:16:02 +09:00
Tatsuhiro Tsujikawa
0f9ed40bd9
nghttpx: Share connection among different patterns if address set are same
2016-03-23 00:01:27 +09:00
Tatsuhiro Tsujikawa
4bb88b35ec
nghttpx: "*" must match at least one character
2016-03-22 22:40:23 +09:00
Tatsuhiro Tsujikawa
04145e22a2
Revert "nghttpx: Call setsid after executing new binary"
...
This reverts commit 6680d8b792
.
2016-03-22 00:21:32 +09:00
Tatsuhiro Tsujikawa
dc3119303a
Rewrite concat_string_ref
2016-03-20 17:55:17 +09:00
Tatsuhiro Tsujikawa
d2b55ad1a2
nghttpx: Allow '*' in --error-page to be used as wildcard
2016-03-19 23:49:15 +09:00
Tatsuhiro Tsujikawa
d7051f5207
nghttpx: Add custom error pages
2016-03-19 23:41:21 +09:00
Tatsuhiro Tsujikawa
db1ee3aa88
nghttpd: Use StringRef
2016-03-19 20:57:40 +09:00
Tatsuhiro Tsujikawa
a1e0bd134e
nghttpx: Create at least the same number of h2 session as load balancing hosts
2016-03-19 12:00:27 +09:00
Tatsuhiro Tsujikawa
dcae6efaa2
nghttpx: Rewrite Downstream::assemble_request_cookie using StringRef
2016-03-19 11:38:09 +09:00
Tatsuhiro Tsujikawa
8da0d649e4
Merge branch 'cmake' of https://github.com/Lekensteyn/nghttp2 into Lekensteyn-cmake
2016-03-19 11:20:31 +09:00
Peter Wu
d10f149161
cmake: fix Windows support
...
Fix Windows build by defining `ssize_t` when missing and adjusting the
install commands.
Add support for ENABLE_WERROR=1 while at it.
Tested with MSVC 2013 on Windows 7 x64.
2016-03-16 17:33:20 +01:00
Peter Wu
3a2a943fe9
cmake: do not fail without libxml2
...
Avoid adding a LIBXML2_LIBRARIES-NOTFOUND to the libraries list when it
is not found. Likewise for OpenSSL.
2016-03-16 17:33:10 +01:00
Peter Wu
162b1c5e03
cmake: only install ASIO headers when requested
2016-03-15 00:02:46 +01:00
Peter Wu
dc56b951df
src/Makefile.am: fix missing allocator.h
...
Fix regression from v1.8.0-38-gbae37e3 breaking distcheck.
2016-03-14 17:49:23 +01:00
Peter Wu
7c55c335cc
Merge branches 'master' and 'cmake-updated' into cmake
...
Update to latest master with appropriate cmake changes at the same time.
2016-03-14 17:26:15 +01:00
Peter Wu
2ddb83206b
cmake: sync with v1.8.0-63-g37b09f6
...
Adds missing source files and configure.ac changes since
v1.7.0-93-g093eb51.
2016-03-14 17:20:37 +01:00
Tatsuhiro Tsujikawa
ab734f09b6
nghttpx: Fix possible crash in rare case
2016-03-15 00:46:15 +09:00
Tatsuhiro Tsujikawa
dd2bdf3e31
nghttpx: Update doc
2016-03-14 23:53:10 +09:00
Tatsuhiro Tsujikawa
a909bb3eca
nghttpx: Initialize proto field
2016-03-14 23:47:29 +09:00
Tatsuhiro Tsujikawa
01408209d8
nghttpx: Fix the bug that forwarded query contains duplicated '?'
...
This change also fixes that bug that the multiple '/' at the start of
request were not coalesced into one.
2016-03-14 22:20:00 +09:00
Peter Wu
7f8110601e
cmake: fix compatibility with cmake before 3.3
...
The COMPILE_LANGUAGE generator expression is only supported since CMake
3.3. Moreover, it does not work with all generators (works with Makefile
and Ninja, but not with Visual Studio).
target_compile_options would only work if a target does not mix C and
C++ sources, since the flags are intended to be set for a specific
language, use set_source_files_properties instead. This approach is also
less repetitive.
Drop the idea of using lists and COMPILE_OPTIONS,
set_source_files_properties only understands COMPILE_FLAGS (a single
string, not a list).
2016-03-13 12:30:41 +01:00
Tatsuhiro Tsujikawa
2a606bae4c
Add nghttp2_error_callback to tell application human readable error message
2016-03-13 18:22:52 +09:00
Tatsuhiro Tsujikawa
3b2811bfc4
nghttpx: Remove AltSvc ctor
2016-03-13 14:01:59 +09:00
Tatsuhiro Tsujikawa
27275a02ac
nghttpx: Remove unused EMPTY_STRING
2016-03-13 13:59:06 +09:00
Tatsuhiro Tsujikawa
34d209b30b
nghttpx: Add wildcard host routing
...
This change allows host pattern in --backend to include '*' to
indicate wildcard match. The wildcard match is made in suffix match
only.
2016-03-13 01:01:34 +09:00
Tatsuhiro Tsujikawa
94f52d49dc
BlockAllocator: Delete copy ctor and assignment operator
2016-03-12 21:25:53 +09:00
Tatsuhiro Tsujikawa
0ee09320e0
src: Remove unused value_to_str
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
78fcb2143f
Update doc
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
755b14de5d
src: Unify path_join implementation
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
3455cb35e4
nghttpx: Rewrite create_forwarded to use BlockAllocator
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
c1571a3209
src: Rewrite xff handling
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
67569486d1
src: Rewrite http:create_via_header_value
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
d64051fedc
src: Return StringRef from http2::stringify_status
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
c897d5b294
src: Use StringRef in parse_http_date
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
863a944179
src: Add specialization for char to avoid reinterpret_cast in constexpr
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
12dad32890
Add nghttp2_on_header_callback2
2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa
eb393985b7
nghttpx: Make a copy before adding header to Downstream
2016-03-12 21:12:26 +09:00
Tatsuhiro Tsujikawa
7a412df9a5
nghttpx: Fix tests
2016-03-12 21:12:26 +09:00
Tatsuhiro Tsujikawa
b1b57cc740
nghttpx: Use StringRef for authority, scheme and path
2016-03-12 21:12:26 +09:00
Peter Wu
bdb6581990
Add CMake-related files to EXTRA_DIST
2016-03-12 01:38:12 +01:00
Peter Wu
618073e2b4
cmake: add "check" target
...
Add a "check" target that builds tests before running them.
2016-03-12 00:57:30 +01:00
Tatsuhiro Tsujikawa
fa601e5ba3
Add isolation_threshold, use field to store block size rather than template parameter
2016-03-09 21:25:11 +09:00