Commit Graph

521 Commits

Author SHA1 Message Date
yhirose
379905bd34 Merge branch 'whitespace-and-libcxx-compat' of https://github.com/matvore/cpp-httplib 2019-12-06 09:51:21 -05:00
Matthew DeVore
bc9251ea49 Work around incompatibility in <regex> in libc++
libc++ (the implementation of the C++ standard library usually used by
Clang) throws an exception for the regex used by parse_headers before
this patch for certain strings. Work around this by simplifying the
regex and parsing the header lines "by hand" partially. I have repro'd
this problem with Xcode 11.1 which I believe uses libc++ version 8.

This may be a bug in libc++ as I can't see why the regex would result in
asymptotic run-time complexity for any strings. However, it may take a
while for libc++ to be fixed and for everyone to migrate to it, so it
makes sense to work around it in this codebase for now.
2019-12-05 17:14:16 -08:00
Matthew DeVore
a9e942d755 Properly trim whitespace from headers
HTTP Whitespace and regex whitespace are not the same, so we can't use
\s in regexes when parsing HTTP headers. Instead, explicitly specify
what is considered whitespace in the regex.
2019-12-05 17:14:16 -08:00
Barry McNamara
e1785d6723 Remove use of exceptions. 2019-12-05 15:56:55 -08:00
yhirose
033bc35723 Improve multipart content reader interface 2019-12-02 07:11:12 -05:00
yhirose
b69c0a1dcb Content receiver support for multipart content (Fix #241) 2019-12-01 22:04:26 -05:00
yhirose
295e4d58aa Fix #276 2019-11-29 17:07:51 -05:00
yhirose
6f58dc728f Fixed problem with requests with no content 2019-11-28 08:28:01 -05:00
yhirose
880f7fa62b Fix #273 2019-11-27 12:54:01 -05:00
yhirose
8f3dbf7f21 Code cleanup 2019-11-27 08:01:25 -05:00
yhirose
924a557fa3 Changed to use 'using' instead of 'typedef' 2019-11-27 07:03:17 -05:00
yhirose
d8da740597 Fix #270 2019-11-26 08:48:17 -05:00
yhirose
d45676b064 Added NoThread task queue 2019-11-25 13:00:37 -05:00
Hirose Family
94d13e88a5 Fixed regex problem with Apple LLVM version 8.0.0 2019-11-03 19:27:12 -05:00
Johan Jansen
a62a48a7b5 Modernize some additional code 2019-10-31 21:49:04 +01:00
Johan Jansen
c652919954 Do not use shared_ptr where not required 2019-10-31 21:48:48 +01:00
Johan Jansen
58753ba33c Fix some virtual override warnings 2019-10-31 21:38:37 +01:00
yhirose
5706828d2c Replace C-style arrays and fix static-code analysis warnings 2019-10-31 21:32:07 +01:00
yhirose
e743b8cd57 Fix #254 2019-10-30 08:21:59 -04:00
yhirose
9d57899352 Simplified ContentReceiver interface 2019-10-27 23:38:56 -04:00
yhirose
d03937e144 Content receiver support on server 2019-10-27 23:20:56 -04:00
yhirose
8fb37a449d Fix #251 2019-10-27 17:27:57 -04:00
yhirose
f0b1b5dbfd Added set_read_timeout. Fix #248. 2019-10-27 14:57:22 -04:00
yhirose
5f32c424c2 Content provider support on client 2019-10-25 18:39:04 -04:00
yhirose
f0683f2301 Fixed build errors 2019-10-25 13:11:49 -04:00
yhirose
0d527e2b83 Code formatting 2019-10-25 12:09:26 -04:00
yhirose
bea3ebd7af Added 'compress' option to POST, PUT and PATCH. 2019-10-25 11:46:12 -04:00
yhirose
380f725713 Code format 2019-10-24 22:20:42 -04:00
Bastien Durel
d1abf96581
html files may be .htm 2019-10-23 09:52:21 +02:00
yhirose
7a3abd2768
Merge pull request #243 from Sil3ntStorm/patch1
Allow use of OpenSSL 1.1.1, fix compile errors
2019-10-20 10:12:14 -04:00
Aaron Albers
89e1e9b8fe Added bind_to_port()
- This compliments the existing `bind_to_any_port()`
  where you can determine if the bind succeeded prior
  to calling `listen_after_bind()` but allows you to
  specify the port.
2019-10-19 10:41:19 -06:00
Sil3ntStorm
98d16eb836 Allow use of OpenSSL 1.1.1, fix compile errors 2019-10-19 16:40:06 +02:00
yhirose
dcdb0d047b Fixed PRI request problem 2019-10-03 13:44:18 -04:00
yhirose
1f86e41d97 Changed back to select as default 2019-10-03 13:44:18 -04:00
Johan Jansen
f23f9a06a9 Allow configuration to be overriden without source editing 2019-09-30 22:00:17 +02:00
Alin Gherman
224119a60a Retry in case of too many sockets opened instead of stopping the server. 2019-09-30 11:48:02 +02:00
yhirose
c02849e269 Removed CPPHTTPLIB_USE_POLL, added CPPHTTPLIB_USE_SELECT 2019-09-29 19:43:22 -04:00
yhirose
71979b1e88
Merge pull request #226 from Zefz/mingw-compile-fix
Fix compilation on Mingw-64
2019-09-27 17:29:33 -04:00
zefz
b14b7b0f8f Fix compilation on Mingw-64 2019-09-27 20:23:16 +02:00
Tang Huaizhe
9dbe0d855c Fix compile error in android ndk 2019-09-27 13:32:23 +08:00
Johan Jansen
94fc229c44 Add missing explicit const_cast 2019-09-26 22:20:33 +02:00
Johan Jansen
a7052cba22 Fix several -Wold-style-cast warnings in Clang-9 2019-09-26 22:03:18 +02:00
yhirose
c946eb7699 Fixed warnings on Windows 2019-09-26 08:13:20 -04:00
PolloLoco
c7f8561472 Added ssl_context member function to SSLClient in
order to allow access to the SSL_CTX struct, for
example to load the windows cert store
2019-09-18 15:10:15 +02:00
yhirose
4ab9270660 Use 'poll' as default instead of select (Fix #215) 2019-09-18 08:42:18 -04:00
yhirose
d599a36c2a Format code 2019-09-16 17:48:17 -04:00
yhirose
0c293887d0 Fixed problem with redirect 2019-09-15 09:15:21 -04:00
Steffen Schuemann
7e92ffec48 Added new Client::Get variant that combines a ContentReceiver with a new ResponseHandler
While trying to implement streaming of internet radio, where a ContentReceiver is needed to handle the audio data, I had the problem, that important information about the stream data is part of the HTTP header (e.g. size of audio chunks between meta data), so I added a ResponseHandler and a new Get variant, to gain access to the header before handling the first chunk of data.

The ResponseHandler can abort the request by returning false, in the same way as the ContentReceiver.

A test case was also added.
2019-09-14 14:55:12 +02:00
yhirose
c9238434e1 Added redirect support (Fix #211) 2019-09-06 18:07:35 -04:00
yhirose
e2babf315c Fixed build error on Windows 2019-09-05 13:22:44 -04:00
yhirose
c434d555bb Fixed problem caused by former changes 2019-09-03 17:19:58 -04:00
yhirose
80f040cf69 Fix #209 2019-09-03 17:10:04 -04:00
yhirose
037b4fc789 Fixed problem with keep-alive on client 2019-09-03 17:05:10 -04:00
yhirose
a782d1b609 Added OpenSSL version check. (Currently commented out) 2019-08-31 20:15:50 -04:00
yhirose
1e82359329 Keep-alive connection support on client (Fix #36) 2019-08-31 17:52:24 -04:00
yhirose
a4160e6ac1 Fix #212 2019-08-25 17:19:20 -04:00
yhirose
bdbfc6cfe7 Fix #210 2019-08-25 16:49:10 -04:00
yhirose
22615f9682 Fix #203 2019-08-07 06:34:24 -04:00
yhirose
64991a560a Fixed problems with Win32 build 2019-08-07 15:21:22 +09:00
yhirose
d7bb402ca7 Format code 2019-08-06 18:12:05 +09:00
yhirose
d58deddbcc Fixed #198 2019-08-06 18:10:41 +09:00
yhirose
3629f87627 Fixed thread pool problem. 2019-08-06 08:31:43 +09:00
yhirose
2823a94fc1 Added 'resource_releaser' for content provider 2019-08-05 09:40:23 +09:00
yhirose
f4aaba6362 Fixed warnings on Windows 2019-08-03 20:43:15 -04:00
yhirose
c899462e75 Added 'Content-Range' header for single range request 2019-08-03 22:12:24 +09:00
yhirose
9785cd47f2 Thread pool support 2019-08-03 16:39:39 +09:00
yhirose
579ff1a0a6 new_task_queue support 2019-08-03 13:15:05 +09:00
yhirose
47312e6df9 Added TaskQueue interface 2019-08-03 12:11:22 +09:00
yhirose
66b81a1497 Code cleanup 2019-08-03 10:47:48 +09:00
yhirose
9d7b717504 Range header support and redesign of content provider interface 2019-08-03 03:28:39 +09:00
yhirose
58f72bc8b6 Code cleanup 2019-07-29 14:24:40 -04:00
yhirose
4c58b91e40 Added additonal status messages 2019-07-29 09:47:50 -04:00
yhirose
06b3dee5aa Code cleanup 2019-07-28 19:12:44 -04:00
yhirose
d15df874b3 Code cleanup 2019-07-28 07:52:57 -04:00
yhirose
f40de531ab Fix #196 2019-07-26 14:39:09 -04:00
yhirose
cb11d9412e Fixed connection end problem with HTTP/1.0 client 2019-07-24 06:53:48 -04:00
yhirose
34651ef89b Fix #121 2019-07-23 09:53:44 -04:00
yhirose
dd20e4d418 Fixed build errors 2019-07-22 06:58:05 -04:00
yhirose
7267b3f3e2 Write error handling 2019-07-21 21:34:49 -04:00
yhirose
4c18ac2b18 Added locking_callback for OpenSSL versions prior to 1.1.0 2019-07-19 17:03:47 -04:00
yhirose
eaafa5d55c Fix #127 2019-07-19 11:38:06 -04:00
yhirose
3d1ae3a3af Code cleanup 2019-07-17 23:50:47 -04:00
yhirose
6f663028e9 Fix #139. Content receiver support 2019-07-17 22:00:18 -04:00
yhirose
31cdadc4b1 Added check code to compress and decompress 2019-07-17 19:00:35 -04:00
yhirose
849add5887 Code cleanup 2019-07-17 15:09:41 -04:00
yhirose
fccb84f5e8 Refactoring for reading content 2019-07-17 08:56:49 -04:00
Jasper van de Ven
2fdc41c323 Made svr_sock_ and is_running_ variables atomic 2019-07-05 11:03:23 +02:00
yhirose
74e9a0d17e Fix #182 2019-07-03 10:52:24 -04:00
yhirose
bb537d93fe Added CPPHTTPLIB_RECV_BUFSIZ 2019-06-29 20:39:18 -04:00
yhirose
bde3fd9f78 Improved performance of read_content_without_length 2019-06-29 20:25:16 -04:00
yhirose
2aa35d5f53 Fix #179 2019-06-28 12:08:47 -04:00
yhirose
5377c86da9 clangformat 2019-06-20 19:17:59 -04:00
yhirose
1981e0ccad Add SSL object on Request 2019-06-20 18:52:28 -04:00
yhirose
866b6967a0 Fixed memory leak 2019-06-20 17:37:18 -04:00
yhirose
6d74fa86be Fix #164 2019-06-20 17:11:44 -04:00
yhirose
b5c79bf146 Fix #160 2019-06-20 15:00:22 -04:00
yhirose
4f4e6f2140 Use 'inline' 2019-06-20 12:43:17 -04:00
yhirose
a28e3620a2 Fix #173 2019-06-20 11:45:11 -04:00
yhirose
4a857511e2 fix #168 2019-06-17 11:33:43 -04:00
yhirose
8d12e0d8f4 Simplified code 2019-06-11 21:39:35 -04:00
yhirose
07d9843b91 clangformat 2019-06-11 20:57:02 -04:00
yhirose
92f08b54c4
Merge pull request #162 from PixlRainbow/master
client certificates support
2019-06-11 20:53:56 -04:00
PixlRainbow
60e0286cfb rename certificate parameter to reduce confusion 2019-06-06 23:52:33 +08:00
PixlRainbow
628b1115ea remove requirement for trusted_cert_path 2019-06-06 23:34:24 +08:00
PixlRainbow
57f61bf80e client-side support for client certificates 2019-06-06 01:16:47 +08:00
PixlRainbow
6bb05c5483 support certificates signed by intermediate CA 2019-06-05 19:44:37 +08:00
yhirose
6f207497de Fixed #150 2019-06-04 22:53:37 -04:00
PixlRainbow
d630c116df server-side support for client certificates 2019-06-05 02:21:37 +08:00
Yuji Hirose
48af26e332 Fixed resource leaks 2019-06-03 11:06:59 -04:00
Yuji Hirose
d4936a2c78 Fixed #155 2019-05-31 10:30:11 -04:00
Hans Erickson
f3f4ab8499 Add encode_url() call to Client class when adding parameter values. 2019-05-20 09:48:06 -05:00
Mark Nelson
e623dfedf3
Update httplib.h
CPPHTTPLIB_PAYLOAD_MAX_LENGTH is only used in one place, that is to initialize payload_max_length_. Because payload_max_length_ is a size_t, attempts to intialize it with a 64 bit integer max will generate warnings, notably on 32 bit compilers. Changing the max to the same size as the target resolves that, and this should be no risk.
2019-05-14 16:17:41 -04:00
yhirose
dfc94f2cab Code cleanup 2019-05-07 21:46:15 -04:00
yhirose
3f42804a4f Wildcard support for verifying server certificate. fix #87 2019-05-07 21:40:03 -04:00
yhirose
82193b9489 Code clieanup 2019-05-07 20:11:45 -04:00
yhirose
097c61b871 Comment out debug print 2019-05-07 16:57:27 -04:00
yhirose
b08e22ab00 Changed the server certificate verification API 2019-05-07 16:54:51 -04:00
yhirose
03a577cccd Fixed huge payload problem on Windows 2019-05-07 16:41:50 -04:00
yhirose
0bd9737c88 Fix #87 2019-05-07 16:41:33 -04:00
yhirose
dd901126a7 Fix #146 2019-05-05 13:31:42 -04:00
yhirose
744e8e7071 Fix #144 2019-04-12 23:34:27 -04:00
yhirose
8af85019dc Removed get_header_value_int and use uint64_t for the return value of get_header_value_uint64 2019-04-12 17:22:39 -04:00
Manny
07ed076499
BUGFIX: crash when "content-length" > max_int 2019-04-12 12:16:32 +02:00
Yuji Hirose
5d082f1da4 Apply clangformat 2019-04-11 08:13:31 -04:00
yhirose
a91a0b7dbf Fix #140 2019-04-10 12:21:42 -04:00
yhirose
8483e5931f Fix #136 2019-03-28 19:56:32 -04:00
batist73
90e699161a Add WinSock2 dependency 2019-03-27 19:55:06 +03:00
Yuji Hirose
96cacd24f9 Fixed #134 2019-03-12 08:49:08 -04:00
archivaldo
c5264cea9c Fix coding style 2019-03-07 19:03:18 -03:00
archivaldo
dedcc43216 small fix to allow fronting 2019-03-07 16:40:19 -03:00
Whitetiger
787761a7bf
Fix build error with Boost::asio 2019-02-25 13:09:31 -05:00
Geraldo Intmain
774c27e690 Encoding LF and CR 2019-02-24 17:15:27 -03:00
yhirose
7b3f6db70b Fix #128 2019-02-22 08:52:38 -05:00
Yuji Hirose
d3eb88b740 Fix #126 2019-02-13 08:14:58 -05:00
Constantin
28ad0ca68d
Fixed #124 2019-01-30 12:12:47 +09:00
yhirose
a72eef7fb4 Fixed #123 2019-01-29 12:05:32 -05:00
yhirose
8d908fadb6 Fixed #120 2019-01-15 08:08:34 -05:00
yhirose
b5927aec12 fix #116 2018-12-17 21:07:38 -05:00
yhirose
d0090b158f fix #112 2018-12-13 19:37:44 -05:00
yhirose
86b3dfc480 fix #110 2018-11-30 21:18:35 -05:00
yhirose
5ad4311fb0 fix #109 2018-11-22 20:50:54 -05:00
Geraldo Intmain
c4f9062552 Encode space and plus characters 2018-10-29 20:46:11 -03:00
yhirose
49c82c9c50 Fix #97. (Thanks to DJm00n.) 2018-10-28 16:15:22 +09:00
Duncan Ogilvie
d0c5c66bd6
Fix undefined behavior + make some ifdefs more readable 2018-10-14 12:39:51 +02:00
yhirose
d32eee7627 Fix #96 2018-09-30 08:40:31 -04:00
yhirose
abf79d5a38 Code cleanup 2018-09-23 12:32:26 -04:00
yhirose
4d7cee81eb Fix #95 2018-09-23 12:02:17 -04:00
Duncan Ogilvie
bc16283a2f Change size_t to time_t where applicable 2018-08-17 11:51:41 +02:00
Thomas Tissot
82fc7d5591 Request cancelation feature
This commit modifies the signature of the `Progress` callback
so that its return value will indicate whether the request shall
continue to be processed by returning `true`, or if it shall
be aborted by returning `false`. Such modification will allow
one to cancel an ongoing request before it has completed.

When migrating, developers should modify there `Progress`
callbacks to always return `true` by default in case there
do not want to benefit from the cancelation feature.

A few unit tests use cases were provided, but anyone should feel
free to provide additional uses cases that they find relevant.
2018-08-06 11:54:52 +02:00
yhirose
f2daaf1b85
Merge pull request #85 from davidgfnet/streaming
Implementing streaming Responses
2018-08-01 17:56:09 -04:00
David Guillen Fandos
dae4124039 Implementing streaming Responses
This enables a much easier handling of big queries after all.
2018-08-01 23:53:01 +02:00
yhirose
07910f73a9 Fixed problem that listen may return incorrect value when calling stop; 2018-07-31 19:46:04 -04:00
Maksim Kolinichenko
15ed1b4883 Add Keep-Alive header to response 2018-07-27 17:39:04 +03:00
Maksim Kolinichenko
d26ee03613 Fixed request parsing regex typo 2018-07-27 17:26:14 +03:00
Albert S
d9479bc0b1 Fixed bound checks for #74 2018-06-02 08:40:19 +02:00
yhirose
890025e347
Merge pull request #75 from crtxcr/http_response_codes
More status messages for http codes
2018-06-01 23:07:14 -04:00
yhirose
2bb27aa25d Fix #74 2018-06-01 23:05:32 -04:00
Albert S
bb2f96afeb Added a few more common http status codes 2018-06-01 14:34:58 +02:00
yhirose
5b3187e2f9 Fix #72 2018-05-31 22:17:23 -04:00
yhirose
5a78e1c457 Added 'set_keep_alive_max_count' method on Server 2018-05-31 19:01:24 -04:00
Scott Graham
f275352cba Handle port==0 when socket is bound on ipv6
I discovered
0515c6aad6
doesn't work when the server is bound on an AF_INET6 address on Windows
due to the getsockname() call failing.
2018-05-29 12:59:13 -07:00
yhirose
7b9d752583 Fixed problem with connection close 2018-05-14 00:05:14 -04:00
yhirose
312a8d7523 Removed HTTP version. It's now always 'HTTP/1.1'. 2018-05-13 19:18:25 -04:00
yhirose
37130cd7f9 Changed to use INVALID_SOCKET 2018-05-10 23:56:24 -04:00
Joshua Peraza
75285e8713 Define and use kInvalidSocket 2018-05-09 16:28:39 -07:00
yhirose
6c5d0b2a18 Fix #57 and #62 2018-05-08 21:51:41 -04:00
Enzo AGUADO
911e620a54 don't include sys/select on windows 2018-05-07 16:59:08 +08:00
Enzo AGUADO
632df52b4f add sys/select.h for musl libc 2018-05-07 02:15:12 +08:00
yhirose
3eff00bbc8 Fix #60 2018-04-29 18:20:38 -04:00
adikabintang
ef5c4144d7 add keyword inline to some function definitions to avoid linking error 2018-04-26 12:07:44 +07:00
yhirose
6aa3fd6b59 Fix #38 2018-04-20 09:59:19 -04:00
yhirose
755f05c02b Removed global mutex 2018-04-20 09:37:59 -04:00
yhirose
5574d82eb3 Made a temporary fix for OpenSSL thread problem 2018-04-20 00:17:51 -04:00
Scott Graham
889041f05f Don't fail chunked read if buffer not yet filled 2018-04-17 22:05:38 -07:00
yhirose
956faae6f0 Changed output type of read_content_??? functions to be std::string& 2018-04-17 23:47:24 -04:00
yhirose
b6df220b55 Fixed #48 2018-04-17 13:10:05 -04:00
yhirose
bc051219f9 Removed is_handling_requests 2018-04-17 13:10:05 -04:00
Scott Graham
ca3613cd21 Make 'chunked' in Transfer-Encoding case-insensitive 2018-04-16 21:43:41 -07:00
yhirose
9dc4e23082 Unit test for #52 2018-04-17 00:05:05 -04:00
yhirose
3c711089e5 Temporary solution for #52 2018-04-16 22:12:45 -04:00
yhirose
66550eb71b Changed to return 415 instead of 406 for invalid Content-Encoding. 2018-04-16 21:02:24 -04:00
yhirose
ebe40a7d94
Merge pull request #50 from sgraham/body-decompress
Support Content-Encoding: gzip on server side
2018-04-16 20:54:25 -04:00
Scott Graham
5579d4d101 Support Content-Encoding: gzip on server side
If the client specifies Content-Encoding: gzip for POST requests,
decompress the body before attempting to parse it.
2018-04-16 15:16:17 -07:00
yhirose
4ddd5d9c5c
Merge pull request #51 from sgraham/chunk-terminator
Read \r\n terminator after chunked encoding
2018-04-16 17:43:12 -04:00
Scott Graham
87c673fd67 Read \r\n terminator after chunked encoding 2018-04-16 10:28:59 -07:00
Scott Graham
0515c6aad6 Support system-assigned port via two part listen()
This fixes #46 by allowing the user to separate the port bind from the
blocking listen(). Two new API functions bind_to_any_port() (which
returns the system-assigned port) and listen_after_bind() are equivalent
to the existing listen().
2018-04-16 08:23:41 -07:00
yhirose
0e239a0014 Fix #47 2018-04-14 18:42:56 -04:00
yhirose
5536d4c1ff Fix #44 2018-04-06 17:02:37 -04:00
yhirose
b6790b39c1 Fixed build problem with OPENSSL_SUPPORT 2018-03-13 22:44:28 -04:00
Kevin B. Carpenter
73fa115803 Added capture and setting of REMOTE_ADDR in request. 2018-03-06 08:20:51 -07:00
yhirose
b7b3588afb Connection timeout support on Client (Fixed #34) 2018-01-04 20:35:58 -05:00
yhirose
1d5fbe6a5b Add gzip support. resolved #11 2017-12-30 00:00:43 -05:00
yhirose
1c86540fe5 Fixed content-type problems 2017-12-22 23:16:28 -05:00
yhirose
23c8f0c738 Fixed #28. (Keep-Alive connection support) 2017-12-20 17:32:15 -05:00
yhirose
a83dcefe86 Fixed SSL server problem with bad key.pem and cert.pem 2017-12-17 22:23:05 -05:00
yhirose
95b22a980a Fixed #35 2017-12-16 19:07:58 -05:00
yhirose
38bbe4ec4c Removed automatic inclution of <openssl/ssl.h> with '__has_incude' 2017-12-16 18:40:35 -05:00
yhirose
7e5db48bdf Fixed #33 2017-12-12 22:20:40 -05:00
yhirose
c76d0e4ab3 Allow leading and trailing whilespaces before/after header field values 2017-12-10 22:42:11 -05:00
yhirose
31e53d21e4 Fixed #32 2017-12-10 22:34:37 -05:00
yhirose
459f197ed0 Fixed #30 2017-12-10 15:11:03 -05:00
yhirose
cca90184aa Raname refactoring 2017-12-09 16:45:40 -05:00
yhirose
e557282641 Rename argument name 2017-12-07 13:19:03 -05:00
yhirose
f35f2b23fa Fixed problems with Visual Studio 2013 2017-12-07 13:10:20 -05:00
yhirose
0968d71c96 Fixed build problems on Msys2 2017-12-07 08:28:06 -05:00
yhirose
929c546f17 Fixed #29 2017-12-07 00:20:59 -05:00
yhirose
6a608b3ed4 Fixed Unit test failures on Windows 2017-12-07 00:05:43 -05:00
yhirose
315c11d6e2 Implemented socket_reader 2017-12-06 23:52:34 -05:00
yhirose
c3346a4815 Changed to use std::multimap for params 2017-12-05 23:19:39 -05:00
yhirose
bb8a1df7a3 Fixed #21 2017-12-05 19:19:07 -05:00
yhirose
ea9c8ee46b Fixed build error 2017-12-05 19:15:52 -05:00
yhirose
4fb2f51766 Fixed #19 2017-12-03 22:31:00 -05:00
yhirose
9bc2883090 Fixed #26 2017-12-03 21:25:38 -05:00
yhirose
e90244e992 Fixed compiler warings (with -Wall and -Wextra) 2017-12-03 08:17:05 -05:00
yhirose
28ba178fee Fixed #27 2017-12-02 10:24:41 -05:00
yhirose
90f9cd40f9 Fixed #3 2017-11-25 22:32:09 -05:00
yhirose
1e3ef46862 Changed to return 'Server&' from 'get' and 'post' 2017-11-25 11:58:09 -05:00
yhirose
ad5fba498e
Merge pull request #23 from underscorediscovery/progress-callback
add progress callback for http clients
2017-11-24 20:37:31 -05:00
underscorediscovery
45d79d163b add progress callback for http clients 2017-11-22 13:01:19 -03:30
underscorediscovery
7c9f9c4a73 shield windows defines, in case they are already defined 2017-11-22 12:37:59 -03:30
yhirose
bd089e9499 Fixed #18 2017-11-06 13:25:11 -05:00
Constantin
57af6277b8 Update httplib.h
If no "Content-Length" is sent in the response-header the body is always empty #16
2017-09-11 10:58:17 +09:00
yhirose
bfb7f7bb78 Fixed #15 2017-09-08 12:59:00 -04:00
yhirose
2a45bdcd3b Fixed #14 2017-09-07 14:45:02 -04:00
Curtis Mahieu
8821ab5997 Allow user to set socket flags for server creation to allow listening to incomming traffic on any connection 2017-08-29 10:20:20 -07:00
Dmitry Romanov
ce59fc6a87 Add #include <signal.h> so it compiles on linux 2017-07-07 12:43:57 -04:00
yhirose
e4ef0828b0 Ignore SIGPIPE 2017-07-06 22:04:59 -04:00
yhirose
ddb454da1b Fixed #7 2017-06-28 20:12:11 -04:00
yhirose
6d01712fc7 Fixed #6 2017-06-28 19:48:26 -04:00
yhirose
f3eb1c4e00 Supported more MIME types. 2017-05-14 00:46:40 -04:00
yhirose
5873e360a6 Fixed typo. 2017-05-13 23:44:37 -04:00
yhirose
d999941a78 Renamved 'url' to 'path'. 2017-05-13 23:43:29 -04:00
yhirose
ba1107541e Use BIO for SSL connection. 2017-05-13 23:43:09 -04:00
yhirose
22f124f871 Added OpenSSL support. #5 2017-04-21 23:13:30 -04:00
Cameron Esfahani
6a50f13209 Fixed signed/unsigned comparison warning. 2017-03-09 00:34:30 -08:00
Yuji Hirose
902bf3d0eb Removed 'FILE' I/O, use socket directly. 2016-09-16 16:12:52 -04:00
Hirose
d0759eb4eb Fixed socket close problem with VC 2015. 2016-09-06 18:35:03 -04:00
yhirose
969744bfeb Code cleanup 2016-03-04 16:49:15 -05:00
yhirose
29c56644b0 Visual Studio 2015 support. 2015-08-04 18:13:39 -04:00
yhirose
5b0c90d3b3 Fixed build problem on Raspberry PI. 2015-07-16 20:26:26 -04:00
yhirose
1ee29f7b2c Format cleanup. 2015-07-15 16:41:11 -04:00
yhirose
123edd5a29 Added 'const char*' version of set_content. 2015-07-15 16:40:40 -04:00
yhirose
3b85d6e4e8 Fixed problem with content length 0. 2015-07-15 16:39:57 -04:00
yhirose
cb473e8534 Fixed decode problem with form-urlencoded data. 2015-07-13 15:42:21 -04:00
yhirose
62f824e204 Fixed problem with reading request body data. 2015-07-12 22:54:03 -04:00
yhirose
79bb0be0ca Fixed close problem win _open_oshandle on Windows. 2015-01-27 16:45:11 -05:00
yhirose
efc579b14e Changed to use getaddrinfo. 2015-01-14 18:51:53 -05:00
yhirose
20fa4ba3b4 added return value to set_base_dir. 2013-07-04 22:08:06 -04:00
yhirose
eef74af19b static file support. vc12 support. 2013-07-04 18:18:52 -04:00
yhirose
a9b34615c7 Fixed file pointer leak. 2013-06-07 19:15:25 -04:00
yhirose
9c7cd1af71 Changed to use more c++11 features. 2013-05-11 16:11:30 -04:00
yhirose
a1ef364247 Changed to use c++11 features. 2013-04-24 06:09:19 -04:00
yhirose
e7e8f5e70e Changed to use 'auto'. 2012-11-07 20:54:39 -05:00
yhirose
767ed02280 Added WSInit class to initialize WinSock2. 2012-11-07 20:54:04 -05:00
yhirose
1b2f37e241 Made Response argument 'const'. 2012-10-12 21:40:07 -04:00
yhirose
b5ae7d0e7a Added HEAD method support. 2012-10-12 17:41:58 -04:00
yhirose
e8a18ad447 Removed Connection class. 2012-10-12 16:09:39 -04:00
yhirose
44a682cd3e Fixed URL encoding problem with space. 2012-10-12 00:01:56 -04:00
yhirose
3b3828aaff Fixed unit test. Added URL encoding. 2012-10-11 23:52:34 -04:00
yhirose
6062ea592b Refactoring. Removed some client methods. 2012-10-05 13:58:56 -04:00
yhirose
3c8c835489 Added client methods with shared pointer to Response. 2012-10-04 01:18:18 -04:00
yhirose
d187cdef50 Fixed problem with closing socket. 2012-10-04 00:52:12 -04:00
yhirose
1d0b3504bd Refactoring. 2012-10-04 00:38:32 -04:00
yhirose
e0a25745cf Added post method support. 2012-10-03 23:47:59 -04:00
yhirose
ffde8b7e4b Refactoring. 2012-10-03 21:55:01 -04:00
yhirose
aa75fbb5f9 Refactoring. 2012-10-03 20:11:22 -04:00
yhirose
f91cc98b89 Changed return type of client. 2012-10-02 23:24:23 -04:00
yhirose
42473b722f Code refactoring. 2012-10-02 22:37:14 -04:00
yhirose
762e7938fd Added client. 2012-10-02 20:39:13 -04:00
yhirose
ced9c38339 Renamed Context to Connection. Removed DSL macro. 2012-09-28 18:31:03 -04:00
yhirose
6897c64c74 Renamed project name to 'cpp-httplib'. 2012-09-27 21:05:36 -04:00