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
cc619639
Commit
cc619639
authored
Jul 08, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jul 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Change type of netconn_resolve from struct sockaddr_in * to struct sockaddr *.
parent
c2ef4e79
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
9 deletions
+26
-9
net.c
dlls/winhttp/net.c
+22
-7
request.c
dlls/winhttp/request.c
+3
-1
winhttp_private.h
dlls/winhttp/winhttp_private.h
+1
-1
No files found.
dlls/winhttp/net.c
View file @
cc619639
...
...
@@ -566,7 +566,7 @@ DWORD netconn_set_timeout( netconn_t *netconn, BOOL send, int value )
return
ERROR_SUCCESS
;
}
BOOL
netconn_resolve
(
WCHAR
*
hostnameW
,
INTERNET_PORT
port
,
struct
sockaddr
_in
*
sa
)
BOOL
netconn_resolve
(
WCHAR
*
hostnameW
,
INTERNET_PORT
port
,
struct
sockaddr
*
sa
,
socklen_t
*
sa_len
)
{
char
*
hostname
;
#ifdef HAVE_GETADDRINFO
...
...
@@ -574,6 +574,7 @@ BOOL netconn_resolve( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr_in *
int
ret
;
#else
struct
hostent
*
he
;
struct
sockaddr_in
*
sin
=
(
struct
sockaddr_in
*
)
sa
;
#endif
if
(
!
(
hostname
=
strdupWA
(
hostnameW
)))
return
FALSE
;
...
...
@@ -589,10 +590,17 @@ BOOL netconn_resolve( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr_in *
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
hostnameW
),
gai_strerror
(
ret
));
return
FALSE
;
}
if
(
*
sa_len
<
sizeof
(
struct
sockaddr_in
))
{
WARN
(
"address too small
\n
"
);
freeaddrinfo
(
res
);
return
FALSE
;
}
*
sa_len
=
sizeof
(
struct
sockaddr_in
);
memset
(
sa
,
0
,
sizeof
(
struct
sockaddr_in
)
);
memcpy
(
&
sa
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
res
->
ai_addr
)
->
sin_addr
,
sizeof
(
struct
in_addr
)
);
sa
->
sin_family
=
res
->
ai_family
;
sa
->
sin_port
=
htons
(
port
);
memcpy
(
&
((
struct
sockaddr_in
*
)
sa
)
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
res
->
ai_addr
)
->
sin_addr
,
sizeof
(
struct
in_addr
)
);
((
struct
sockaddr_in
*
)
sa
)
->
sin_family
=
res
->
ai_family
;
((
struct
sockaddr_in
*
)
sa
)
->
sin_port
=
htons
(
port
);
freeaddrinfo
(
res
);
#else
...
...
@@ -606,10 +614,17 @@ BOOL netconn_resolve( WCHAR *hostnameW, INTERNET_PORT port, struct sockaddr_in *
LeaveCriticalSection
(
&
cs_gethostbyname
);
return
FALSE
;
}
if
(
*
sa_len
<
sizeof
(
struct
sockaddr_in
))
{
WARN
(
"address too small
\n
"
);
LeaveCriticalSection
(
&
cs_gethostbyname
);
return
FALSE
;
}
*
sa_len
=
sizeof
(
struct
sockaddr_in
);
memset
(
sa
,
0
,
sizeof
(
struct
sockaddr_in
)
);
memcpy
(
&
s
a
->
sin_addr
,
he
->
h_addr
,
he
->
h_length
);
s
a
->
sin_family
=
he
->
h_addrtype
;
s
a
->
sin_port
=
htons
(
port
);
memcpy
(
&
s
in
->
sin_addr
,
he
->
h_addr
,
he
->
h_length
);
s
in
->
sin_family
=
he
->
h_addrtype
;
s
in
->
sin_port
=
htons
(
port
);
LeaveCriticalSection
(
&
cs_gethostbyname
);
#endif
...
...
dlls/winhttp/request.c
View file @
cc619639
...
...
@@ -716,6 +716,7 @@ static BOOL open_connection( request_t *request )
char
address
[
32
];
WCHAR
*
addressW
;
INTERNET_PORT
port
;
socklen_t
slen
;
if
(
netconn_connected
(
&
request
->
netconn
))
return
TRUE
;
...
...
@@ -724,7 +725,8 @@ static BOOL open_connection( request_t *request )
send_callback
(
&
request
->
hdr
,
WINHTTP_CALLBACK_STATUS_RESOLVING_NAME
,
connect
->
servername
,
strlenW
(
connect
->
servername
)
+
1
);
if
(
!
netconn_resolve
(
connect
->
servername
,
port
,
&
connect
->
sockaddr
))
return
FALSE
;
slen
=
sizeof
(
connect
->
sockaddr
);
if
(
!
netconn_resolve
(
connect
->
servername
,
port
,
(
struct
sockaddr
*
)
&
connect
->
sockaddr
,
&
slen
))
return
FALSE
;
inet_ntop
(
connect
->
sockaddr
.
sin_family
,
&
connect
->
sockaddr
.
sin_addr
,
address
,
sizeof
(
address
)
);
addressW
=
strdupAW
(
address
);
...
...
dlls/winhttp/winhttp_private.h
View file @
cc619639
...
...
@@ -211,7 +211,7 @@ BOOL netconn_get_next_line( netconn_t *, char *, DWORD * );
BOOL
netconn_init
(
netconn_t
*
,
BOOL
);
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
_in
*
);
BOOL
netconn_resolve
(
WCHAR
*
,
INTERNET_PORT
,
struct
sockaddr
*
,
socklen_t
*
);
BOOL
netconn_secure_connect
(
netconn_t
*
);
BOOL
netconn_send
(
netconn_t
*
,
const
void
*
,
size_t
,
int
,
int
*
);
DWORD
netconn_set_timeout
(
netconn_t
*
,
BOOL
,
int
);
...
...
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