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
b9038c73
Commit
b9038c73
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: Set socket state before sending notifications.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
18e7e07a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
request.c
dlls/winhttp/request.c
+12
-9
No files found.
dlls/winhttp/request.c
View file @
b9038c73
...
@@ -3372,10 +3372,11 @@ static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, enum socket
...
@@ -3372,10 +3372,11 @@ static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, enum socket
static
DWORD
socket_receive
(
struct
socket
*
socket
,
void
*
buf
,
DWORD
len
,
DWORD
*
ret_len
,
static
DWORD
socket_receive
(
struct
socket
*
socket
,
void
*
buf
,
DWORD
len
,
DWORD
*
ret_len
,
WINHTTP_WEB_SOCKET_BUFFER_TYPE
*
ret_type
,
BOOL
async
)
WINHTTP_WEB_SOCKET_BUFFER_TYPE
*
ret_type
,
BOOL
async
)
{
{
struct
netconn
*
netconn
=
socket
->
request
->
netconn
;
DWORD
count
,
ret
=
ERROR_SUCCESS
;
DWORD
count
,
ret
=
ERROR_SUCCESS
;
if
(
!
socket
->
read_size
)
ret
=
receive_frame
(
socket
->
request
->
netconn
,
&
socket
->
read_size
,
&
socket
->
opcode
);
if
(
!
socket
->
read_size
)
ret
=
receive_frame
(
netconn
,
&
socket
->
read_size
,
&
socket
->
opcode
);
if
(
!
ret
)
ret
=
receive_bytes
(
socket
->
request
->
netconn
,
buf
,
min
(
len
,
socket
->
read_size
),
&
count
);
if
(
!
ret
)
ret
=
receive_bytes
(
netconn
,
buf
,
min
(
len
,
socket
->
read_size
),
&
count
);
if
(
!
ret
)
if
(
!
ret
)
{
{
socket
->
read_size
-=
count
;
socket
->
read_size
-=
count
;
...
@@ -3385,7 +3386,6 @@ static DWORD socket_receive( struct socket *socket, void *buf, DWORD len, DWORD
...
@@ -3385,7 +3386,6 @@ static DWORD socket_receive( struct socket *socket, void *buf, DWORD len, DWORD
*
ret_type
=
map_opcode
(
socket
->
opcode
,
socket
->
read_size
!=
0
);
*
ret_type
=
map_opcode
(
socket
->
opcode
,
socket
->
read_size
!=
0
);
}
}
}
}
if
(
async
)
if
(
async
)
{
{
if
(
!
ret
)
if
(
!
ret
)
...
@@ -3458,9 +3458,13 @@ DWORD WINAPI WinHttpWebSocketReceive( HINTERNET hsocket, void *buf, DWORD len, D
...
@@ -3458,9 +3458,13 @@ DWORD WINAPI WinHttpWebSocketReceive( HINTERNET hsocket, void *buf, DWORD len, D
static
DWORD
socket_shutdown
(
struct
socket
*
socket
,
USHORT
status
,
const
void
*
reason
,
DWORD
len
,
BOOL
async
)
static
DWORD
socket_shutdown
(
struct
socket
*
socket
,
USHORT
status
,
const
void
*
reason
,
DWORD
len
,
BOOL
async
)
{
{
struct
netconn
*
netconn
=
socket
->
request
->
netconn
;
DWORD
ret
;
DWORD
ret
;
ret
=
send_frame
(
socket
->
request
->
netconn
,
WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE
,
status
,
reason
,
len
,
TRUE
);
if
(
!
(
ret
=
send_frame
(
netconn
,
WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE
,
status
,
reason
,
len
,
TRUE
)))
{
socket
->
state
=
SOCKET_STATE_SHUTDOWN
;
}
if
(
async
)
if
(
async
)
{
{
if
(
!
ret
)
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_SHUTDOWN_COMPLETE
,
NULL
,
0
);
if
(
!
ret
)
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_SHUTDOWN_COMPLETE
,
NULL
,
0
);
...
@@ -3473,8 +3477,6 @@ static DWORD socket_shutdown( struct socket *socket, USHORT status, const void *
...
@@ -3473,8 +3477,6 @@ static DWORD socket_shutdown( struct socket *socket, USHORT status, const void *
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
,
&
result
,
sizeof
(
result
)
);
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
,
&
result
,
sizeof
(
result
)
);
}
}
}
}
if
(
!
ret
)
socket
->
state
=
SOCKET_STATE_SHUTDOWN
;
return
ret
;
return
ret
;
}
}
...
@@ -3559,7 +3561,10 @@ static DWORD socket_close( struct socket *socket, USHORT status, const void *rea
...
@@ -3559,7 +3561,10 @@ static DWORD socket_close( struct socket *socket, USHORT status, const void *rea
goto
done
;
goto
done
;
}
}
socket
->
status
=
RtlUshortByteSwap
(
socket
->
status
);
socket
->
status
=
RtlUshortByteSwap
(
socket
->
status
);
ret
=
receive_bytes
(
netconn
,
socket
->
reason
,
sizeof
(
socket
->
reason
),
&
socket
->
reason_len
);
if
(
!
(
ret
=
receive_bytes
(
netconn
,
socket
->
reason
,
sizeof
(
socket
->
reason
),
&
socket
->
reason_len
)))
{
socket
->
state
=
SOCKET_STATE_CLOSED
;
}
done:
done:
if
(
async
)
if
(
async
)
...
@@ -3574,8 +3579,6 @@ done:
...
@@ -3574,8 +3579,6 @@ done:
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
,
&
result
,
sizeof
(
result
)
);
send_callback
(
&
socket
->
hdr
,
WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
,
&
result
,
sizeof
(
result
)
);
}
}
}
}
if
(
!
ret
)
socket
->
state
=
SOCKET_STATE_CLOSED
;
return
ret
;
return
ret
;
}
}
...
...
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