Corrected startup // shutdown of windows sockets to allow name resolution to work
authorgrahamb <grahamb@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 14 Sep 2000 22:59:08 +0000 (22:59 +0000)
committergrahamb <grahamb@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 14 Sep 2000 22:59:08 +0000 (22:59 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2438 f5534014-38df-0310-8fa8-9805f1628bb7

capture.c
gtk/main.c

index dbd5e452d9b233f3ae937858b68d9dbeee4dc3f3..8ef30a25bed33ec347607196a8671ec2635718a8 100644 (file)
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
 /* capture.c
  * Routines for packet capture windows
  *
- * $Id: capture.c,v 1.123 2000/09/14 11:49:40 gram Exp $
+ * $Id: capture.c,v 1.124 2000/09/14 22:59:00 grahamb Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -1395,6 +1395,11 @@ capture(void)
 #endif
     pcap_close(pch);
 
+#ifdef WIN32
+  /* Shut down windows sockets */
+  WSACleanup();
+#endif
+
   gtk_grab_remove(GTK_WIDGET(cap_w));
   gtk_widget_destroy(GTK_WIDGET(cap_w));
 
index 7903eba65112f08cef2f52bbbd0ded93657d9820..bb6ac0ea187139b8aa6a71b72281e63d64aa8f9c 100644 (file)
@@ -1,6 +1,6 @@
 /* main.c
  *
- * $Id: main.c,v 1.156 2000/09/09 10:26:53 guy Exp $
+ * $Id: main.c,v 1.157 2000/09/14 22:59:08 grahamb Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -818,6 +818,7 @@ main(int argc, char *argv[])
 #ifdef HAVE_LIBPCAP
 #ifdef WIN32
   char pcap_version[] = "0.4a6";
+  WSADATA             wsaData; 
 #else
   extern char          pcap_version[];
 #endif
@@ -1128,6 +1129,11 @@ main(int argc, char *argv[])
     }
   }
 
+#ifdef WIN32
+  /* Start windows sockets */
+  WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
+#endif
+
   /* Notify all registered modules that have had any of their preferences
      changed either from one of the preferences file or from the command
      line that its preferences have changed. */
@@ -1346,6 +1352,11 @@ main(int argc, char *argv[])
   dissect_cleanup();
   g_free(rc_file);
 
+#ifdef WIN32
+  /* Shutdown windows sockets */
+  WSACleanup();
+#endif
+
   gtk_exit(0);
 
   /* This isn't reached, but we need it to keep GCC from complaining