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>
* 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
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.
* 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)
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.
* 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
* 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
* 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.
* 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
* Update boost-for-android for Android NDK r20.
* Also disable homebrew.
* I mean homebrew I said!
* Apparently Android isn't ready for Boost 1.70 yet.
- 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
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.
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.
* Update vcpkg.
* Attempt to fix Ubuntu apt and update MacOS.
* Workaround Azure Pipelines forcing an updated copy of boost that doesn't work with default Ubuntu libs.
* Add test runs back.
* Update boost-for-android and block Boost 1.69 on the image.
* Update boost and openssl on iOS.
* Use right path to test binaries.
* Shut off iOS builds.
Update date formatting and parsing to accept all years between 1900 and 9999.
This unblocks the Azure Storage SDK which uses 9999-12-31 as a sentinel value for "no expiration time" which was broken by the locale insensitive date formatting's dependence on _mkgmtime, with its 1970-3000 range. By morally reimplementing _mkgmtime, this change also lets us remove the Android workaround of changing the TZ environment variable.
Release\tests\functional\utils\datetime.cpp
Turn on tests for values that would need 64 bits represented as a time_t, even for 32 bit time_t platforms.
Add year 1900 and 9999 test cases, and remove year 3000+ and 1969- negative tests.
Release\tests\functional\http*
Drive by fix for new VS2019 warnings about narrowing.
Release\src\utilities\asyncrt_utils.cpp
Remove dependence on _mkgmtime and gmtime_r/gmtime_s by implementing replacements loosely inspired by both the C runtime's date operations and .NET's handling of the Gregorian calendar's 400 year cycle.