Commit c7d140d3 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Reimplement the task queue using thread pool work objects.

Simplifies cleanup. Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7a2dc025
......@@ -578,13 +578,7 @@ static void request_destroy( struct object_header *hdr )
TRACE("%p\n", request);
if (request->queue.proc_running)
{
/* Signal to the task proc to quit. It will call this again when it does. */
request->queue.proc_running = FALSE;
SetEvent( request->queue.cancel );
return;
}
if (request->queue.pool) CloseThreadpool( request->queue.pool );
release_object( &request->connect->hdr );
if (request->cred_handle_initialized) FreeCredentialsHandle( &request->cred_handle );
......@@ -614,8 +608,6 @@ static void request_destroy( struct object_header *hdr )
}
}
request->queue.cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &request->queue.cs );
heap_free( request );
}
......@@ -1120,8 +1112,6 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
request->hdr.notify_mask = connect->hdr.notify_mask;
request->hdr.context = connect->hdr.context;
request->hdr.redirect_policy = connect->hdr.redirect_policy;
InitializeCriticalSection( &request->queue.cs );
request->queue.cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": request.queue.cs");
addref_object( &connect->hdr );
request->connect = connect;
......
......@@ -157,12 +157,8 @@ struct authinfo
struct queue
{
struct object_header *object;
CRITICAL_SECTION cs;
BOOL proc_running;
HANDLE wait;
HANDLE cancel;
struct list tasks;
TP_POOL *pool;
TP_CALLBACK_ENVIRON env;
};
enum request_flags
......@@ -252,16 +248,9 @@ struct socket
DWORD reason_len;
};
struct task_header
{
struct list entry;
struct object_header *object;
void (*proc)( struct task_header * );
};
struct send_request
{
struct task_header hdr;
struct request *request;
WCHAR *headers;
DWORD headers_len;
void *optional;
......@@ -272,18 +261,18 @@ struct send_request
struct receive_response
{
struct task_header hdr;
struct request *request;
};
struct query_data
{
struct task_header hdr;
struct request *request;
DWORD *available;
};
struct read_data
{
struct task_header hdr;
struct request *request;
void *buffer;
DWORD to_read;
DWORD *read;
......@@ -291,7 +280,7 @@ struct read_data
struct write_data
{
struct task_header hdr;
struct request *request;
const void *buffer;
DWORD to_write;
DWORD *written;
......@@ -299,7 +288,7 @@ struct write_data
struct socket_send
{
struct task_header hdr;
struct socket *socket;
WINHTTP_WEB_SOCKET_BUFFER_TYPE type;
const void *buf;
DWORD len;
......@@ -307,14 +296,14 @@ struct socket_send
struct socket_receive
{
struct task_header hdr;
struct socket *socket;
void *buf;
DWORD len;
};
struct socket_shutdown
{
struct task_header hdr;
struct socket *socket;
USHORT status;
const void *reason;
DWORD len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment