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
968b3745
Commit
968b3745
authored
Jun 25, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Status and reason are optional in the close response.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b9038c73
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
request.c
dlls/winhttp/request.c
+9
-14
No files found.
dlls/winhttp/request.c
View file @
968b3745
...
...
@@ -3310,7 +3310,7 @@ static DWORD receive_bytes( struct netconn *netconn, char *buf, DWORD len, DWORD
{
DWORD
err
;
if
((
err
=
netconn_recv
(
netconn
,
buf
,
len
,
0
,
(
int
*
)
ret_len
)))
return
err
;
if
(
len
&&
!*
ret_
len
)
return
ERROR_WINHTTP_INVALID_SERVER_RESPONSE
;
if
(
*
ret_len
!=
len
)
return
ERROR_WINHTTP_INVALID_SERVER_RESPONSE
;
return
ERROR_SUCCESS
;
}
...
...
@@ -3341,8 +3341,7 @@ static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, enum socket
char
hdr
[
2
];
if
((
ret
=
receive_bytes
(
netconn
,
hdr
,
sizeof
(
hdr
),
&
count
)))
return
ret
;
if
(
count
!=
sizeof
(
hdr
)
||
(
hdr
[
0
]
&
RESERVED_BIT
)
||
(
hdr
[
1
]
&
MASK_BIT
)
||
(
map_opcode
(
hdr
[
0
]
&
0xf
,
FALSE
)
==
~
0u
))
if
((
hdr
[
0
]
&
RESERVED_BIT
)
||
(
hdr
[
1
]
&
MASK_BIT
)
||
(
map_opcode
(
hdr
[
0
]
&
0xf
,
FALSE
)
==
~
0u
))
{
return
ERROR_WINHTTP_INVALID_SERVER_RESPONSE
;
}
...
...
@@ -3353,14 +3352,12 @@ static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, enum socket
{
USHORT
len16
;
if
((
ret
=
receive_bytes
(
netconn
,
(
char
*
)
&
len16
,
sizeof
(
len16
),
&
count
)))
return
ret
;
if
(
count
!=
sizeof
(
len16
))
return
ERROR_WINHTTP_INVALID_SERVER_RESPONSE
;
len
=
RtlUshortByteSwap
(
len16
);
}
else
if
(
len
==
127
)
{
ULONGLONG
len64
;
if
((
ret
=
receive_bytes
(
netconn
,
(
char
*
)
&
len64
,
sizeof
(
len64
),
&
count
)))
return
ret
;
if
(
count
!=
sizeof
(
len64
))
return
ERROR_WINHTTP_INVALID_SERVER_RESPONSE
;
if
((
len64
=
RtlUlonglongByteSwap
(
len64
))
>
~
0u
)
return
ERROR_NOT_SUPPORTED
;
len
=
len64
;
}
...
...
@@ -3548,23 +3545,21 @@ static DWORD socket_close( struct socket *socket, USHORT status, const void *rea
}
if
((
ret
=
receive_frame
(
netconn
,
&
count
,
&
socket
->
opcode
)))
goto
done
;
if
(
socket
->
opcode
!=
SOCKET_OPCODE_CLOSE
||
(
count
&&
count
>
sizeof
(
socket
->
reason
)))
if
(
socket
->
opcode
!=
SOCKET_OPCODE_CLOSE
||
(
count
&&
(
count
<
sizeof
(
socket
->
status
)
||
count
>
sizeof
(
socket
->
status
)
+
sizeof
(
socket
->
reason
))))
{
ret
=
ERROR_WINHTTP_INVALID_SERVER_RESPONSE
;
goto
done
;
}
if
((
ret
=
receive_bytes
(
netconn
,
(
char
*
)
&
socket
->
status
,
sizeof
(
socket
->
status
),
&
count
)))
goto
done
;
if
(
count
!=
sizeof
(
socket
->
status
))
if
(
count
)
{
ret
=
ERROR_WINHTTP_INVALID_SERVER_RESPONSE
;
goto
done
;
}
DWORD
reason_len
=
count
-
sizeof
(
socket
->
status
);
if
((
ret
=
receive_bytes
(
netconn
,
(
char
*
)
&
socket
->
status
,
sizeof
(
socket
->
status
),
&
count
)))
goto
done
;
socket
->
status
=
RtlUshortByteSwap
(
socket
->
status
);
if
(
!
(
ret
=
receive_bytes
(
netconn
,
socket
->
reason
,
sizeof
(
socket
->
reason
),
&
socket
->
reason_len
)))
{
socket
->
state
=
SOCKET_STATE_CLOSED
;
if
((
ret
=
receive_bytes
(
netconn
,
socket
->
reason
,
reason_len
,
&
socket
->
reason_len
)))
goto
done
;
}
socket
->
state
=
SOCKET_STATE_CLOSED
;
done:
if
(
async
)
...
...
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