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

151 Коммитов

Автор SHA1 Сообщение Дата
Fernando C 7323b4e707
Enable Gzip Response Decompression (#815)
* decompression WIP

* comments...custom write functions

* adding test file

* attempting to push

* switch to main

* preparing to push

* wip

* Adding test json

* Revert "wip"

This reverts commit 723cebe905.

* Remove TestContent-2.json

* removing comments

* removing comments

* remove comments

* renaming HCHttpCallSetCompressedResponse

* attempting to fix build

* attempt to fix iOS build

* adding logic to handle custom write callbacks

* Minor Edits

* Minor Edits

* address nit

* removing Temporary callback apis, renaming callback holder fields

* moving new apis to bottom of .exp and .def files

* removing newlines

* removing spaces

* adding comment to httpcall.h

* invoking custom response callback

* adding newline brackets

* renaming api, fixing build

* removing secret key

* minor edit

* update custom callback reset comments

* added test for custom write flow

* removing my title secret key

* minor edit

* fixing build

* fixing build, adding custom write function wrapper

* minor edits
2024-05-01 16:29:11 -07:00
Sebastian Perez-Delgado 75224f9fdd
add static option to libHC linux (#818)
* add static option to libHC linux

* Add static library build task
2024-04-24 10:25:05 -07:00
Raul Gomez Rodriguez 72360809a9
Adding missing symbols (#797)
Co-authored-by: raulalbertog <raulalbertog@microsoft.com>
2024-02-07 16:41:42 -06:00
Raul Gomez Rodriguez 3df5588fc0
GZIP Compression support for Apple (#786)
* 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>
2023-11-09 17:17:07 -06:00
Jason Sandlin 18d2a68c62
Various minor fixes to LHC Linux CMake (#781)
* Various minor fixes to LHC Linux CMake

* PR feedback

* PR feedback

* Fixing Android cmake paths'
2023-10-10 13:39:44 -07:00
John L a6febd0827
Internal PAL improvements + project refactoring to better support additional platforms (#768)
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.
2023-07-20 11:44:11 -07:00
John L 53dc58fce2
Fix bug in CurlMulti (#762)
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.
2023-07-06 12:58:24 -07:00
Sebastian Perez-Delgado 38cc8ed178
LibHC linux build curl using libssl in repo submodule (#752)
* change build order

* change curl flags

* change pipeline to reflect dependency changes

* revised bash scripts

* fix white space nit

* restructure build scripts and pipeline

---------

Co-authored-by: Sahil Ashar <saashar@microsoft.com>
2023-06-22 11:24:14 -07:00
Sebastian Perez-Delgado 641939771d
Update libHttpClient_Linux.bash (#742) 2023-05-26 17:55:45 -07:00
Sebastian Perez-Delgado 38cd3211c0
removing ninja build system (#741) 2023-05-19 15:24:07 -07:00
Sebastian Perez-Delgado cf825b3782
Add build pipeline and change LibHC linux to build with CMake (#738)
Created CMake files for LibHC Linux

Created Bash Script to help compile LibHC Linux


Removed WSL VCXProj files
2023-05-18 13:50:51 -07:00
Sebastian Perez-Delgado 0c1ac487ea
LibHttpClient Linux: Add Linux build files and configure files to support LibHC Linux. (#732)
* 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>
2023-03-10 16:45:35 -08:00
Nathan Iskandar 09713544c6
include stdarg.h in trace.h to fix ios build (#725)
* include stdarg.h in trace.h to fix ios build

* include order

* add HCTraceImplMessage_v to exports
2022-10-25 12:15:37 -07:00
David Westen 53d216267d
Use okhttp for websockets on android (#714)
* 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>
2022-09-19 13:48:26 -05:00
Nathan Iskandar d81df0a775
Add HCMockCallCloseHandle and HCMockCallDuplicate handle to exports files (#710) 2022-07-28 13:44:20 -07:00
Jason Sandlin c80549b9a7
Update to PR trigger (#704) 2022-06-28 20:36:14 -07:00
Maxim Ivanov 427f4d2e89
Use more CMake way to reference project dir (#701)
Makes it easier to build on non-Windows platforms
2022-06-20 13:20:12 -07:00
Jason Sandlin 1a4a418df0
Fix various missing #include and required namespace qualifiers (#685) 2022-04-21 18:45:35 -07:00
John L 312552b182
Cleanup redesign part 2 (#662)
* 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
2022-02-04 19:26:54 -08:00
John L 18f7aad846
Cleanup redesign part 1 (#658)
* 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
2022-02-01 13:20:53 -08:00
Jason Sandlin b2dfa4d17e
Issue 655: Be able to query if library has been initialized #655 (#660)
* Issue 655: Be able to query if library has been initialized #655

* Adding export
2022-02-01 02:15:33 -08:00
Sasha Weiss be2fde89b0
Use a safe binary staging dir for iOS OpenSSL build (#657)
* Use a staging directory rather than CONFIGURATION_TEMP_DIR

* Make sure to create staging directory
2022-01-24 13:47:38 -08:00
Sahil Ashar fe4e4eaa3b
Fix for Android JNI link bug (#648) 2021-12-21 15:22:04 -06:00
John L 0b321c270a
Adding support for VS toolset v143 (#644)
* v143 Support for Win32 & GDK
* Change to generating project files for each supported toolset from a single project template.
2021-12-03 15:04:19 -08:00
MSFT-Heba a52aec7beb
Fixing a typo in openssl.bash (#637)
Co-authored-by: heba <xlivexdevx@V-TKLIMEK-CON.redmond.corp.microsoft.com>
2021-11-11 13:31:52 -08:00
Sahil Ashar 6db544995d
partial revert of #608, adding support for MinVersion 8.1 (#633) 2021-11-09 16:18:53 -06:00
John L 0021f5e8f6
Win32 to use WinHttp WebSockets if available (#627)
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.
2021-11-09 13:07:33 -08:00
Sahil Ashar 293574f963
update NDK version (#631) 2021-11-08 19:57:39 -06:00
Jason Sandlin d22c78aef1
Switching Win32 projects to use Win8.1 SDK (#608)
* Switching Win32 projects to use Win8.1 SDK

* PR

* Kicking PR build
2021-11-08 12:43:58 -08:00
Jason Sandlin b0bc8cd369
Updating to build images and build process (#630)
* Updating to build images and build process

* Updates
2021-11-08 12:00:48 -08:00
John L c8ad087c0f
Reworking WinHttp stack to support handling PLM events (#625)
* Reworking WinHttp stack to support handling PLM events

* remove invalid assert

* Add some tracing, fix a bug after doing console suspend/resume testing
2021-10-25 21:55:45 -07:00
Sasha Weiss 2ce04eaac8
Expose tracing init/cleanup separately from overall libHttpClient init (#626)
* Expose tracing init/cleanup separately from overall libHttpClient init

* Add remarks about calling multiple times
2021-10-15 17:28:06 -07:00
Sasha Weiss 5774e6b316
Set trace level to verbose/important based on configuration (#622)
* 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>
2021-10-14 15:02:21 -07:00
MSFT-Heba 70c3ac97d2
Readding i386 for simulator support (#619)
* Readding i386 for simulator support
2021-10-02 10:27:23 -07:00
John L d3ce3b43d2
Fix WinHttp WebSocket stack for GDK (#616)
* 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
2021-09-23 13:40:26 -07:00
Sasha Weiss 1af4d35f99
Update min iOS version to 11.0 (#615)
* Update the iOS min version to 11.0

* Enable base i18n to silence warning

* Drop armv7 from the OpenSSL script
2021-09-22 09:45:00 -07:00
Sasha Weiss 19afd51719
Add missing method to Framework exports (#613)
Co-authored-by: sashaweiss <asashaweiss@gmail.com>
2021-09-20 12:48:24 -07:00
John L fd3593cf7f
Swapping HTTP provider for GDK from WinHttp to XCurl (#605)
* Swapping HTTP provider for GDK from WinHttp to XCurl

* Add locking around XCurlMulti::m_easyRequests, cleanup logging

* Minor fixes

* Cleanup headers slist

* Addressing feedback

* Addressing more feedback

* Small fixes

* Fix comment, add a couple curl error codes
2021-08-26 13:24:33 -07:00
Sasha Weiss 2aec337f24
Update OpenSSL and support M1 Macs (#602)
* 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>
2021-08-23 15:31:08 -07:00
Sasha Weiss 7af5486f4f
Fix broken Android build (#600) 2021-07-30 16:10:47 -07:00
Sasha Weiss 3af828ca42
Move the Android build to a Windows agent (#598)
* Move the Android build to a Windows agent

* Empty commit to bump CI

* Trigger for PRs to main
2021-07-30 15:20:08 -07:00
Jason Sandlin be92eacf55
Switching to ADO YAML build defs (#597)
* Switching to ADO YAML build defs

* PR

* PR

* PR
2021-07-29 15:56:31 -07:00
Luca Beltrami fda07c155f
Fix exports (#593) 2021-07-14 17:44:46 -07:00
Sasha Weiss 30db9825eb
Remove Visual Studio Android builds (#591)
* 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.
2021-07-14 14:15:16 -07:00
David Westen 21f12b36de
Read and write callbacks to support large file transfers (#577)
* 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>
2021-05-06 16:54:43 -07:00
Sasha Weiss a2f5d91e5a
Place Android Gradle/CMake build files under `/Binaries` (#576)
* Use the /Binaries dir for Android intermediates

* Put the .cxx staging dir as a sibling to the build dir

* Remove unused file
2021-04-19 15:09:17 -07:00
Brad King 531104cd26
openssl.bash: Use Xcode instance preferred by caller (#564)
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>
2021-02-17 14:34:31 -08:00
Sasha Weiss b6757e81bf
Add iOS targets for building without websockets/SSL (#556)
* 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
2021-01-07 17:42:30 -08:00
Jason Sandlin 7ebf7150ca
Removing task files from GDK projects (#554) 2020-12-09 12:51:18 -08:00
John L 10a805d7c1
Adding GDK projects to libHttpClient props file (#552) 2020-11-02 14:10:47 -08:00