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
da0515c1
Commit
da0515c1
authored
Jun 24, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Implement WinHttpWebSocketShutdown.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f18cbfcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
2 deletions
+75
-2
request.c
dlls/winhttp/request.c
+67
-2
winhttp_private.h
dlls/winhttp/winhttp_private.h
+8
-0
No files found.
dlls/winhttp/request.c
View file @
da0515c1
...
@@ -3469,10 +3469,75 @@ DWORD WINAPI WinHttpWebSocketReceive( HINTERNET hsocket, void *buf, DWORD len, D
...
@@ -3469,10 +3469,75 @@ DWORD WINAPI WinHttpWebSocketReceive( HINTERNET hsocket, void *buf, DWORD len, D
return
ret
;
return
ret
;
}
}
static
DWORD
socket_shutdown
(
struct
socket
*
socket
,
USHORT
status
,
const
void
*
reason
,
DWORD
len
,
BOOL
async
)
{
DWORD
ret
;
ret
=
send_frame
(
socket
->
request
->
netconn
,
WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE
,
status
,
reason
,
len
,
TRUE
);
if
(
async
)
{
if
(
!
ret
)
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_SHUTDOWN_COMPLETE
,
NULL
,
0
);
else
{
WINHTTP_WEB_SOCKET_ASYNC_RESULT
result
;
result
.
AsyncResult
.
dwResult
=
API_WRITE_DATA
;
result
.
AsyncResult
.
dwError
=
ret
;
result
.
Operation
=
WINHTTP_WEB_SOCKET_SHUTDOWN_OPERATION
;
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
,
&
result
,
sizeof
(
result
)
);
}
}
if
(
!
ret
)
socket
->
state
=
SOCKET_STATE_SHUTDOWN
;
return
ret
;
}
static
void
task_socket_shutdown
(
struct
task_header
*
task
)
{
struct
socket
*
socket
=
(
struct
socket
*
)
task
->
object
;
struct
socket_shutdown
*
s
=
(
struct
socket_shutdown
*
)
task
;
socket_shutdown
(
socket
,
s
->
status
,
s
->
reason
,
s
->
len
,
TRUE
);
}
DWORD
WINAPI
WinHttpWebSocketShutdown
(
HINTERNET
hsocket
,
USHORT
status
,
void
*
reason
,
DWORD
len
)
DWORD
WINAPI
WinHttpWebSocketShutdown
(
HINTERNET
hsocket
,
USHORT
status
,
void
*
reason
,
DWORD
len
)
{
{
FIXME
(
"%p, %u, %p, %u
\n
"
,
hsocket
,
status
,
reason
,
len
);
struct
socket
*
socket
;
return
ERROR_INVALID_PARAMETER
;
DWORD
ret
;
TRACE
(
"%p, %u, %p, %u
\n
"
,
hsocket
,
status
,
reason
,
len
);
if
(
len
&&
!
reason
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
socket
=
(
struct
socket
*
)
grab_object
(
hsocket
)))
return
ERROR_INVALID_HANDLE
;
if
(
socket
->
hdr
.
type
!=
WINHTTP_HANDLE_TYPE_SOCKET
)
{
release_object
(
&
socket
->
hdr
);
return
ERROR_WINHTTP_INCORRECT_HANDLE_TYPE
;
}
if
(
socket
->
state
>=
SOCKET_STATE_SHUTDOWN
)
{
release_object
(
&
socket
->
hdr
);
return
ERROR_WINHTTP_INCORRECT_HANDLE_STATE
;
}
if
(
socket
->
request
->
connect
->
hdr
.
flags
&
WINHTTP_FLAG_ASYNC
)
{
struct
socket_shutdown
*
s
;
if
(
!
(
s
=
heap_alloc
(
sizeof
(
*
s
)
)))
return
FALSE
;
s
->
hdr
.
object
=
&
socket
->
hdr
;
s
->
hdr
.
proc
=
task_socket_shutdown
;
s
->
status
=
status
;
s
->
reason
=
reason
;
s
->
len
=
len
;
addref_object
(
&
socket
->
hdr
);
ret
=
queue_task
(
&
socket
->
hdr
,
&
socket
->
send_q
,
(
struct
task_header
*
)
s
);
}
else
ret
=
socket_shutdown
(
socket
,
status
,
reason
,
len
,
FALSE
);
release_object
(
&
socket
->
hdr
);
return
ret
;
}
}
DWORD
WINAPI
WinHttpWebSocketClose
(
HINTERNET
hsocket
,
USHORT
status
,
void
*
reason
,
DWORD
len
)
DWORD
WINAPI
WinHttpWebSocketClose
(
HINTERNET
hsocket
,
USHORT
status
,
void
*
reason
,
DWORD
len
)
...
...
dlls/winhttp/winhttp_private.h
View file @
da0515c1
...
@@ -292,6 +292,14 @@ struct socket_receive
...
@@ -292,6 +292,14 @@ struct socket_receive
DWORD
len
;
DWORD
len
;
};
};
struct
socket_shutdown
{
struct
task_header
hdr
;
USHORT
status
;
const
void
*
reason
;
DWORD
len
;
};
struct
object_header
*
addref_object
(
struct
object_header
*
)
DECLSPEC_HIDDEN
;
struct
object_header
*
addref_object
(
struct
object_header
*
)
DECLSPEC_HIDDEN
;
struct
object_header
*
grab_object
(
HINTERNET
)
DECLSPEC_HIDDEN
;
struct
object_header
*
grab_object
(
HINTERNET
)
DECLSPEC_HIDDEN
;
void
release_object
(
struct
object_header
*
)
DECLSPEC_HIDDEN
;
void
release_object
(
struct
object_header
*
)
DECLSPEC_HIDDEN
;
...
...
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