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
50bea867
Commit
50bea867
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: Move read buffer to websocket.
parent
e50df0fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
request.c
dlls/winhttp/request.c
+19
-4
winhttp_private.h
dlls/winhttp/winhttp_private.h
+2
-0
No files found.
dlls/winhttp/request.c
View file @
50bea867
...
...
@@ -3192,6 +3192,7 @@ static void socket_destroy( struct object_header *hdr )
netconn_release
(
socket
->
netconn
);
release_object
(
&
socket
->
request
->
hdr
);
free
(
socket
->
read_buffer
);
free
(
socket
->
send_frame_buffer
);
free
(
socket
);
}
...
...
@@ -3266,6 +3267,19 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR
socket
->
hdr
.
flags
=
request
->
connect
->
hdr
.
flags
&
WINHTTP_FLAG_ASYNC
;
socket
->
keepalive_interval
=
30000
;
socket
->
send_buffer_size
=
request
->
websocket_send_buffer_size
;
if
(
request
->
read_size
)
{
if
(
!
(
socket
->
read_buffer
=
malloc
(
request
->
read_size
)))
{
ERR
(
"No memory.
\n
"
);
free
(
socket
);
release_object
(
&
request
->
hdr
);
return
NULL
;
}
socket
->
bytes_in_read_buffer
=
request
->
read_size
;
memcpy
(
socket
->
read_buffer
,
request
->
read_buf
+
request
->
read_pos
,
request
->
read_size
);
request
->
read_pos
=
request
->
read_size
=
0
;
}
InitializeSRWLock
(
&
socket
->
send_lock
);
init_queue
(
&
socket
->
send_q
);
init_queue
(
&
socket
->
recv_q
);
...
...
@@ -3674,11 +3688,12 @@ static DWORD receive_bytes( struct socket *socket, char *buf, DWORD len, DWORD *
char
*
ptr
=
buf
;
int
received
;
if
(
socket
->
request
->
read_size
)
if
(
socket
->
bytes_in_read_buffer
)
{
size
=
min
(
needed
,
socket
->
request
->
read_size
);
memcpy
(
ptr
,
socket
->
request
->
read_buf
+
socket
->
request
->
read_pos
,
size
);
remove_data
(
socket
->
request
,
size
);
size
=
min
(
needed
,
socket
->
bytes_in_read_buffer
);
memcpy
(
ptr
,
socket
->
read_buffer
,
size
);
memmove
(
socket
->
read_buffer
,
socket
->
read_buffer
+
size
,
socket
->
bytes_in_read_buffer
-
size
);
socket
->
bytes_in_read_buffer
-=
size
;
needed
-=
size
;
ptr
+=
size
;
}
...
...
dlls/winhttp/winhttp_private.h
View file @
50bea867
...
...
@@ -277,6 +277,8 @@ struct socket
unsigned
int
send_remaining_size
;
unsigned
int
bytes_in_send_frame_buffer
;
unsigned
int
client_buffer_offset
;
char
*
read_buffer
;
unsigned
int
bytes_in_read_buffer
;
SRWLOCK
send_lock
;
volatile
LONG
pending_noncontrol_send
;
enum
fragment_type
sending_fragment_type
;
...
...
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