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
e32252ef
Commit
e32252ef
authored
Jun 04, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Queue a proper user APC also on immediate success in WSARecvFrom/WSASendTo.
parent
8992f89f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
7 deletions
+38
-7
socket.c
dlls/ws2_32/socket.c
+38
-7
No files found.
dlls/ws2_32/socket.c
View file @
e32252ef
...
...
@@ -2634,9 +2634,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
n
=
WS2_send
(
fd
,
iovec
,
dwBufferCount
,
to
,
tolen
,
dwFlags
);
if
(
n
!=
-
1
||
errno
!=
EINTR
)
break
;
}
if
(
n
==
-
1
)
{
if
(
errno
!=
EAGAIN
)
if
(
n
==
-
1
&&
errno
!=
EAGAIN
)
{
err
=
wsaErrno
();
goto
error
;
...
...
@@ -2665,6 +2663,8 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
memcpy
(
wsa
->
iovec
,
iovec
,
dwBufferCount
*
sizeof
(
*
iovec
)
);
iosb
=
lpOverlapped
?
(
IO_STATUS_BLOCK
*
)
lpOverlapped
:
&
wsa
->
local_iosb
;
if
(
n
==
-
1
)
{
iosb
->
u
.
Status
=
STATUS_PENDING
;
iosb
->
Information
=
0
;
...
...
@@ -2689,6 +2689,18 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
WSASetLastError
(
NtStatusToWSAError
(
err
));
return
SOCKET_ERROR
;
}
iosb
->
u
.
Status
=
STATUS_SUCCESS
;
iosb
->
Information
=
n
;
*
lpNumberOfBytesSent
=
n
;
if
(
!
wsa
->
completion_func
)
{
SetEvent
(
lpOverlapped
->
hEvent
);
HeapFree
(
GetProcessHeap
(),
0
,
wsa
);
}
else
NtQueueApcThread
(
GetCurrentThread
(),
(
PNTAPCFUNC
)
ws2_async_apc
,
(
ULONG_PTR
)
wsa
,
(
ULONG_PTR
)
iosb
,
0
);
return
0
;
}
if
(
_is_blocking
(
s
)
)
...
...
@@ -4140,14 +4152,17 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
for
(;;)
{
n
=
WS2_recv
(
fd
,
iovec
,
dwBufferCount
,
lpFrom
,
lpFromlen
,
lpFlags
);
if
(
n
!=
-
1
)
break
;
if
(
n
==
-
1
)
{
if
(
errno
==
EINTR
)
continue
;
if
(
errno
!=
EAGAIN
)
{
err
=
wsaErrno
();
goto
error
;
}
}
else
*
lpNumberOfBytesRecvd
=
n
;
if
((
lpOverlapped
||
lpCompletionRoutine
)
&&
!
(
options
&
(
FILE_SYNCHRONOUS_IO_ALERT
|
FILE_SYNCHRONOUS_IO_NONALERT
)))
...
...
@@ -4172,6 +4187,9 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
memcpy
(
wsa
->
iovec
,
iovec
,
dwBufferCount
*
sizeof
(
*
iovec
)
);
iosb
=
lpOverlapped
?
(
IO_STATUS_BLOCK
*
)
lpOverlapped
:
&
wsa
->
local_iosb
;
if
(
n
==
-
1
)
{
iosb
->
u
.
Status
=
STATUS_PENDING
;
iosb
->
Information
=
0
;
...
...
@@ -4197,6 +4215,21 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
return
SOCKET_ERROR
;
}
iosb
->
u
.
Status
=
STATUS_SUCCESS
;
iosb
->
Information
=
n
;
if
(
!
wsa
->
completion_func
)
{
SetEvent
(
lpOverlapped
->
hEvent
);
HeapFree
(
GetProcessHeap
(),
0
,
wsa
);
}
else
NtQueueApcThread
(
GetCurrentThread
(),
(
PNTAPCFUNC
)
ws2_async_apc
,
(
ULONG_PTR
)
wsa
,
(
ULONG_PTR
)
iosb
,
0
);
_enable_event
(
SOCKET2HANDLE
(
s
),
FD_READ
,
0
,
0
);
return
0
;
}
if
(
n
!=
-
1
)
break
;
if
(
_is_blocking
(
s
)
)
{
struct
pollfd
pfd
;
...
...
@@ -4228,8 +4261,6 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
}
TRACE
(
" -> %i bytes
\n
"
,
n
);
*
lpNumberOfBytesRecvd
=
n
;
release_sock_fd
(
s
,
fd
);
_enable_event
(
SOCKET2HANDLE
(
s
),
FD_READ
,
0
,
0
);
...
...
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