* Adding Zlib from Source to Apple LHC
* Adding Compression API to exp files
* Adding ifdef to pch_common.h
* Subtle bug in new build guards
* Replacing iOS and MAC build guards for HC_PLATFORM_IS_APPLE
* Isolating Zlib warnings to specific files
* Fixing Targets with corresponding compiler flags
* Excluding one least warning treated as error
---------
Co-authored-by: raulalbertog <raulalbertog@microsoft.com>
At a high level, the goal of these changes is to restructure the code and project files to better allow for extending libHttpClient to new platforms, including platforms that require an NDA and need to be maintained outside of the public github repository. Specific changes in this pull request include:
* Added IHttpProvider and IWebSocketProvider interfaces which platform specific implementations of HTTP and WebSockets must implement.
* Added PlatformComponents struct and PlatformInitialize method which each platform must implement. Those implementations can easily exist outside the primary github repository without modification to existing source.
* Removal of the HC_PERFORM_ENV class which acted as a context object for all of the in-box HTTP and WebSocket providers. It had gotten extremely messy and required updating for new platforms. This was replaced by the NetworkState class, which does a lot of the same things, but it contains no platform specific code. Rather than having hard-coded HTTP and WebSocket hooks for each platform, it is initialized with an IHttpProvider and IWebSocketProvider during HCInitialize.
* Refactoring of props files in the /Build directory. A libHttpClient.[platform].props file was added for each supported platform. These props files define the platform specific default build configuration and will be imported by each project targeting that platform.
* Refactoring visual studio project files and removal of the CMake + ProjectFileProcessor utility that was used to generate the project files. That system has been replaced by a much more modular build system which breaks source files required for multiple projects into .vcxitems projects. The .vcxproj files end up being very minimal, referencing the appropriate .props files and .vcxitems projects based on the platform they target.
* Some minor cleanup and code refactoring including addition of internal types.h header and dependency on std::optional in Result<T> class
* Dropped support for the XDK platform as well as visual studio 2015. Additionally the visual studio 2017 .sln was removed, but the projects building with platform toolset 141 were maintained and can still be used if needed.
CurlMulti creates a composite work queue and schedules work to that queue as long as there are outstanding HTTP requests. During cleanup, CurlMulti will terminate its queue, effectively cancelling all ongoing requests. However, if there are no ongoing requests at the time of cleanup, there is no guarantee that the client will still be dispatching the queue, which is required to fully terminate a queue. To fix this I've done two things:
1. Only terminate the queue if there are ongoing requests. If there are no ongoing requests, we're guaranteed to have no remaining callbacks pending on the queue, so termination is unnecessary.
2. When terminating the queue, don't await a queue terminated callback. This avoids a potential race condition where the client stops dispatching the queue after they've gotten a completion callback for the final HTTP request but before they've dispatched the queue terminated callback.
I also added some additional verbose logging to help diagnose future cleanup issues.
* Add Linux build files and configure files to support LibHttpClient Linux
* resolving comments
Removed extern structs in .h file and moved them up where they were in pch_common to ensure they are defined properly
* added templates
* Update x509_cert_utilities.hpp
* Update x509_cert_utilities.hpp
change check to something defined by us
* Update x509_cert_utilities.hpp
fix error in pipeline where there are errors of an unused function.
* Update x509_cert_utilities.hpp
use elif and corrected to use else
---------
Co-authored-by: SebastianPD-XB <sebastianp@microsoft.com>
* Use okhttp for websockets on android
* empty commit to re-trigger build pipelines
Co-authored-by: Jason Sandlin <jasonsa@microsoft.com>
Co-authored-by: Sahil <saashar@microsoft.com>
* WebSocket class reworked allowing multiple "observers" to independently register for events. This allows both clients and HC_PERFORM_ENV to keep track of the connection state
* HCWebSocketConnectAsync Shim added to HC_PERFORM_ENV, tracking WebSocket connect attempts
* During cleanup, WebSockets in the process of connecting will be allowed to finish connecting (currently no support for cancellation)
* Connected WebSockets will be properly closed
* Validated E2E using local WebSocket echo server + API runner scripts (added in separate PR)
* Regression tested via API runner
* Adds HCHttpPerformAsync shim to HC_PERFORM_ENV to track ongoing HTTP requests
* Adds partial support for HTTP cancelation
* Adds logic to HCCleanupAsync to cancel and await ongoing Http requests during cleanup
* Added relevant UnitTests
Remaining work:
* Tracking active WebSocket connections & terminating during HCCleanup
Improve implementation of platform default Http/WebSocket handler selection to allow for runtime selection of WinHttp WebSockets on Win32 if they are available (win 8+). Changed all platform default providers to this same pattern for consistency.
* Reworking WinHttp stack to support handling PLM events
* remove invalid assert
* Add some tracing, fix a bug after doing console suspend/resume testing
* Set trace level to verbose/important based on configuration
* Build fix
* Set trace level separately in the props
Co-authored-by: sashaweiss <asashaweiss@gmail.com>
* HC_PERFORM_ENV is the context for both the HTTP and WebSocket providers. On GDK, we want to user the Curl HTTP provider but the WinHttp WebSocket provider, so I've separated out WinHttpState from the WinHttp provider's HC_PERFORM_ENV so that it can be included in XCurl provider as well.
* Also added missing XCurl lib path to libHttpClient.props that was causing link issues
* Properly use client WriteResponseBody/ReadRequestBody callbacks in Curl HTTP provider
* Update openssl commit to 1.1.1k
* Format openssl and add log function
* Quick script fix
* More cleaning the script
* More rewriting and cleaning up of script
* Unblock arm64 from xcodeprojs and heavily modify script
* Remove short circuit
* Don't suffix with platform name, already broken out in DerivedData
* Re-add armv7 support
* Fix header path and replace deprecated Sec method
* Wrap SecTrust method in an availablity check
* Build fixes
* Fix Win32 and Android builds
* Empty commit to bump CI
Co-authored-by: sashaweiss <asashaweiss@gmail.com>
Co-authored-by: Jason Sandlin <jasonsa@microsoft.com>
* README updates
* Start stripping Android from CMakeLists.txts and stuff
* More stripping
* Do the deleting >:D
* More deletion
* Strip more
* Remove Android projects from VS
* Update README
* Reset unintended vcxproj guid changing
* Add Debug|x64 to vs17 projects missing it
* Also add Release|x64
* Revert "Add Debug|x64 to vs17 projects missing it"
This reverts commit 19d9d22300.
* Revert "Also add Release|x64"
This reverts commit d64fe15764.
* Add prototypes and declarations
* Default read/write functions and WinHttp implementation
* XMLHttp
* Apple
* Android
* Correctly handle empty POST and PUT requests with OkHttp
* PR feedback
* PR feedback
* Build fix
* PR feedback
* Exit critical section before calling ThrowIOException
* Remove "bytesRead" from write callback
* Check for singleton init read and write callback setters
* Restore default read callback when setting body bytes
* Comments for set body bytes and set body string
* Bounds check in DefaultRequestBodyReadFunction
* UWP cleanup
* Update comments
* Context pointers
* Build fix
Co-authored-by: Jason Sandlin <jasonsa@microsoft.com>
Do not assume the caller is building with `/Applications/Xcode.app`.
Some environments use other paths like `/Applications/Xcode_12.1.app`.
Ask `xcode-select -p` for the path to the Xcode `/Developer` directory.
Within `libHttpClient.xcodeproj`, it will use the matching Xcode.
Fixes: #563
Co-authored-by: Jason Sandlin <jasonsa@microsoft.com>
* Don't bother installing OpenSSL docs/man pages/etc
* SSL targets merge libssl and libcrypto and are depended on by libHC static lib targets
* Add NOWEBSOCKETS framework target
* Add macOS NOWEBSOCKETS framework target
* Add xcschemes to libHttpClient workspace to build the _NOWEBSOCKETS targets
* Empty commit to force fresh CI
* Disable arm64 support for 'Any Mac' target
* Alphabetize
* Update a couple vestigial fields
* Clean up SSLDummy copyright header
* Empty commit to force fresh CI