From a6edca34b5d83fa449132aa204cf8b381ce258c1 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Thu, 15 Nov 2018 12:38:51 +0100 Subject: [PATCH] winhttp: Get rid of hostdata_t. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/winhttp/net.c | 2 +- dlls/winhttp/request.c | 10 +++++----- dlls/winhttp/winhttp_private.h | 11 ++++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 8f66847db6c..1db39166503 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -179,7 +179,7 @@ static void set_blocking( netconn_t *conn, BOOL blocking ) ioctlsocket( conn->socket, FIONBIO, &state ); } -netconn_t *netconn_create( hostdata_t *host, const struct sockaddr_storage *sockaddr, int timeout ) +netconn_t *netconn_create( struct hostdata *host, const struct sockaddr_storage *sockaddr, int timeout ) { netconn_t *conn; unsigned int addr_len; diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 9a2c0ef0962..adc039da695 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -1487,7 +1487,7 @@ static CRITICAL_SECTION connection_pool_cs = { &connection_pool_debug, -1, 0, 0, static struct list connection_pool = LIST_INIT( connection_pool ); -void release_host( hostdata_t *host ) +void release_host( struct hostdata *host ) { LONG ref; @@ -1507,7 +1507,7 @@ static DWORD WINAPI connection_collector(void *arg) { unsigned int remaining_connections; netconn_t *netconn, *next_netconn; - hostdata_t *host, *next_host; + struct hostdata *host, *next_host; ULONGLONG now; do @@ -1519,7 +1519,7 @@ static DWORD WINAPI connection_collector(void *arg) EnterCriticalSection(&connection_pool_cs); - LIST_FOR_EACH_ENTRY_SAFE(host, next_host, &connection_pool, hostdata_t, entry) + LIST_FOR_EACH_ENTRY_SAFE(host, next_host, &connection_pool, struct hostdata, entry) { LIST_FOR_EACH_ENTRY_SAFE(netconn, next_netconn, &host->connections, netconn_t, entry) { @@ -1617,7 +1617,7 @@ static BOOL ensure_cred_handle( session_t *session ) static BOOL open_connection( request_t *request ) { BOOL is_secure = request->hdr.flags & WINHTTP_FLAG_SECURE; - hostdata_t *host = NULL, *iter; + struct hostdata *host = NULL, *iter; netconn_t *netconn = NULL; connect_t *connect; WCHAR *addressW = NULL; @@ -1631,7 +1631,7 @@ static BOOL open_connection( request_t *request ) EnterCriticalSection( &connection_pool_cs ); - LIST_FOR_EACH_ENTRY( iter, &connection_pool, hostdata_t, entry ) + LIST_FOR_EACH_ENTRY( iter, &connection_pool, struct hostdata, entry ) { if (iter->port == port && !strcmpW( connect->servername, iter->hostname ) && !is_secure == !iter->secure) { diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index c2f10e3ccf7..999f3d74840 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -65,14 +65,15 @@ struct object_header struct list children; }; -typedef struct { +struct hostdata +{ struct list entry; LONG ref; WCHAR *hostname; INTERNET_PORT port; BOOL secure; struct list connections; -} hostdata_t; +}; typedef struct { @@ -116,7 +117,7 @@ typedef struct int socket; struct sockaddr_storage sockaddr; BOOL secure; /* SSL active on connection? */ - hostdata_t *host; + struct hostdata *host; ULONGLONG keep_until; CtxtHandle ssl_ctx; SecPkgContext_StreamSizes ssl_sizes; @@ -270,7 +271,7 @@ void send_callback( struct object_header *, DWORD, LPVOID, DWORD ) DECLSPEC_HIDD void close_connection( request_t * ) DECLSPEC_HIDDEN; void netconn_close( netconn_t * ) DECLSPEC_HIDDEN; -netconn_t *netconn_create( hostdata_t *, const struct sockaddr_storage *, int ) DECLSPEC_HIDDEN; +netconn_t *netconn_create( struct hostdata *, const struct sockaddr_storage *, int ) DECLSPEC_HIDDEN; void netconn_unload( void ) DECLSPEC_HIDDEN; ULONG netconn_query_data_available( netconn_t * ) DECLSPEC_HIDDEN; BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN; @@ -289,7 +290,7 @@ void destroy_cookies( session_t * ) DECLSPEC_HIDDEN; BOOL set_server_for_hostname( connect_t *, LPCWSTR, INTERNET_PORT ) DECLSPEC_HIDDEN; void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN; -void release_host( hostdata_t *host ) DECLSPEC_HIDDEN; +void release_host( struct hostdata *host ) DECLSPEC_HIDDEN; extern HRESULT WinHttpRequest_create( void ** ) DECLSPEC_HIDDEN; void release_typelib( void ) DECLSPEC_HIDDEN;