Граф коммитов

1991 Коммитов

Автор SHA1 Сообщение Дата
Ivan Cherniukh 708a5df2bb Add support for oauth2 using only client credentials 2020-09-09 09:09:04 -07:00
Billy O'Neal 7fbb08c491
Delete apparently broken .vcxprojs and .pfxes. (#1415) 2020-05-10 16:29:07 -07:00
Billy O'Neal 18212a2a79
Mint v2.10.16. (#1395) 2020-04-24 17:44:16 -07:00
Clovis Durand 319dd31f7b
CMake fixes + CMake search for OpenSSL (macOS) (#1383)
Signed-off-by: Clovis Durand <cd.clovel19@gmail.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2020-04-24 16:53:50 -07:00
Wolfgang Stöggl b07011d3ab
Update submodule websocketpp to 0.8.2 (#1392)
* Update submodule websocketpp to 0.8.2

- Update to WebSocket++/0.8.2
  commit 56123c87598f8b1dd471be83ca841ceae07f95ba
- Fixes build issues with boost 1.70 and newer

* Update vcpkg.

* Remove defunct VS2015 configurations.

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2020-04-23 19:13:27 -07:00
Gareth Sylvester-Bradley 538dd497bc
Do not report errors (such as EBADF and EINVAL) from setsockopt here, since this is a performance optimization only, and hard errors will be picked up by the following operation (#1393) 2020-04-23 16:51:31 -07:00
Gareth Sylvester-Bradley e18f6f2f90
Fix compilation with GCC 4.8/4.9, which was broken by commit 53fab3aa12. (#1379) 2020-04-23 16:50:54 -07:00
Gareth Sylvester-Bradley f4124a9ee1
Add support for HTTP redirection in ASIO and WinHTTP-based http_clients (#1328) 2020-03-31 21:57:39 -07:00
Gareth Sylvester-Bradley 1d7550f5d4
Fix more http test build fails in certain configurations (#1332) 2020-03-31 16:22:47 -07:00
Gareth Sylvester-Bradley 6d0e2b73af
Remove redundant std::move noted by gcc 9.2 (-Wredundant-move) (#1370) 2020-03-31 16:21:51 -07:00
Dmitry Tsarevich 927afad909
Static analyzer (PVS Studio) fixes (#1372)
* [init] Initialize stream mode to in by default

* [leak] Fix memory leak of server api ptr

Should call delete on pointer instead of releasing it to the caller.

* [macro] Ensure priority of macro computation

Enclose macro args in round brackets to ensure operators priority.

* [prep] Fix comment after preprocessor macro

* [ub] Use typed pointer in delete operation

* Delete of void pointer is UB.  See section 5.3.5/3.  SO question:
https://stackoverflow.com/questions/941832/is-it-safe-to-delete-a-void-pointer
* Windows APIs used here return FALSE in case of failure, and
non-FALSE on success.  There is no info in spec that only TRUE
value indicates success.  Correct way to implement check for
success call is to compare with false like result != FALSE.

* [fmt] Fix military RFC1123 time format parsing

Ensure + or - sign is used for time zone offset in RFC1123 military
time format.

* Remove redundant != FALSE.

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2020-03-31 16:02:07 -07:00
Gareth Sylvester-Bradley cdae258bfb
[#1349] Expose json::value::parse for UTF8 string on Windows (#1350) 2020-03-02 15:00:16 -08:00
Fabrice Fontaine cb7ca74e5f
libcpprestsdk: fix building as a static library (#1344)
On Unix, try to use pkg-config to find OpenSSL. This will automatically
find any dependent libraries and put them in the correct order for
linking. If pkg-config is not available or system is not UNIX, fallback
on current mechanism

Signed-off-by: Adam Duskett <aduskett@gmail.com>
[Retrieved (and slightly updated) from:
https://git.buildroot.net/buildroot/tree/package/libcpprestsdk/0001-libcpprestsdk-fix-building-as-a-static-library.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-03-02 14:51:12 -08:00
Billy O'Neal b94bc32ff8
Mint v2.10.15. (#1336) 2020-02-23 20:33:51 -08:00
Billy O'Neal 0886fcc138
Fix tcp::resolver data race in the asio backend and be defensive against empty results (#1339)
* Move TCP resolver to asio_context rather than asio_client, as that type is not safe to touch from multiple threads.

* Defend against empty responses from async_resolve.

Co-authored-by: Jinming Hu jinming.hu@microsoft.com
2020-02-23 10:51:19 -08:00
VZ 43f6f3424f
Use C++11 synchronization classes under macOS too (#1342)
There doesn't seem to be any reason to prefer using Boost libraries to
standard C++ classes under macOS, so use the latter ones unconditionally
on this platform too, just as it was already done for the other Unix
systems.

This notably avoids dependencies on the compiled Boost libraries, which
don't have to be compiled before building C++ REST SDK any more.
2020-02-23 09:38:17 -08:00
Arkady Shapkin 1f97f54652
Enable HTTP compression support on all platforms (#1322) 2020-02-21 11:56:35 -08:00
Gareth Sylvester-Bradley f43bf646de
Add TCP_NODELAY to disable Nagle's algorithm in Boost.ASIO-based http_client (#1310)
* Add TCP_NODELAY to disable Nagle's algorithm to avoid waiting for ACK for HTTP request headers before transmitting the request body, in order to significantly improve performance for requests with bodies (see #1201)

* Also add TCP_NODELAY on the server-side, to disable Nagle's algorithm to avoid waiting for ACK for HTTP response headers before transmitting the response body (see #1201)
2020-02-19 18:00:34 -08:00
Gareth Sylvester-Bradley a835bfac35
Use LC_ALL_MASK rather than LC_ALL when calling newlocale (#1330)
Resolves #1329 as @jason-ha suggests
2020-02-19 17:18:56 -08:00
Gianfranco Costamagna feb0755637
Change default installation directory for cmake files to cmake/cpprestsdk (#1306) 2020-02-19 16:38:05 -08:00
Billy O'Neal 40dad5c674
Update vcpkg and boost on Android (#1334)
* websocketpp appears a lost cause, disable websockets for Android

Also fixes #1333 as a drive-by :)
2020-02-19 16:16:23 -08:00
Gavin Halliday 96e7d20e39 Fix various warnings reported by gcc 9.3, and possibly earlier versions (#1289)
Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
2019-12-19 13:10:21 -08:00
Jonathan Saylor 53dcf8b34f Added comparison overrides to utility::datetime (#1276)
I was trying to compare timestamps and noticed that the code doesn't support this so std::max and std::min don't work with datetime timestamps. I've added less/greater/less-or-equal/greater-or-equal operators.
2019-12-18 16:14:04 -08:00
Gareth Sylvester-Bradley e7c6b08b88 Fix test case broken by commit f4c863bcf5 (#1288) 2019-12-18 16:13:30 -08:00
Billy O'Neal c9f91156e3
Update vcpkg and remove tests that look for web servers that no longer exist (#1293) 2019-12-18 13:41:42 -08:00
Gareth Sylvester-Bradley 7e50b51339 http_server_httpsys.cpp requires linking against httpapi.lib, http_client_winhttp.cpp does not. (#1253) 2019-10-28 18:40:35 -07:00
Sinan Kaya f4c863bcf5 Support for WinHTTPAL curl-to-WinHTTP adapter (#1182) 2019-09-27 16:27:44 -07:00
Billy O'Neal c4f37e7a04
Avoid using permissive- with ZW which breaks VS2019 (#1248)
* Also add VS2019 configurations to Azure Pipelines.
* Also turn on vcpkg caching from @lukka
2019-09-27 14:08:02 -07:00
Billy O'Neal ce96a318b1
Trim whitespace and nulls the same way. (#1233) 2019-08-28 12:39:31 -07:00
Michael Khlopin 2a8c17e7bb Fixing of connections_and_errors::cancel_with_error test which sometimes fires false positive error "There are no pending calls to next_request." (#1196) 2019-08-22 19:36:07 -07:00
Gareth Sylvester-Bradley f7065f48a3 Fix "Data" to "Date" in the HTTP Server API mapping, and clarify that the indices of these values match the HTTP_HEADER_ID values for HTTP_REQUEST_HEADERS but *not* HTTP_RESPONSE_HEADERS (#1219) 2019-08-22 19:34:39 -07:00
Jason Hartman 265d681743 fix SxS debug-release builds with Visual Studio (#1220)
* On basic_string_view_support: fix SxS debug-release builds with Visual Studio
place precompiled header implicitly in Debug/Release path with VS and explicitly in bin dir otherwise
standardize pch setup across libraries with helper function

* nudge pipeline to rerun
2019-08-22 19:33:30 -07:00
Gareth Sylvester-Bradley 44c491889d Workarounds for two GCC 4.7.2 bugs with lambda functions (#1209)
* Workarounds for two GCC 4.7.2 bugs with lambda functions using implicit this, surfacing as incorrect const-qualification and an internal compiler error. Resolves immediate issues identified in #1200.

* Restore compatibility with modern compilers
2019-08-02 12:27:46 -07:00
Gareth Sylvester-Bradley a40a28610d Missed one defence against no NOMINMAX in bed8fa538c. (#1202) 2019-07-23 10:54:40 -07:00
Billy O'Neal 6f602bee67
Mint v2.10.14. (#1193) 2019-07-16 12:07:11 -07:00
Billy O'Neal 60e067e71a
Remove proxy settings detection behavior in "default proxy mode." (#1188)
* Remove proxy settings detection behavior in "default proxy mode."

This commit partially reverts eb108ada1a in order to work around a reliability problem with WinHttpGetProxyForUrl. That function hangs unless there is an available thread pool thread to complete the WPAD request. As a result, if a customer issued ~512 concurrent HTTP requests, or otherwise needed that many thread pool threads, there would not be a thread available for WinHTTP to complete the operation, and the program would deadlock.

Moreover this call to WinHttpGetDefaultProxyConfiguration is extremely expensive, taking ~20% of overall CPU for the entire program for some Azure Storage SDK customers.

The function WinHttpGetProxyForUrlEx is supposed to help with this problem by being asynchronous, but that function was added in Windows 8, so we can't use it unconditionally. And on Windows 8.1 we already are using WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY instead of trying to do proxy autodetect ourselves.
2019-07-16 07:55:55 -07:00
Billy O'Neal bed8fa538c
Replace CPPREST_TARGET_XP with version checks, remove ""s, and other cleanup (#1187)
* Audit for "" and use std::string default ctor instead.

* Fix Linux ambiguity.

* Exclude common build directories.

* Replace CPPREST_TARGET_XP with checks against _WIN32_WINNT to allow more fine grained controls going forward (e.g. assume Win10).

Also fix a few typos.

* Delete CASABLANCA_UNREFERENCED_PARAMETER and attempt Linux compile fix.

* Defend NOMINMAX.

* Another _WIN32 guard.

* With && this time.

* Fix more spelling errors.

* Optimize trim_nulls slightly.

* And actually make the optimization correct this time.

* Fix unit test failure.

* clang-format
2019-07-12 18:05:14 -07:00
Billy O'Neal a718c5bcf4
Remove invalid nondependent static assert (#1186)
* Remove invalid static_assert(false).

* Turn on permissive-.

* clang-format
2019-07-12 16:27:44 -07:00
Billy O'Neal 951e269923
Fix profile being set on the compiler instead of the linker. (#1184) 2019-07-11 18:59:47 -07:00
René Meusel 47cd408966 FIX: SSL proxy tunnel support with basic auth (#1183) 2019-07-11 18:16:57 -07:00
dejaniv 06aeb8ea9f Fix issue #1171: Order of object destruction (#1175)
- Connection object is now destroyed before client object
- Client is destroyed only when wspp_callback_client is destroyed to prevent race condition with the destructor
2019-07-11 18:15:21 -07:00
VZ 5b32e16f5e Fix reusing ASIO http_client connecting to HTTPS server via proxy (#539)
Calling request() twice on the same client configured to connect to a
server via HTTPS didn't work under Unix because we issues CONNECT for
every request, meaning that, for the second one, we sent CONNECT via an
already established connection to the end server itself which,
unsurprisingly, didn't work at all.

Fix this by only setting up SSL tunnelling for a new connection but not
for the already used one.
2019-06-13 12:41:11 -07:00
Kumamon38 0f45af1513 add ping and pong to message handler (#1143)
Add ping and pong to message handler, and optional pong timeout
2019-06-13 12:40:00 -07:00
Robert Hancock 36e030a5ed Remove the address_configured flag on tcp::resolver::query (#1145)
The default behavior for tcp::resolver::query uses the
address_configured flag, which only returns addresses if a non-loopback
address is available on the system. If this is called before a real network
interface is brought up, then resolution will fail and the server won't
be functional, even for requests on the loopback interface.

Explicitly set the flags to default so that the address_configured flag
is not specified. This allows the server to start up normally even when
the system has no active network interfaces.
2019-06-13 12:39:12 -07:00
Bryan Lipinski be807d42c2 Use EVP_MAX_MD_SIZE instead of HMAC_MAX_MD_CBLOCK (#1155) 2019-06-12 20:11:29 -07:00
Bryan Lipinski ce50b8cd9d Undefine compress if it is defined by zconf.h (#1150) 2019-06-10 13:45:33 -07:00
Gareth Sylvester-Bradley e037858d62 json: {"meow"} is not a valid object (#1130)
* json: {"meow"} is not a valid object

* Add to contributors - eighteenth PR seemed like the time! :-)
2019-05-07 10:43:33 -07:00
Billy O'Neal 7536ae5799
Add switches to make apiscan happy. (#1133) 2019-05-07 10:37:14 -07:00
Billy O'Neal 9d8f544001
Mint v2.10.13. (#1122) 2019-04-24 22:16:37 -07:00
Billy O'Neal 7c8f6241f5
Fix off by one error in leap years before year 2000, and bad day names (#1120) 2019-04-23 20:52:41 -07:00