[Bug 2166] New: AsyncCallbacks in Wininet should not be asynchronous
wine-bugs at winehq.org
Tue Apr 13 00:10:59 CDT 2004
Summary: AsyncCallbacks in Wininet should not be asynchronous
AssignedTo: wine-bugs at winehq.org
ReportedBy: wjweiss at hotmail.com
My research has shown that the native WININET implementation invokes the
statuscallback from whatever thread that performs the work that requires a
notification. However, the implementation of SendAsyncCallback in Utility.C uses
the INTERNET_FLAG_ASYNC option associated with the connection as the criteria
for generating an async response.
This would cause fault in asynchronous pluggable protocols that perform a close
handle and terminate because the HANDLE_CLOSING notification can arrive after
the APP has terminated. However, on further investigation, I have discovered
that in the native implementation race conditions are avoided by disabling the
statuscallback assocated with the handle before removing the handle thereby
disabling the callback.
I would recommend that the correct fix is to check if the statuscallback is
associated with the handle being closed in InternetCloseHandle, and to disable
I would also recommend making callbacks synchronous. In my testing I have not
seen any problems after making this change. However, this change would be
strictly a change with closer consistency and better performance.
I would also recommend a name change from SendAsyncCallback to SendCallback.
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the wine-bugs