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
a890e3a1
Commit
a890e3a1
authored
May 13, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
May 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Fixed handling of 204 No Content response.
parent
086eb61c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
http.c
dlls/wininet/http.c
+23
-14
No files found.
dlls/wininet/http.c
View file @
a890e3a1
...
...
@@ -2568,12 +2568,17 @@ static const data_stream_vtbl_t chunked_stream_vtbl = {
};
/* set the request content length based on the headers */
static
DWORD
set_content_length
(
http_request_t
*
request
)
static
DWORD
set_content_length
(
http_request_t
*
request
,
DWORD
status_code
)
{
static
const
WCHAR
szChunked
[]
=
{
'c'
,
'h'
,
'u'
,
'n'
,
'k'
,
'e'
,
'd'
,
0
};
WCHAR
encoding
[
20
];
DWORD
size
;
if
(
status_code
==
HTTP_STATUS_NO_CONTENT
)
{
request
->
contentLength
=
request
->
netconn_stream
.
content_length
=
0
;
return
ERROR_SUCCESS
;
}
size
=
sizeof
(
request
->
contentLength
);
if
(
HTTP_HttpQueryInfoW
(
request
,
HTTP_QUERY_FLAG_NUMBER
|
HTTP_QUERY_CONTENT_LENGTH
,
&
request
->
contentLength
,
&
size
,
NULL
)
!=
ERROR_SUCCESS
)
...
...
@@ -4685,17 +4690,17 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
HTTP_ProcessExpires
(
request
);
HTTP_ProcessLastModified
(
request
);
res
=
set_content_length
(
request
);
if
(
res
!=
ERROR_SUCCESS
)
goto
lend
;
if
(
!
request
->
contentLength
)
http_release_netconn
(
request
,
TRUE
);
dwBufferSize
=
sizeof
(
dwStatusCode
);
if
(
HTTP_HttpQueryInfoW
(
request
,
HTTP_QUERY_FLAG_NUMBER
|
HTTP_QUERY_STATUS_CODE
,
&
dwStatusCode
,
&
dwBufferSize
,
NULL
)
!=
ERROR_SUCCESS
)
dwStatusCode
=
0
;
res
=
set_content_length
(
request
,
dwStatusCode
);
if
(
res
!=
ERROR_SUCCESS
)
goto
lend
;
if
(
!
request
->
contentLength
)
http_release_netconn
(
request
,
TRUE
);
if
(
!
(
request
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_AUTO_REDIRECT
)
&&
responseLen
)
{
WCHAR
*
new_url
,
szNewLocation
[
INTERNET_MAX_URL_LENGTH
];
...
...
@@ -4795,7 +4800,7 @@ lend:
if
(
request
->
session
->
appInfo
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
)
{
if
(
res
==
ERROR_SUCCESS
&&
request
->
bytesWritten
==
request
->
bytesToWrite
)
if
(
res
==
ERROR_SUCCESS
&&
request
->
contentLength
&&
request
->
bytesWritten
==
request
->
bytesToWrite
)
HTTP_ReceiveRequestData
(
request
,
TRUE
);
else
{
...
...
@@ -4835,6 +4840,7 @@ static void AsyncHttpSendRequestProc(WORKREQUEST *workRequest)
static
DWORD
HTTP_HttpEndRequestW
(
http_request_t
*
request
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
)
{
INT
responseLen
;
DWORD
dwCode
,
dwCodeLength
;
DWORD
dwBufferSize
;
DWORD
res
=
ERROR_SUCCESS
;
...
...
@@ -4854,19 +4860,22 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_
HTTP_ProcessExpires
(
request
);
HTTP_ProcessLastModified
(
request
);
if
((
res
=
set_content_length
(
request
))
==
ERROR_SUCCESS
)
{
dwCodeLength
=
sizeof
(
dwCode
);
if
(
HTTP_HttpQueryInfoW
(
request
,
HTTP_QUERY_FLAG_NUMBER
|
HTTP_QUERY_STATUS_CODE
,
&
dwCode
,
&
dwCodeLength
,
NULL
)
!=
ERROR_SUCCESS
)
dwCode
=
0
;
if
((
res
=
set_content_length
(
request
,
dwCode
))
==
ERROR_SUCCESS
)
{
if
(
!
request
->
contentLength
)
http_release_netconn
(
request
,
TRUE
);
}
if
(
res
==
ERROR_SUCCESS
&&
!
(
request
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_AUTO_REDIRECT
))
{
DWORD
dwCode
,
dwCodeLength
=
sizeof
(
DWORD
);
if
(
HTTP_HttpQueryInfoW
(
request
,
HTTP_QUERY_FLAG_NUMBER
|
HTTP_QUERY_STATUS_CODE
,
&
dwCode
,
&
dwCodeLength
,
NULL
)
==
ERROR_SUCCESS
&&
(
dwCode
==
HTTP_STATUS_REDIRECT
||
if
(
dwCode
==
HTTP_STATUS_REDIRECT
||
dwCode
==
HTTP_STATUS_MOVED
||
dwCode
==
HTTP_STATUS_REDIRECT_METHOD
||
dwCode
==
HTTP_STATUS_REDIRECT_KEEP_VERB
)
)
dwCode
==
HTTP_STATUS_REDIRECT_KEEP_VERB
)
{
WCHAR
*
new_url
,
szNewLocation
[
INTERNET_MAX_URL_LENGTH
];
dwBufferSize
=
sizeof
(
szNewLocation
);
...
...
@@ -4891,7 +4900,7 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_
}
}
if
(
res
==
ERROR_SUCCESS
)
{
if
(
res
==
ERROR_SUCCESS
&&
request
->
contentLength
)
{
HTTP_ReceiveRequestData
(
request
,
TRUE
);
}
else
{
INTERNET_ASYNC_RESULT
iar
=
{
0
,
res
};
...
...
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