From: <dat...@us...> - 2006-10-19 01:56:44
|
Revision: 17540 http://svn.sourceforge.net/gaim/?rev=17540&view=rev Author: datallah Date: 2006-10-18 18:56:40 -0700 (Wed, 18 Oct 2006) Log Message: ----------- Various fixes for wingaim network manager stuff. When unable to look up network connections, assume that there is one. Fix error handling. Remove note about using WSANSPIoctl directly - it isn't supported on w2k anyway. Fix compile warning Modified Paths: -------------- trunk/libgaim/network.c Modified: trunk/libgaim/network.c =================================================================== --- trunk/libgaim/network.c 2006-10-19 00:03:10 UTC (rev 17539) +++ trunk/libgaim/network.c 2006-10-19 01:56:40 UTC (rev 17540) @@ -392,9 +392,12 @@ retval = WSALookupServiceBegin(&qs, LUP_RETURN_ALL, &h); if (retval != ERROR_SUCCESS) { - gchar *msg = g_win32_error_message(retval); - gaim_debug_warning("network", "Couldn't look up connected networks. %s (%lu).\n", msg, retval); + int errorid = WSAGetLastError(); + gchar *msg = g_win32_error_message(errorid); + gaim_debug_warning("network", "Couldn't look up connected networks. %s (%d).\n", msg, errorid); g_free(msg); + + net_cnt = 1; /* Assume something is connected */ } else { char buf[1024]; WSAQUERYSET *res = (LPWSAQUERYSET) buf; @@ -461,10 +464,7 @@ retval = WSALookupServiceBegin(&qs, LUP_RETURN_ALL, &h); /* This will block until there is a network change */ - /* This is missing from the MinGW libws2_32.a as of version 3.7. - * When this patch: http://sourceforge.net/tracker/index.php?func=detail&aid=1576083&group_id=2435&atid=302435 gets into a release, we can call this directly - * retval = WSANSPIoctl(h, SIO_NSP_NOTIFY_CHANGE, NULL, 0, NULL, 0, &retLen, NULL);*/ - retval = MyWSANSPIoctl(h, SIO_NSP_NOTIFY_CHANGE, NULL, 0, NULL, 0, &retLen, NULL); + retval = MyWSANSPIoctl(h, SIO_NSP_NOTIFY_CHANGE, NULL, 0, NULL, 0, &retLen, NULL); retval = WSALookupServiceEnd(h); @@ -489,7 +489,7 @@ } if (libnm_retval == LIBNM_ACTIVE_NETWORK_CONNECTION) return TRUE; } -#elif _WIN32 +#elif define _WIN32 return (current_network_count > 0); #endif return TRUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |