wininet: Added INTERNET_OPTION_SETTINGS_CHANGED semi-stub implementation.

This commit is contained in:
Jacek Caban 2012-05-25 16:35:48 +02:00 committed by Alexandre Julliard
parent 95c1b74fc9
commit f8f2273b7c
3 changed files with 17 additions and 6 deletions

View File

@ -285,7 +285,7 @@ static server_t *get_server(const WCHAR *name, INTERNET_PORT port)
return server; return server;
} }
BOOL collect_connections(BOOL collect_all) BOOL collect_connections(collect_type_t collect_type)
{ {
netconn_t *netconn, *netconn_safe; netconn_t *netconn, *netconn_safe;
server_t *server, *server_safe; server_t *server, *server_safe;
@ -296,7 +296,7 @@ BOOL collect_connections(BOOL collect_all)
LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry) { LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry) {
LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool, netconn_t, pool_entry) { LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool, netconn_t, pool_entry) {
if(collect_all || netconn->keep_until < now) { if(collect_type > COLLECT_TIMEOUT || netconn->keep_until < now) {
TRACE("freeing %p\n", netconn); TRACE("freeing %p\n", netconn);
list_remove(&netconn->pool_entry); list_remove(&netconn->pool_entry);
free_netconn(netconn); free_netconn(netconn);
@ -305,7 +305,7 @@ BOOL collect_connections(BOOL collect_all)
} }
} }
if(collect_all) { if(collect_type == COLLECT_CLEANUP) {
list_remove(&server->entry); list_remove(&server->entry);
list_init(&server->entry); list_init(&server->entry);
server_release(server); server_release(server);
@ -325,7 +325,7 @@ static DWORD WINAPI collect_connections_proc(void *arg)
EnterCriticalSection(&connection_pool_cs); EnterCriticalSection(&connection_pool_cs);
remaining_conns = collect_connections(FALSE); remaining_conns = collect_connections(COLLECT_TIMEOUT);
if(!remaining_conns) if(!remaining_conns)
collector_running = FALSE; collector_running = FALSE;

View File

@ -309,7 +309,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
collect_connections(TRUE); collect_connections(COLLECT_CLEANUP);
NETCON_unload(); NETCON_unload();
URLCacheContainers_DeleteAll(); URLCacheContainers_DeleteAll();
@ -2635,6 +2635,11 @@ static DWORD set_global_option(DWORD option, void *buf, DWORD size)
connect_timeout = *(ULONG*)buf; connect_timeout = *(ULONG*)buf;
return ERROR_SUCCESS; return ERROR_SUCCESS;
case INTERNET_OPTION_SETTINGS_CHANGED:
FIXME("INTERNETOPTION_SETTINGS_CHANGED semi-stub\n");
collect_connections(COLLECT_CONNECTIONS);
return ERROR_SUCCESS;
} }
return ERROR_INTERNET_INVALID_OPTION; return ERROR_INTERNET_INVALID_OPTION;

View File

@ -70,7 +70,13 @@ typedef struct {
void server_addref(server_t*) DECLSPEC_HIDDEN; void server_addref(server_t*) DECLSPEC_HIDDEN;
void server_release(server_t*) DECLSPEC_HIDDEN; void server_release(server_t*) DECLSPEC_HIDDEN;
BOOL collect_connections(BOOL) DECLSPEC_HIDDEN;
typedef enum {
COLLECT_TIMEOUT,
COLLECT_CONNECTIONS,
COLLECT_CLEANUP
} collect_type_t;
BOOL collect_connections(collect_type_t) DECLSPEC_HIDDEN;
/* used for netconnection.c stuff */ /* used for netconnection.c stuff */
typedef struct typedef struct