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
64abcf80
Commit
64abcf80
authored
Nov 15, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Store connection in websocket.
parent
34b3d212
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
net.c
dlls/winhttp/net.c
+5
-0
request.c
dlls/winhttp/request.c
+9
-6
winhttp_private.h
dlls/winhttp/winhttp_private.h
+2
-0
No files found.
dlls/winhttp/net.c
View file @
64abcf80
...
...
@@ -278,6 +278,11 @@ DWORD netconn_create( struct hostdata *host, const struct sockaddr_storage *sock
return
ERROR_SUCCESS
;
}
void
netconn_addref
(
struct
netconn
*
conn
)
{
InterlockedIncrement
(
&
conn
->
refs
);
}
void
netconn_release
(
struct
netconn
*
conn
)
{
if
(
InterlockedDecrement
(
&
conn
->
refs
))
return
;
...
...
dlls/winhttp/request.c
View file @
64abcf80
...
...
@@ -3164,7 +3164,7 @@ static void socket_handle_closing( struct object_header *hdr )
pending_tasks
=
cancel_queue
(
&
socket
->
recv_q
)
||
pending_tasks
;
if
(
pending_tasks
)
netconn_cancel_io
(
socket
->
request
->
netconn
);
netconn_cancel_io
(
socket
->
netconn
);
}
static
BOOL
socket_query_option
(
struct
object_header
*
hdr
,
DWORD
option
,
void
*
buffer
,
DWORD
*
buflen
)
...
...
@@ -3190,6 +3190,7 @@ static void socket_destroy( struct object_header *hdr )
stop_queue
(
&
socket
->
send_q
);
stop_queue
(
&
socket
->
recv_q
);
netconn_release
(
socket
->
netconn
);
release_object
(
&
socket
->
request
->
hdr
);
free
(
socket
->
send_frame_buffer
);
free
(
socket
);
...
...
@@ -3212,7 +3213,7 @@ static BOOL socket_set_option( struct object_header *hdr, DWORD option, void *bu
return
FALSE
;
}
socket
->
keepalive_interval
=
interval
;
netconn_set_timeout
(
socket
->
request
->
netconn
,
FALSE
,
socket
->
keepalive_interval
);
netconn_set_timeout
(
socket
->
netconn
,
FALSE
,
socket
->
keepalive_interval
);
SetLastError
(
ERROR_SUCCESS
);
TRACE
(
"WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL %lu.
\n
"
,
interval
);
return
TRUE
;
...
...
@@ -3267,11 +3268,13 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR
InitializeSRWLock
(
&
socket
->
send_lock
);
init_queue
(
&
socket
->
send_q
);
init_queue
(
&
socket
->
recv_q
);
netconn_addref
(
request
->
netconn
);
socket
->
netconn
=
request
->
netconn
;
addref_object
(
&
request
->
hdr
);
socket
->
request
=
request
;
netconn_set_timeout
(
socket
->
request
->
netconn
,
FALSE
,
socket
->
keepalive_interval
);
netconn_set_timeout
(
socket
->
netconn
,
FALSE
,
socket
->
keepalive_interval
);
if
((
hsocket
=
alloc_handle
(
&
socket
->
hdr
)))
{
...
...
@@ -3289,7 +3292,7 @@ static DWORD send_bytes( struct socket *socket, char *bytes, int len, int *sent,
{
int
count
;
DWORD
err
;
err
=
netconn_send
(
socket
->
request
->
netconn
,
bytes
,
len
,
&
count
,
ovr
);
err
=
netconn_send
(
socket
->
netconn
,
bytes
,
len
,
&
count
,
ovr
);
if
(
sent
)
*
sent
=
count
;
if
(
err
)
return
err
;
return
(
count
==
len
||
(
ovr
&&
count
))
?
ERROR_SUCCESS
:
ERROR_INTERNAL_ERROR
;
...
...
@@ -3401,7 +3404,7 @@ static DWORD complete_send_frame( struct socket *socket, WSAOVERLAPPED *ovr, con
{
DWORD
ret
,
len
,
i
;
if
(
!
netconn_wait_overlapped_result
(
socket
->
request
->
netconn
,
ovr
,
&
len
))
if
(
!
netconn_wait_overlapped_result
(
socket
->
netconn
,
ovr
,
&
len
))
return
WSAGetLastError
();
if
(
socket
->
bytes_in_send_frame_buffer
)
...
...
@@ -3680,7 +3683,7 @@ static DWORD receive_bytes( struct socket *socket, char *buf, DWORD len, DWORD *
}
while
(
size
!=
len
)
{
if
((
err
=
netconn_recv
(
socket
->
request
->
netconn
,
ptr
,
needed
,
0
,
&
received
)))
return
err
;
if
((
err
=
netconn_recv
(
socket
->
netconn
,
ptr
,
needed
,
0
,
&
received
)))
return
err
;
if
(
!
received
)
break
;
size
+=
received
;
if
(
!
read_full_buffer
)
break
;
...
...
dlls/winhttp/winhttp_private.h
View file @
64abcf80
...
...
@@ -257,6 +257,7 @@ struct socket
{
struct
object_header
hdr
;
struct
request
*
request
;
struct
netconn
*
netconn
;
int
keepalive_interval
;
unsigned
int
send_buffer_size
;
enum
socket_state
state
;
...
...
@@ -371,6 +372,7 @@ void close_connection( struct request * ) DECLSPEC_HIDDEN;
void
init_queue
(
struct
queue
*
queue
)
DECLSPEC_HIDDEN
;
void
stop_queue
(
struct
queue
*
)
DECLSPEC_HIDDEN
;
void
netconn_addref
(
struct
netconn
*
)
DECLSPEC_HIDDEN
;
void
netconn_release
(
struct
netconn
*
)
DECLSPEC_HIDDEN
;
DWORD
netconn_create
(
struct
hostdata
*
,
const
struct
sockaddr_storage
*
,
int
,
struct
netconn
**
)
DECLSPEC_HIDDEN
;
void
netconn_unload
(
void
)
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