[PATCH 1/3] server: Revise completion behavior to allow completions for cancelled sockets (try 2).

Erich E. Hoover ehoover at mines.edu
Tue Apr 24 14:40:35 CDT 2012


On Tue, Apr 24, 2012 at 11:08 AM, Alexandre Julliard
<julliard at winehq.org> wrote:
> "Erich E. Hoover" <ehoover at mines.edu> writes:
> > ...
> >     This patch changes how the close socket operation works so that if
> > an async operation is registered then closing the handle will be
> > deferred until the async operation has completed.
>
> I would find it very suprising if this were how it's supposed to work,
> particularly since multiple handles can of course be opened to the same
> socket. You'll need very convincing tests for this...

The issue is that the way the async callback works in ws2_32 it uses
add_fd_completion() to create completions.  Since that routine uses
the socket handle, the specific handle used for the async operation
needs to remain valid until after the async has completed.  If that
handle doesn't remain valid then the completion cannot be added.  So,
this code keeps that handle valid until the async is complete so that
WS2_async_accept has a valid handle to work with.

Erich Hoover
ehoover at mines.edu



More information about the wine-devel mailing list