Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ee68473f
Commit
ee68473f
authored
Jun 29, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Reconnect if persistent connection was closed by server.
parent
c0091077
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
http.c
dlls/wininet/http.c
+20
-3
netconnection.c
dlls/wininet/netconnection.c
+5
-1
No files found.
dlls/wininet/http.c
View file @
ee68473f
...
...
@@ -3454,6 +3454,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders,
do
{
DWORD
len
;
BOOL
reusing_connection
;
char
*
ascii_req
;
loop_next
=
FALSE
;
...
...
@@ -3504,6 +3505,11 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders,
TRACE
(
"Request header -> %s
\n
"
,
debugstr_w
(
requestString
)
);
/* Send the request and store the results */
if
(
NETCON_connected
(
&
lpwhr
->
netConnection
))
reusing_connection
=
TRUE
;
else
reusing_connection
=
FALSE
;
if
((
res
=
HTTP_OpenConnection
(
lpwhr
))
!=
ERROR_SUCCESS
)
goto
lend
;
...
...
@@ -3545,6 +3551,13 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders,
goto
lend
;
responseLen
=
HTTP_GetResponseHeaders
(
lpwhr
,
TRUE
);
/* FIXME: We should know that connection is closed before sending
* headers. Otherwise wrong callbacks are executed */
if
(
!
responseLen
&&
reusing_connection
)
{
TRACE
(
"Connection closed by server, reconnecting
\n
"
);
loop_next
=
TRUE
;
continue
;
}
INTERNET_SendCallback
(
&
lpwhr
->
hdr
,
lpwhr
->
hdr
.
dwContext
,
INTERNET_STATUS_RESPONSE_RECEIVED
,
&
responseLen
,
...
...
@@ -4457,9 +4470,6 @@ static INT HTTP_GetResponseHeaders(http_request_t *lpwhr, BOOL clear)
TRACE
(
"-->
\n
"
);
/* clear old response headers (eg. from a redirect response) */
if
(
clear
)
HTTP_clear_response_headers
(
lpwhr
);
if
(
!
NETCON_connected
(
&
lpwhr
->
netConnection
))
goto
lend
;
...
...
@@ -4471,6 +4481,13 @@ static INT HTTP_GetResponseHeaders(http_request_t *lpwhr, BOOL clear)
buflen
=
MAX_REPLY_LEN
;
if
(
!
read_line
(
lpwhr
,
bufferA
,
&
buflen
))
goto
lend
;
/* clear old response headers (eg. from a redirect response) */
if
(
clear
)
{
HTTP_clear_response_headers
(
lpwhr
);
clear
=
FALSE
;
}
rc
+=
buflen
;
MultiByteToWideChar
(
CP_ACP
,
0
,
bufferA
,
buflen
,
buffer
,
MAX_REPLY_LEN
);
/* check is this a status code line? */
...
...
dlls/wininet/netconnection.c
View file @
ee68473f
...
...
@@ -770,6 +770,8 @@ DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int
if
(
!
connection
->
useSSL
)
{
*
recvd
=
recv
(
connection
->
socketFD
,
buf
,
len
,
flags
);
if
(
!*
recvd
)
NETCON_close
(
connection
);
return
*
recvd
==
-
1
?
sock_get_error
(
errno
)
:
ERROR_SUCCESS
;
}
else
...
...
@@ -779,8 +781,10 @@ DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int
/* Check if EOF was received */
if
(
!*
recvd
&&
(
pSSL_get_error
(
connection
->
ssl_s
,
*
recvd
)
==
SSL_ERROR_ZERO_RETURN
||
pSSL_get_error
(
connection
->
ssl_s
,
*
recvd
)
==
SSL_ERROR_SYSCALL
))
||
pSSL_get_error
(
connection
->
ssl_s
,
*
recvd
)
==
SSL_ERROR_SYSCALL
))
{
NETCON_close
(
connection
);
return
ERROR_SUCCESS
;
}
return
*
recvd
>
0
?
ERROR_SUCCESS
:
ERROR_INTERNET_CONNECTION_ABORTED
;
#else
...
...
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