Module: wine Branch: master Commit: f8f2273b7c0c9c55c6060d10b7ceb6df2618d50d URL: http://source.winehq.org/git/wine.git/?a=commit;h=f8f2273b7c0c9c55c6060d10b7...
Author: Jacek Caban jacek@codeweavers.com Date: Fri May 25 16:35:48 2012 +0200
wininet: Added INTERNET_OPTION_SETTINGS_CHANGED semi-stub implementation.
---
dlls/wininet/http.c | 8 ++++---- dlls/wininet/internet.c | 7 ++++++- dlls/wininet/internet.h | 8 +++++++- 3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index e32dde6..6472c3c 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -285,7 +285,7 @@ static server_t *get_server(const WCHAR *name, INTERNET_PORT port) return server; }
-BOOL collect_connections(BOOL collect_all) +BOOL collect_connections(collect_type_t collect_type) { netconn_t *netconn, *netconn_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(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); list_remove(&netconn->pool_entry); 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_init(&server->entry); server_release(server); @@ -325,7 +325,7 @@ static DWORD WINAPI collect_connections_proc(void *arg)
EnterCriticalSection(&connection_pool_cs);
- remaining_conns = collect_connections(FALSE); + remaining_conns = collect_connections(COLLECT_TIMEOUT); if(!remaining_conns) collector_running = FALSE;
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index a41225f..7ca4b0b 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -309,7 +309,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break;
case DLL_PROCESS_DETACH: - collect_connections(TRUE); + collect_connections(COLLECT_CLEANUP); NETCON_unload(); URLCacheContainers_DeleteAll();
@@ -2635,6 +2635,11 @@ static DWORD set_global_option(DWORD option, void *buf, DWORD size)
connect_timeout = *(ULONG*)buf; 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; diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 30869d9..14228cb 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -70,7 +70,13 @@ typedef struct {
void server_addref(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 */ typedef struct