Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ca56f992
Commit
ca56f992
authored
Aug 27, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Use winsock sockets.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
79bc939b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
96 deletions
+19
-96
Makefile.in
dlls/winhttp/Makefile.in
+2
-2
cookie.c
dlls/winhttp/cookie.c
+3
-3
handle.c
dlls/winhttp/handle.c
+2
-3
main.c
dlls/winhttp/main.c
+1
-0
net.c
dlls/winhttp/net.c
+0
-0
request.c
dlls/winhttp/request.c
+2
-11
session.c
dlls/winhttp/session.c
+6
-57
url.c
dlls/winhttp/url.c
+2
-2
winhttp_private.h
dlls/winhttp/winhttp_private.h
+1
-18
No files found.
dlls/winhttp/Makefile.in
View file @
ca56f992
MODULE
=
winhttp.dll
MODULE
=
winhttp.dll
IMPORTLIB
=
winhttp
IMPORTLIB
=
winhttp
IMPORTS
=
uuid jsproxy user32 advapi32
IMPORTS
=
uuid jsproxy user32 advapi32
ws2_32
DELAYIMPORTS
=
oleaut32 ole32 crypt32 secur32
DELAYIMPORTS
=
oleaut32 ole32 crypt32 secur32
EXTRALIBS
=
$(CORESERVICES_LIBS)
$(SOCKET_LIBS)
EXTRALIBS
=
$(CORESERVICES_LIBS)
C_SRCS
=
\
C_SRCS
=
\
cookie.c
\
cookie.c
\
...
...
dlls/winhttp/cookie.c
View file @
ca56f992
...
@@ -17,15 +17,15 @@
...
@@ -17,15 +17,15 @@
*/
*/
#include "config.h"
#include "config.h"
#include "ws2tcpip.h"
#include <stdarg.h>
#include <stdarg.h>
#include "wine/debug.h"
#include "wine/list.h"
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "winhttp.h"
#include "winhttp.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "winhttp_private.h"
#include "winhttp_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
...
...
dlls/winhttp/handle.c
View file @
ca56f992
...
@@ -19,15 +19,14 @@
...
@@ -19,15 +19,14 @@
*/
*/
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include "ws2tcpip.h"
#include "wine/debug.h"
#include <stdarg.h>
#include <stdarg.h>
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "winhttp.h"
#include "winhttp.h"
#include "wine/debug.h"
#include "winhttp_private.h"
#include "winhttp_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
...
...
dlls/winhttp/main.c
View file @
ca56f992
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#define COBJMACROS
#define COBJMACROS
#include "config.h"
#include "config.h"
#include "ws2tcpip.h"
#include <stdarg.h>
#include <stdarg.h>
#include "windef.h"
#include "windef.h"
...
...
dlls/winhttp/net.c
View file @
ca56f992
This diff is collapsed.
Click to expand it.
dlls/winhttp/request.c
View file @
ca56f992
...
@@ -21,13 +21,9 @@
...
@@ -21,13 +21,9 @@
#define COBJMACROS
#define COBJMACROS
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include "ws2tcpip.h"
#include <stdarg.h>
#include <stdarg.h>
#include <assert.h>
#include <assert.h>
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
...
@@ -38,9 +34,8 @@
...
@@ -38,9 +34,8 @@
#include "schannel.h"
#include "schannel.h"
#include "winhttp.h"
#include "winhttp.h"
#include "winhttp_private.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "winhttp_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
...
@@ -1481,10 +1476,6 @@ static BOOL secure_proxy_connect( request_t *request )
...
@@ -1481,10 +1476,6 @@ static BOOL secure_proxy_connect( request_t *request )
return
ret
;
return
ret
;
}
}
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN 46
#endif
static
WCHAR
*
addr_to_str
(
struct
sockaddr_storage
*
addr
)
static
WCHAR
*
addr_to_str
(
struct
sockaddr_storage
*
addr
)
{
{
char
buf
[
INET6_ADDRSTRLEN
];
char
buf
[
INET6_ADDRSTRLEN
];
...
...
dlls/winhttp/session.c
View file @
ca56f992
...
@@ -17,9 +17,7 @@
...
@@ -17,9 +17,7 @@
*/
*/
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include "ws2tcpip.h"
#include "wine/debug.h"
#include <stdarg.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdlib.h>
...
@@ -34,9 +32,6 @@
...
@@ -34,9 +32,6 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#ifndef __MINGW32__
#define USE_WS_PREFIX
#endif
#include "winsock2.h"
#include "winsock2.h"
#include "ws2ipdef.h"
#include "ws2ipdef.h"
#include "winhttp.h"
#include "winhttp.h"
...
@@ -46,6 +41,7 @@
...
@@ -46,6 +41,7 @@
#include "dispex.h"
#include "dispex.h"
#include "activscp.h"
#include "activscp.h"
#include "wine/debug.h"
#include "winhttp_private.h"
#include "winhttp_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
...
@@ -649,46 +645,8 @@ static WCHAR *blob_to_str( DWORD encoding, CERT_NAME_BLOB *blob )
...
@@ -649,46 +645,8 @@ static WCHAR *blob_to_str( DWORD encoding, CERT_NAME_BLOB *blob )
return
ret
;
return
ret
;
}
}
static
BOOL
co
nvert
_sockaddr
(
const
struct
sockaddr
*
addr
,
SOCKADDR_STORAGE
*
addr_storage
)
static
BOOL
co
py
_sockaddr
(
const
struct
sockaddr
*
addr
,
SOCKADDR_STORAGE
*
addr_storage
)
{
{
#ifndef __MINGW32__
switch
(
addr
->
sa_family
)
{
case
AF_INET
:
{
const
struct
sockaddr_in
*
addr_unix
=
(
const
struct
sockaddr_in
*
)
addr
;
struct
WS_sockaddr_in
*
addr_win
=
(
struct
WS_sockaddr_in
*
)
addr_storage
;
char
*
p
;
addr_win
->
sin_family
=
WS_AF_INET
;
addr_win
->
sin_port
=
addr_unix
->
sin_port
;
memcpy
(
&
addr_win
->
sin_addr
,
&
addr_unix
->
sin_addr
,
4
);
p
=
(
char
*
)
&
addr_win
->
sin_addr
+
4
;
memset
(
p
,
0
,
sizeof
(
*
addr_storage
)
-
(
p
-
(
char
*
)
addr_win
)
);
return
TRUE
;
}
case
AF_INET6
:
{
const
struct
sockaddr_in6
*
addr_unix
=
(
const
struct
sockaddr_in6
*
)
addr
;
struct
WS_sockaddr_in6
*
addr_win
=
(
struct
WS_sockaddr_in6
*
)
addr_storage
;
addr_win
->
sin6_family
=
WS_AF_INET6
;
addr_win
->
sin6_port
=
addr_unix
->
sin6_port
;
addr_win
->
sin6_flowinfo
=
addr_unix
->
sin6_flowinfo
;
memcpy
(
&
addr_win
->
sin6_addr
,
&
addr_unix
->
sin6_addr
,
16
);
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
addr_win
->
sin6_scope_id
=
addr_unix
->
sin6_scope_id
;
#else
addr_win
->
sin6_scope_id
=
0
;
#endif
memset
(
addr_win
+
1
,
0
,
sizeof
(
*
addr_storage
)
-
sizeof
(
*
addr_win
)
);
return
TRUE
;
}
default:
ERR
(
"unhandled family %u
\n
"
,
addr
->
sa_family
);
return
FALSE
;
}
#else
switch
(
addr
->
sa_family
)
switch
(
addr
->
sa_family
)
{
{
case
AF_INET
:
case
AF_INET
:
...
@@ -711,7 +669,6 @@ static BOOL convert_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *add
...
@@ -711,7 +669,6 @@ static BOOL convert_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *add
ERR
(
"unhandled family %u
\n
"
,
addr
->
sa_family
);
ERR
(
"unhandled family %u
\n
"
,
addr
->
sa_family
);
return
FALSE
;
return
FALSE
;
}
}
#endif
}
}
static
BOOL
request_query_option
(
object_header_t
*
hdr
,
DWORD
option
,
LPVOID
buffer
,
LPDWORD
buflen
)
static
BOOL
request_query_option
(
object_header_t
*
hdr
,
DWORD
option
,
LPVOID
buffer
,
LPDWORD
buflen
)
...
@@ -829,8 +786,8 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf
...
@@ -829,8 +786,8 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf
return
FALSE
;
return
FALSE
;
}
}
if
(
getsockname
(
request
->
netconn
->
socket
,
&
local
,
&
len
))
return
FALSE
;
if
(
getsockname
(
request
->
netconn
->
socket
,
&
local
,
&
len
))
return
FALSE
;
if
(
!
co
nvert
_sockaddr
(
&
local
,
&
info
->
LocalAddress
))
return
FALSE
;
if
(
!
co
py
_sockaddr
(
&
local
,
&
info
->
LocalAddress
))
return
FALSE
;
if
(
!
co
nvert
_sockaddr
(
remote
,
&
info
->
RemoteAddress
))
return
FALSE
;
if
(
!
co
py
_sockaddr
(
remote
,
&
info
->
RemoteAddress
))
return
FALSE
;
info
->
cbSize
=
sizeof
(
*
info
);
info
->
cbSize
=
sizeof
(
*
info
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1338,11 +1295,7 @@ static BOOL is_domain_suffix( const char *domain, const char *suffix )
...
@@ -1338,11 +1295,7 @@ static BOOL is_domain_suffix( const char *domain, const char *suffix )
static
int
reverse_lookup
(
const
struct
addrinfo
*
ai
,
char
*
hostname
,
size_t
len
)
static
int
reverse_lookup
(
const
struct
addrinfo
*
ai
,
char
*
hostname
,
size_t
len
)
{
{
int
ret
=
-
1
;
return
getnameinfo
(
ai
->
ai_addr
,
ai
->
ai_addrlen
,
hostname
,
len
,
NULL
,
0
,
0
);
#ifdef HAVE_GETNAMEINFO
ret
=
getnameinfo
(
ai
->
ai_addr
,
ai
->
ai_addrlen
,
hostname
,
len
,
NULL
,
0
,
0
);
#endif
return
ret
;
}
}
static
WCHAR
*
build_wpad_url
(
const
char
*
hostname
,
const
struct
addrinfo
*
ai
)
static
WCHAR
*
build_wpad_url
(
const
char
*
hostname
,
const
struct
addrinfo
*
ai
)
...
@@ -1434,7 +1387,6 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
...
@@ -1434,7 +1387,6 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
}
}
if
(
flags
&
WINHTTP_AUTO_DETECT_TYPE_DNS_A
)
if
(
flags
&
WINHTTP_AUTO_DETECT_TYPE_DNS_A
)
{
{
#ifdef HAVE_GETADDRINFO
char
*
fqdn
,
*
domain
,
*
p
;
char
*
fqdn
,
*
domain
,
*
p
;
if
(
!
(
fqdn
=
get_computer_name
(
ComputerNamePhysicalDnsFullyQualified
)))
return
FALSE
;
if
(
!
(
fqdn
=
get_computer_name
(
ComputerNamePhysicalDnsFullyQualified
)))
return
FALSE
;
...
@@ -1476,9 +1428,6 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
...
@@ -1476,9 +1428,6 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
}
}
heap_free
(
domain
);
heap_free
(
domain
);
heap_free
(
fqdn
);
heap_free
(
fqdn
);
#else
FIXME
(
"getaddrinfo not found at build time
\n
"
);
#endif
}
}
if
(
!
ret
)
if
(
!
ret
)
{
{
...
...
dlls/winhttp/url.c
View file @
ca56f992
...
@@ -17,16 +17,16 @@
...
@@ -17,16 +17,16 @@
*/
*/
#include "config.h"
#include "config.h"
#include "ws2tcpip.h"
#include <stdarg.h>
#include <stdarg.h>
#include "wine/debug.h"
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "winreg.h"
#include "winreg.h"
#include "winhttp.h"
#include "winhttp.h"
#include "shlwapi.h"
#include "shlwapi.h"
#include "wine/debug.h"
#include "winhttp_private.h"
#include "winhttp_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
...
...
dlls/winhttp/winhttp_private.h
View file @
ca56f992
...
@@ -27,23 +27,6 @@
...
@@ -27,23 +27,6 @@
#include "wine/list.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#if defined(__MINGW32__) || defined (_MSC_VER)
# include <ws2tcpip.h>
#else
# define closesocket close
# define ioctlsocket ioctl
#endif
#include "ole2.h"
#include "ole2.h"
#include "sspi.h"
#include "sspi.h"
#include "wincrypt.h"
#include "wincrypt.h"
...
@@ -301,7 +284,7 @@ DWORD get_last_error( void ) DECLSPEC_HIDDEN;
...
@@ -301,7 +284,7 @@ DWORD get_last_error( void ) DECLSPEC_HIDDEN;
void
send_callback
(
object_header_t
*
,
DWORD
,
LPVOID
,
DWORD
)
DECLSPEC_HIDDEN
;
void
send_callback
(
object_header_t
*
,
DWORD
,
LPVOID
,
DWORD
)
DECLSPEC_HIDDEN
;
void
close_connection
(
request_t
*
)
DECLSPEC_HIDDEN
;
void
close_connection
(
request_t
*
)
DECLSPEC_HIDDEN
;
BOOL
netconn_close
(
netconn_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
(
hostdata_t
*
,
const
struct
sockaddr_storage
*
,
int
)
DECLSPEC_HIDDEN
;
void
netconn_unload
(
void
)
DECLSPEC_HIDDEN
;
void
netconn_unload
(
void
)
DECLSPEC_HIDDEN
;
ULONG
netconn_query_data_available
(
netconn_t
*
)
DECLSPEC_HIDDEN
;
ULONG
netconn_query_data_available
(
netconn_t
*
)
DECLSPEC_HIDDEN
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment