Commit Graph

696 Commits

Author SHA1 Message Date
Paul Gofman 93b07c091b winhttp: Handle TLS close notify in netconn_is_alive().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-01 20:45:07 +01:00
Paul Gofman 3a8ccb9242 winhttp: Process end of read data before sending callback in read_data().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:33:11 +02:00
Paul Gofman d349013dde winhttp: Don't send notifications when connection is closed on read finish.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:33:06 +02:00
Hans Leidekker ca5850d920 winhttp/tests: Add redirect tests.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:14:50 +02:00
Hans Leidekker badc64b42c winhttp: Don't remove content-type/length headers in handle_redirect().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50272
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:14:46 +02:00
Hans Leidekker ec46607ee0 winhttp: Fix return value for relative redirects.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:14:43 +02:00
Hans Leidekker 5da1d59241 winhttp: Call drain_content() before clear_response_headers().
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:14:40 +02:00
Hans Leidekker 239964ce86 winhttp: Call read_data() at least once in drain_content().
This ensures that response headers are processed even if there's no data to read.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50244
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 18:14:36 +02:00
Hans Leidekker 9f6e39e8b9 winhttp: Use ws.ifelse.io for websocket tests.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51631
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:39 +02:00
Hans Leidekker f738af16fb winhttp: Read any data left in the request buffer for websocket connections.
Fixes the case where a websocket server sends an unsolicited frame with the upgrade response.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:34 +02:00
Hans Leidekker 54742a9001 winhttp: Pass a socket pointer to send_bytes() and receive_bytes().
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:30 +02:00
Paul Gofman 34fea20cd3 winhttp: Limit recursion for synchronous callback calls.
Fixes a regression in Hitman 2, Death Stranding introduced
by commit be5acd1c07.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:43:54 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Hans Leidekker 73c107fd53 winhttp: Consistently validate the buffer in option query functions.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 20:40:07 +02:00
Hans Leidekker 1a07093238 winhttp: Add a stub for WinHttpQueryOption(WINHTTP_OPTION_HTTP_PROTOCOL_USED).
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 20:40:07 +02:00
Hans Leidekker 94c46bf533 winhttp: Add a stub for WinHttpSetOption(WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL).
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 20:40:07 +02:00
Hans Leidekker 5731c38ae1 winhttp: Don't fail the request if authorization fails.
Fixes a regression from 080dfbee31.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Paul Gofman be5acd1c07 winhttp: Execute WinHttpReadData() synchronously if the data is available.
Fixes eFootball PES 2021 in game contents download.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 21:49:09 +02:00
Paul Gofman 1c659954df winhttp: Execute WinHttpQueryDataAvailable() synchronously if the data is available.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 21:49:09 +02:00
Paul Gofman bc5305e599 winhttp: Factor out query_data_ready() function.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 21:49:08 +02:00
Haoyang Chen 8147ccde13 winhttp: Handle headers with '\r' line breaks.
Signed-off-by: Haoyang Chen <chenhaoyang@uniontech.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-29 15:40:43 +02:00
Alexander Fischer b9f012e14c winhttp: Added stubs to function request_set_option.
WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE and
WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE, (defined in include/winhttp.h)
weren't handled yet, which caused 'Amazon Games App' downloads to fail.

Signed-off-by: Alexander Fischer <fischeralex1993@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 12:32:20 +02:00
Hans Leidekker 4f961d9e7a winhttp: Use CRT memory allocators.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:28:44 +02:00
Hans Leidekker ed9c1fb1b9 winhttp: Remove redundant parentheses.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:28:44 +02:00
Hans Leidekker d66e834bfd winhttp: Fix a buffer size check.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:28:44 +02:00
Alexandre Julliard 5d82baf974 winecrt0: Add a default implementation DllRegisterServer()/DllUnregisterServer().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Alexandre Julliard bd6b53740c winecrt0: Add a default implementation for DllCanUnloadNow().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Haoyang Chen f547592bd2 winhttp: Invalid url decomposition should return failure when it fails.
Signed-off-by: Haoyang Chen <chenhaoyang@uniontech.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-07 22:36:11 +02:00
Hans Leidekker e1352bf028 winhttp/tests: Add tests for client certificate authentication.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-26 20:10:19 +01:00
Hans Leidekker 83afd177b3 winhttp: Avoid a crash when the connection is closed while handling a redirect.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48870
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:18 +01:00
Owen Rudge 5042687d01 winhttp: Implement WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS.
Signed-off-by: Owen Rudge <orudge@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-03 19:44:15 +02:00
Owen Rudge e4e94ed72e winhttp/tests: Add tests for WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS.
Signed-off-by: Owen Rudge <orudge@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-03 19:44:15 +02:00
Hans Leidekker 97f9dc7ff4 winhttp: Stop the send queue before sending the close message.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 21:07:43 +02:00
Hans Leidekker dffd8e8647 winhttp: Add support for ping and pong messages.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 21:07:43 +02:00
Hans Leidekker 7b7fdb8585 winhttp: Copy the reason buffer.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 21:07:43 +02:00
Hans Leidekker c7d140d34a winhttp: Reimplement the task queue using thread pool work objects.
Simplifies cleanup.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-29 21:07:43 +02:00
Hans Leidekker 23db5357bb winhttp: Add stubs for new proxy functions.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Hans Leidekker 968b3745bb winhttp: Status and reason are optional in the close response.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Hans Leidekker b9038c736b winhttp: Set socket state before sending notifications.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 23:08:30 +02:00
Hans Leidekker e3ab70b82a winhttp/tests: Add more WebSocket tests.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker 6d564bd53e winhttp: Add support for WebSocket fragment buffers.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker 938b3e5771 winhttp/tests: Add asynchronous WebSocket tests.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker 3b1d18fd6e winhttp: Implement WinHttpWebSocketQueryCloseStatus.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker 61ea74b457 winhttp: Implement WinHttpWebSocketClose.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker da0515c165 winhttp: Implement WinHttpWebSocketShutdown.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker f18cbfcd5d winhttp: Implement WinHttpWebSocketReceive.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker 68b44e3055 winhttp: Implement WinHttpWebSocketSend.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-24 18:34:15 +02:00
Hans Leidekker cc1c4759ba winhttp: Send WINHTTP_CALLBACK_STATUS_HANDLE_CREATED notification in WinHttpWebSocketCompleteUpgrade.
Based on a patch by Alistair Leslie-Hughes.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 10:10:10 +02:00
Hans Leidekker c8c0bc6d2e winhttp: Set socket notification mask and callback from the parent request.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 10:10:08 +02:00
Alistair Leslie-Hughes 57a1936053 winhttp: Pass length in WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER callback.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 10:10:02 +02:00