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
7b7fdb85
Commit
7b7fdb85
authored
Jun 29, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Copy the reason buffer.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c7d140d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
request.c
dlls/winhttp/request.c
+4
-4
winhttp.c
dlls/winhttp/tests/winhttp.c
+6
-0
winhttp_private.h
dlls/winhttp/winhttp_private.h
+2
-2
No files found.
dlls/winhttp/request.c
View file @
7b7fdb85
...
...
@@ -3463,7 +3463,7 @@ DWORD WINAPI WinHttpWebSocketShutdown( HINTERNET hsocket, USHORT status, void *r
TRACE
(
"%p, %u, %p, %u
\n
"
,
hsocket
,
status
,
reason
,
len
);
if
(
len
&&
!
reason
)
return
ERROR_INVALID_PARAMETER
;
if
(
(
len
&&
!
reason
)
||
len
>
sizeof
(
socket
->
reason
)
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
socket
=
(
struct
socket
*
)
grab_object
(
hsocket
)))
return
ERROR_INVALID_HANDLE
;
if
(
socket
->
hdr
.
type
!=
WINHTTP_HANDLE_TYPE_SOCKET
)
...
...
@@ -3484,7 +3484,7 @@ DWORD WINAPI WinHttpWebSocketShutdown( HINTERNET hsocket, USHORT status, void *r
if
(
!
(
s
=
heap_alloc
(
sizeof
(
*
s
)
)))
return
FALSE
;
s
->
socket
=
socket
;
s
->
status
=
status
;
s
->
reason
=
reason
;
memcpy
(
s
->
reason
,
reason
,
len
)
;
s
->
len
=
len
;
addref_object
(
&
socket
->
hdr
);
...
...
@@ -3569,7 +3569,7 @@ DWORD WINAPI WinHttpWebSocketClose( HINTERNET hsocket, USHORT status, void *reas
TRACE
(
"%p, %u, %p, %u
\n
"
,
hsocket
,
status
,
reason
,
len
);
if
(
len
&&
!
reason
)
return
ERROR_INVALID_PARAMETER
;
if
(
(
len
&&
!
reason
)
||
len
>
sizeof
(
socket
->
reason
)
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
socket
=
(
struct
socket
*
)
grab_object
(
hsocket
)))
return
ERROR_INVALID_HANDLE
;
if
(
socket
->
hdr
.
type
!=
WINHTTP_HANDLE_TYPE_SOCKET
)
...
...
@@ -3590,7 +3590,7 @@ DWORD WINAPI WinHttpWebSocketClose( HINTERNET hsocket, USHORT status, void *reas
if
(
!
(
s
=
heap_alloc
(
sizeof
(
*
s
)
)))
return
FALSE
;
s
->
socket
=
socket
;
s
->
status
=
status
;
s
->
reason
=
reason
;
memcpy
(
s
->
reason
,
reason
,
len
)
;
s
->
len
=
len
;
addref_object
(
&
socket
->
hdr
);
...
...
dlls/winhttp/tests/winhttp.c
View file @
7b7fdb85
...
...
@@ -3356,6 +3356,9 @@ static void test_websocket(int port)
error
=
pWinHttpWebSocketShutdown
(
socket
,
WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS
,
NULL
,
1
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
error
=
pWinHttpWebSocketShutdown
(
socket
,
WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS
,
buf
,
sizeof
(
buf
));
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
error
=
pWinHttpWebSocketShutdown
(
socket
,
WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS
,
(
void
*
)
"success"
,
sizeof
(
"success"
));
ok
(
!
error
,
"got %u
\n
"
,
error
);
...
...
@@ -3363,6 +3366,9 @@ static void test_websocket(int port)
error
=
pWinHttpWebSocketClose
(
socket
,
WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS
,
NULL
,
1
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
error
=
pWinHttpWebSocketClose
(
socket
,
WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS
,
buf
,
sizeof
(
buf
));
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
error
=
pWinHttpWebSocketClose
(
socket
,
WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS
,
(
void
*
)
"success2"
,
sizeof
(
"success2"
));
ok
(
!
error
,
"got %u
\n
"
,
error
);
...
...
dlls/winhttp/winhttp_private.h
View file @
7b7fdb85
...
...
@@ -244,7 +244,7 @@ struct socket
enum
socket_opcode
opcode
;
DWORD
read_size
;
USHORT
status
;
char
reason
[
12
8
];
char
reason
[
12
3
];
DWORD
reason_len
;
};
...
...
@@ -305,7 +305,7 @@ struct socket_shutdown
{
struct
socket
*
socket
;
USHORT
status
;
c
onst
void
*
reason
;
c
har
reason
[
123
]
;
DWORD
len
;
};
...
...
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