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
72273a07
Commit
72273a07
authored
Jan 13, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Implement the connect timeout.
parent
64f1fd29
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
3 deletions
+37
-3
http.c
dlls/wininet/http.c
+3
-1
internet.h
dlls/wininet/internet.h
+3
-1
netconnection.c
dlls/wininet/netconnection.c
+31
-1
No files found.
dlls/wininet/http.c
View file @
72273a07
...
...
@@ -3048,6 +3048,7 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
request
->
netconn_stream
.
data_stream
.
vtbl
=
&
netconn_stream_vtbl
;
request
->
data_stream
=
&
request
->
netconn_stream
.
data_stream
;
request
->
connect_timeout
=
session
->
connect_timeout
;
InitializeCriticalSection
(
&
request
->
read_section
);
request
->
read_section
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": http_request_t.read_section"
);
...
...
@@ -4597,7 +4598,7 @@ static DWORD open_http_connection(http_request_t *request, BOOL *reusing)
server
->
addr_str
,
strlen
(
server
->
addr_str
)
+
1
);
res
=
create_netconn
(
is_https
,
server
,
request
->
security_flags
,
&
netconn
);
res
=
create_netconn
(
is_https
,
server
,
request
->
security_flags
,
request
->
connect_timeout
,
&
netconn
);
server_release
(
server
);
if
(
res
!=
ERROR_SUCCESS
)
{
ERR
(
"create_netconn failed: %u
\n
"
,
res
);
...
...
@@ -5541,6 +5542,7 @@ DWORD HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
session
->
password
=
heap_strdupW
(
lpszPassword
);
session
->
serverPort
=
serverPort
;
session
->
hostPort
=
serverPort
;
session
->
connect_timeout
=
INFINITE
;
/* Don't send a handle created callback if this handle was created with InternetOpenUrl */
if
(
!
(
session
->
hdr
.
dwInternalFlags
&
INET_OPENURL
))
...
...
dlls/wininet/internet.h
View file @
72273a07
...
...
@@ -265,6 +265,7 @@ typedef struct
LPWSTR
password
;
INTERNET_PORT
hostPort
;
/* the final destination port of the request */
INTERNET_PORT
serverPort
;
/* the port of the server we directly connect to */
DWORD
connect_timeout
;
}
http_session_t
;
#define HDR_ISREQUEST 0x0001
...
...
@@ -305,6 +306,7 @@ typedef struct
LPWSTR
rawHeaders
;
netconn_t
*
netconn
;
DWORD
security_flags
;
DWORD
connect_timeout
;
LPWSTR
version
;
LPWSTR
statusText
;
DWORD
bytesToWrite
;
...
...
@@ -515,7 +517,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD
dwStatusInfoLength
)
DECLSPEC_HIDDEN
;
BOOL
INTERNET_FindProxyForProtocol
(
LPCWSTR
szProxy
,
LPCWSTR
proto
,
WCHAR
*
foundProxy
,
DWORD
*
foundProxyLen
)
DECLSPEC_HIDDEN
;
DWORD
create_netconn
(
BOOL
,
server_t
*
,
DWORD
,
netconn_t
**
)
DECLSPEC_HIDDEN
;
DWORD
create_netconn
(
BOOL
,
server_t
*
,
DWORD
,
DWORD
,
netconn_t
**
)
DECLSPEC_HIDDEN
;
void
free_netconn
(
netconn_t
*
)
DECLSPEC_HIDDEN
;
void
NETCON_unload
(
void
)
DECLSPEC_HIDDEN
;
DWORD
NETCON_secure_connect
(
netconn_t
*
connection
,
LPWSTR
hostname
)
DECLSPEC_HIDDEN
;
...
...
dlls/wininet/netconnection.c
View file @
72273a07
...
...
@@ -497,7 +497,7 @@ static DWORD init_openssl(void)
#endif
}
DWORD
create_netconn
(
BOOL
useSSL
,
server_t
*
server
,
DWORD
security_flags
,
netconn_t
**
ret
)
DWORD
create_netconn
(
BOOL
useSSL
,
server_t
*
server
,
DWORD
security_flags
,
DWORD
timeout
,
netconn_t
**
ret
)
{
netconn_t
*
netconn
;
int
result
,
flag
;
...
...
@@ -526,9 +526,39 @@ DWORD create_netconn(BOOL useSSL, server_t *server, DWORD security_flags, netcon
assert
(
server
->
addr_len
);
result
=
netconn
->
socketFD
=
socket
(
server
->
addr
.
ss_family
,
SOCK_STREAM
,
0
);
if
(
result
!=
-
1
)
{
flag
=
1
;
ioctlsocket
(
netconn
->
socketFD
,
FIONBIO
,
&
flag
);
result
=
connect
(
netconn
->
socketFD
,
(
struct
sockaddr
*
)
&
server
->
addr
,
server
->
addr_len
);
if
(
result
==
-
1
)
{
if
(
sock_get_error
(
errno
)
==
WSAEINPROGRESS
)
{
struct
pollfd
pfd
;
int
res
;
pfd
.
fd
=
netconn
->
socketFD
;
pfd
.
events
=
POLLOUT
;
res
=
poll
(
&
pfd
,
1
,
timeout
);
if
(
!
res
)
{
closesocket
(
netconn
->
socketFD
);
heap_free
(
netconn
);
return
ERROR_INTERNET_CANNOT_CONNECT
;
}
else
if
(
res
>
0
)
{
int
err
;
socklen_t
len
=
sizeof
(
err
);
if
(
!
getsockopt
(
netconn
->
socketFD
,
SOL_SOCKET
,
SO_ERROR
,
&
err
,
&
len
)
&&
!
err
)
result
=
0
;
}
}
}
if
(
result
==
-
1
)
closesocket
(
netconn
->
socketFD
);
else
{
flag
=
0
;
ioctlsocket
(
netconn
->
socketFD
,
FIONBIO
,
&
flag
);
}
}
if
(
result
==
-
1
)
{
heap_free
(
netconn
);
...
...
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