Commit dad2439d authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Get rid of connect_t.

parent a1cee892
......@@ -1571,7 +1571,7 @@ static BOOL open_connection( request_t *request )
BOOL is_secure = request->hdr.flags & WINHTTP_FLAG_SECURE;
struct hostdata *host = NULL, *iter;
netconn_t *netconn = NULL;
connect_t *connect;
struct connect *connect;
WCHAR *addressW = NULL;
INTERNET_PORT port;
DWORD len;
......@@ -1751,7 +1751,7 @@ static BOOL add_host_header( request_t *request, DWORD modifier )
DWORD len;
WCHAR *host;
static const WCHAR fmt[] = {'%','s',':','%','u',0};
connect_t *connect = request->connect;
struct connect *connect = request->connect;
INTERNET_PORT port;
port = connect->hostport ? connect->hostport : (request->hdr.flags & WINHTTP_FLAG_SECURE ? 443 : 80);
......@@ -2175,7 +2175,7 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
static const WCHAR length_fmt[] = {'%','l','d',0};
BOOL ret = FALSE;
connect_t *connect = request->connect;
struct connect *connect = request->connect;
struct session *session = connect->session;
char *wire_req;
int bytes_sent;
......@@ -2623,7 +2623,7 @@ static BOOL handle_redirect( request_t *request, DWORD status )
BOOL ret = FALSE;
DWORD len, len_loc;
URL_COMPONENTS uc;
connect_t *connect = request->connect;
struct connect *connect = request->connect;
INTERNET_PORT port;
WCHAR *hostname = NULL, *location;
int index;
......
......@@ -322,7 +322,7 @@ end:
*/
static void connect_destroy( struct object_header *hdr )
{
connect_t *connect = (connect_t *)hdr;
struct connect *connect = (struct connect *)hdr;
TRACE("%p\n", connect);
......@@ -337,7 +337,7 @@ static void connect_destroy( struct object_header *hdr )
static BOOL connect_query_option( struct object_header *hdr, DWORD option, void *buffer, DWORD *buflen )
{
connect_t *connect = (connect_t *)hdr;
struct connect *connect = (struct connect *)hdr;
switch (option)
{
......@@ -478,7 +478,7 @@ static BOOL should_bypass_proxy(struct session *session, LPCWSTR server)
return ret;
}
BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT port )
BOOL set_server_for_hostname( struct connect *connect, const WCHAR *server, INTERNET_PORT port )
{
struct session *session = connect->session;
BOOL ret = TRUE;
......@@ -545,7 +545,7 @@ end:
*/
HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PORT port, DWORD reserved )
{
connect_t *connect;
struct connect *connect;
struct session *session;
HINTERNET hconnect = NULL;
......@@ -567,7 +567,7 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
return NULL;
}
if (!(connect = heap_alloc_zero( sizeof(connect_t) )))
if (!(connect = heap_alloc_zero( sizeof(struct connect) )))
{
release_object( &session->hdr );
return NULL;
......@@ -987,7 +987,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
case WINHTTP_OPTION_USERNAME:
{
connect_t *connect = request->connect;
struct connect *connect = request->connect;
heap_free( connect->username );
if (!(connect->username = buffer_to_str( buffer, buflen ))) return FALSE;
......@@ -995,7 +995,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
}
case WINHTTP_OPTION_PASSWORD:
{
connect_t *connect = request->connect;
struct connect *connect = request->connect;
heap_free( connect->password );
if (!(connect->password = buffer_to_str( buffer, buflen ))) return FALSE;
......@@ -1110,7 +1110,7 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
LPCWSTR referrer, LPCWSTR *types, DWORD flags )
{
request_t *request;
connect_t *connect;
struct connect *connect;
HINTERNET hrequest = NULL;
TRACE("%p, %s, %s, %s, %s, %p, 0x%08x\n", hconnect, debugstr_w(verb), debugstr_w(object),
......@@ -1123,7 +1123,7 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
for (iter = types; *iter; iter++) TRACE(" %s\n", debugstr_w(*iter));
}
if (!(connect = (connect_t *)grab_object( hconnect )))
if (!(connect = (struct connect *)grab_object( hconnect )))
{
set_last_error( ERROR_INVALID_HANDLE );
return NULL;
......
......@@ -97,19 +97,19 @@ struct session
DWORD secure_protocols;
};
typedef struct
struct connect
{
struct object_header hdr;
struct session *session;
LPWSTR hostname; /* final destination of the request */
LPWSTR servername; /* name of the server we directly connect to */
LPWSTR username;
LPWSTR password;
WCHAR *hostname; /* final destination of the request */
WCHAR *servername; /* name of the server we directly connect to */
WCHAR *username;
WCHAR *password;
INTERNET_PORT hostport;
INTERNET_PORT serverport;
struct sockaddr_storage sockaddr;
BOOL resolved;
} connect_t;
};
typedef struct
{
......@@ -171,7 +171,7 @@ struct authinfo
typedef struct
{
struct object_header hdr;
connect_t *connect;
struct connect *connect;
LPWSTR verb;
LPWSTR path;
LPWSTR version;
......@@ -287,7 +287,7 @@ BOOL set_cookies( request_t *, const WCHAR * ) DECLSPEC_HIDDEN;
BOOL add_cookie_headers( request_t * ) DECLSPEC_HIDDEN;
BOOL add_request_headers( request_t *, LPCWSTR, DWORD, DWORD ) DECLSPEC_HIDDEN;
void destroy_cookies( struct session * ) DECLSPEC_HIDDEN;
BOOL set_server_for_hostname( connect_t *, LPCWSTR, INTERNET_PORT ) DECLSPEC_HIDDEN;
BOOL set_server_for_hostname( struct connect *, const WCHAR *, INTERNET_PORT ) DECLSPEC_HIDDEN;
void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN;
void release_host( struct hostdata *host ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment