[WINHTTP]

- Sync to wine 1.3.21

svn path=/trunk/; revision=52105
This commit is contained in:
Cameron Gutman 2011-06-05 21:39:34 +00:00
parent e909d0b7db
commit d7abc4fbf1
4 changed files with 39 additions and 36 deletions

View file

@ -134,6 +134,7 @@ MAKE_FUNCPTR( ERR_free_strings );
MAKE_FUNCPTR( ERR_get_error );
MAKE_FUNCPTR( ERR_error_string );
MAKE_FUNCPTR( X509_STORE_CTX_get_ex_data );
MAKE_FUNCPTR( X509_STORE_CTX_get_chain );
MAKE_FUNCPTR( i2d_X509 );
MAKE_FUNCPTR( sk_value );
MAKE_FUNCPTR( sk_num );
@ -374,13 +375,14 @@ static int netconn_secure_verify( int preverify_ok, X509_STORE_CTX *ctx )
X509 *cert;
int i;
PCCERT_CONTEXT endCert = NULL;
struct stack_st *chain = (struct stack_st *)pX509_STORE_CTX_get_chain( ctx );
ret = TRUE;
for (i = 0; ret && i < psk_num((struct stack_st *)ctx->chain); i++)
for (i = 0; ret && i < psk_num(chain); i++)
{
PCCERT_CONTEXT context;
cert = (X509 *)psk_value((struct stack_st *)ctx->chain, i);
cert = (X509 *)psk_value(chain, i);
if ((context = X509_to_cert_context( cert )))
{
if (i == 0)
@ -488,6 +490,7 @@ BOOL netconn_init( netconn_t *conn, BOOL secure )
LOAD_FUNCPTR( ERR_get_error );
LOAD_FUNCPTR( ERR_error_string );
LOAD_FUNCPTR( X509_STORE_CTX_get_ex_data );
LOAD_FUNCPTR( X509_STORE_CTX_get_chain );
LOAD_FUNCPTR( i2d_X509 );
LOAD_FUNCPTR( sk_value );
LOAD_FUNCPTR( sk_num );

View file

@ -504,7 +504,7 @@ static WCHAR *build_request_path( request_t *request )
sprintfW( ret, fmt, scheme, request->connect->hostname );
if (request->connect->hostport)
{
static const WCHAR colonFmt[] = { ':','%','d',0 };
static const WCHAR colonFmt[] = { ':','%','u',0 };
sprintfW( ret + strlenW( ret ), colonFmt,
request->connect->hostport );
@ -870,7 +870,7 @@ static BOOL read_reply( request_t *request );
static BOOL secure_proxy_connect( request_t *request )
{
static const WCHAR verbConnect[] = {'C','O','N','N','E','C','T',0};
static const WCHAR fmt[] = {'%','s',':','%','d',0};
static const WCHAR fmt[] = {'%','s',':','%','u',0};
BOOL ret = FALSE;
LPWSTR path;
connect_t *connect = request->connect;
@ -1837,7 +1837,7 @@ static BOOL receive_response( request_t *request, BOOL async )
if (!(request->hdr.disable_flags & WINHTTP_DISABLE_COOKIES)) record_cookies( request );
if (status == 301 || status == 302)
if (status == HTTP_STATUS_MOVED || status == HTTP_STATUS_REDIRECT || status == HTTP_STATUS_REDIRECT_KEEP_VERB)
{
if (request->hdr.disable_flags & WINHTTP_DISABLE_REDIRECTS) break;

View file

@ -299,7 +299,7 @@ static DWORD comp_length( DWORD len, DWORD flags, WCHAR *comp )
static BOOL calc_length( URL_COMPONENTS *uc, DWORD flags, LPDWORD len )
{
static const WCHAR formatW[] = {'%','d',0};
static const WCHAR formatW[] = {'%','u',0};
INTERNET_SCHEME scheme;
*len = 0;
@ -360,7 +360,7 @@ static BOOL calc_length( URL_COMPONENTS *uc, DWORD flags, LPDWORD len )
*/
BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDWORD required )
{
static const WCHAR formatW[] = {'%','d',0};
static const WCHAR formatW[] = {'%','u',0};
static const WCHAR twoslashW[] = {'/','/'};
DWORD len;

View file

@ -204,38 +204,38 @@ typedef struct
LPDWORD written;
} write_data_t;
object_header_t *addref_object( object_header_t * );
object_header_t *grab_object( HINTERNET );
void release_object( object_header_t * );
HINTERNET alloc_handle( object_header_t * );
BOOL free_handle( HINTERNET );
object_header_t *addref_object( object_header_t * ) DECLSPEC_HIDDEN;
object_header_t *grab_object( HINTERNET ) DECLSPEC_HIDDEN;
void release_object( object_header_t * ) DECLSPEC_HIDDEN;
HINTERNET alloc_handle( object_header_t * ) DECLSPEC_HIDDEN;
BOOL free_handle( HINTERNET ) DECLSPEC_HIDDEN;
void set_last_error( DWORD );
DWORD get_last_error( void );
void send_callback( object_header_t *, DWORD, LPVOID, DWORD );
void close_connection( request_t * );
void set_last_error( DWORD ) DECLSPEC_HIDDEN;
DWORD get_last_error( void ) DECLSPEC_HIDDEN;
void send_callback( object_header_t *, DWORD, LPVOID, DWORD ) DECLSPEC_HIDDEN;
void close_connection( request_t * ) DECLSPEC_HIDDEN;
BOOL netconn_close( netconn_t * );
BOOL netconn_connect( netconn_t *, const struct sockaddr *, unsigned int, int );
BOOL netconn_connected( netconn_t * );
BOOL netconn_create( netconn_t *, int, int, int );
BOOL netconn_get_next_line( netconn_t *, char *, DWORD * );
BOOL netconn_init( netconn_t *, BOOL );
void netconn_unload( void );
BOOL netconn_query_data_available( netconn_t *, DWORD * );
BOOL netconn_recv( netconn_t *, void *, size_t, int, int * );
BOOL netconn_resolve( WCHAR *, INTERNET_PORT, struct sockaddr *, socklen_t *, int );
BOOL netconn_secure_connect( netconn_t *, WCHAR * );
BOOL netconn_send( netconn_t *, const void *, size_t, int, int * );
DWORD netconn_set_timeout( netconn_t *, BOOL, int );
const void *netconn_get_certificate( netconn_t * );
int netconn_get_cipher_strength( netconn_t * );
BOOL netconn_close( netconn_t * ) DECLSPEC_HIDDEN;
BOOL netconn_connect( netconn_t *, const struct sockaddr *, unsigned int, int ) DECLSPEC_HIDDEN;
BOOL netconn_connected( netconn_t * ) DECLSPEC_HIDDEN;
BOOL netconn_create( netconn_t *, int, int, int ) DECLSPEC_HIDDEN;
BOOL netconn_get_next_line( netconn_t *, char *, DWORD * ) DECLSPEC_HIDDEN;
BOOL netconn_init( netconn_t *, BOOL ) DECLSPEC_HIDDEN;
void netconn_unload( void ) DECLSPEC_HIDDEN;
BOOL netconn_query_data_available( netconn_t *, DWORD * ) DECLSPEC_HIDDEN;
BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN;
BOOL netconn_resolve( WCHAR *, INTERNET_PORT, struct sockaddr *, socklen_t *, int ) DECLSPEC_HIDDEN;
BOOL netconn_secure_connect( netconn_t *, WCHAR * ) DECLSPEC_HIDDEN;
BOOL netconn_send( netconn_t *, const void *, size_t, int, int * ) DECLSPEC_HIDDEN;
DWORD netconn_set_timeout( netconn_t *, BOOL, int ) DECLSPEC_HIDDEN;
const void *netconn_get_certificate( netconn_t * ) DECLSPEC_HIDDEN;
int netconn_get_cipher_strength( netconn_t * ) DECLSPEC_HIDDEN;
BOOL set_cookies( request_t *, const WCHAR * );
BOOL add_cookie_headers( request_t * );
BOOL add_request_headers( request_t *, LPCWSTR, DWORD, DWORD );
void delete_domain( domain_t * );
BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT port );
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 delete_domain( domain_t * ) DECLSPEC_HIDDEN;
BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT port ) DECLSPEC_HIDDEN;
static inline void *heap_alloc( SIZE_T size )
{