* Fix: Query parameter including query delimiter ('?') not being parsed properly
* Add details::split function with and without m argument to allow split parameters with/without counter
* Revert changes in SplitTest.ParseQueryString
* Fix successful decompress reported as Error::Read
Streams less than 4096 bytes are sometimes reported as failed reads because stream_.avail_in is not reduced to 0. The next iteration of the loop finds `prev_avail_in == strm_.avail_in` and return false. `ret = inflate(...)` returns Z_STREAM_END on the first iteration of the loop indicating that inflate is finished. This fix prevents the second iteration of the loop from failing.
* Fix successful decompress reported as Error::Read
- Add unit tests for raw deflate that illustrates the decompression failure when there are extra trailing bytes
* add support for requests with both MultipartFormDataItems and ContentProviders
* rework implementation
* use const auto & and fix offset calculation
* fix zero items
* snake case variables
* clang-format
* commonize get_multipart_content_provider, add Put() with MultipartFormDataProviderItems
* fix linker multiple definition error
* add test MultipartFormDataTest.DataProviderItems
* Add EINTR and EAGAIN judge for accept
* Add EINTR signal tests
* Cancel win32 and win64 compile on signal unittest
Co-authored-by: yukun.yu <yukun.yu@alibaba-inc.com>
* Move next job in task queue rather than copy
* Notify waiting thread after unlocking mutex
* Add unit test for TaskQueue
* Don't use C++14 feature in test code
* handle socket options for UNIX socket same as others
* set FD_CLOEXEC by default
* invoke `socket_options` callback if set
* Offer Client info even on UNIX socket based Server
HTTP Request header "REMOTE_PORT" contains client process id if possible
when Server works on UNIX socket.
* retrigger checks
* retrigger checks
* add support macOS
Co-authored-by: Changbin Park <changbin.park@ahnlab.com>
* SocketStream need to check connectivity for writability.
When the stream is used for SSE server which works via chunked content
provider it's not possible to check connectivity over writability
because it's wrapped by DataSink. It could make the server stalled, when
the provider wants to only keep connection without send data and certain
amount of clients consumes entire threadpool.
* add unittest for SocketStream::is_writable()
SocketStream::is_writable() should return false if peer is disconnected.
* revise broken unittest ServerTest.ClientStop
DataSink could be unwritable if it's backed by connection based. Because
it could be disconnected by client right after enter centent provider.
Co-authored-by: Changbin Park <changbin.park@ahnlab.com>
* httplib.h
add multipart formdata for PUT in addition to POST as some REST
APIs use that.
Factor the boundary checking code into a helper and use it from
both Post() and Put().
* test/test.cc
add test cases for the above.
* Add support UNIX domain socket
* `set_address_family(AF_UNIX)` is required
* add unittest for UNIX domain socket
* add support UNIX domain socket with abstract address
Abstract address of AF_UNIX begins with null(0x00) which can't be
delivered via .c_str() method.
* add unittest for UNIX domain socket with abstract address
Co-authored-by: Changbin Park <changbin.park@ahnlab.com>