From: Guilhem Lavaux <lavaux@easynet.fr>
Date: Sun, 25 Jul 1999 14:26:15 +0000 (+0000)
Subject: Added GSocket_Init and GSocket_Cleanup
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a58d5df4ef7fbbbb1c385ac63038608d49f8dfa5

Added GSocket_Init and GSocket_Cleanup
Added wxSocketModule to socket.cpp to call GSocket_Init and GSocket_Cleanup


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/include/wx/gsocket.h b/include/wx/gsocket.h
index 1de9fa6189..19e89e34ed 100644
--- a/include/wx/gsocket.h
+++ b/include/wx/gsocket.h
@@ -73,6 +73,13 @@ typedef void (*GSocketFallback)(GSocket *socket, GSocketEvent event,
 extern "C" {
 #endif
 
+/* Global initialisers */
+
+/* GSocket_Init() must be called at the beginning */
+void GSocket_Init();
+/* GSocket_Cleanup() must be called at the ending */
+void GSocket_Cleanup();
+
 /* Constructors / Destructors */
 
 GSocket *GSocket_new();
diff --git a/include/wx/protocol/http.h b/include/wx/protocol/http.h
index 82c1365889..ff8a2935b5 100644
--- a/include/wx/protocol/http.h
+++ b/include/wx/protocol/http.h
@@ -38,7 +38,8 @@ public:
 
 protected:
   typedef enum {
-    wxHTTP_GET
+    wxHTTP_GET,
+    wxHTTP_HEAD
   } wxHTTP_Req;
   bool BuildRequest(const wxString& path, wxHTTP_Req req);
   void SendHeaders();
diff --git a/src/common/socket.cpp b/src/common/socket.cpp
index e4b086669b..df34996012 100644
--- a/src/common/socket.cpp
+++ b/src/common/socket.cpp
@@ -905,5 +905,22 @@ void wxSocketEvent::CopyObject(wxObject& obj_d) const
   event->m_socket = m_socket;
 }
 
+// --------------------------------------------------------------------------
+// wxSocketModule
+// --------------------------------------------------------------------------
+class WXDLLEXPORT wxSocketModule: public wxModule {
+  DECLARE_DYNAMIC_CLASS(wxSocketModule)
+ public:
+  bool OnInit() {
+    GSocket_Init();
+    return TRUE;
+  }
+  void OnExit() {
+    GSocket_Done();
+  }
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule)
+
 #endif
   // wxUSE_SOCKETS
diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c
index 74ac09de4c..1aba194f6f 100644
--- a/src/unix/gsocket.c
+++ b/src/unix/gsocket.c
@@ -52,6 +52,16 @@
 
 #endif
 
+/* Global initialisers */
+
+void GSocket_Init()
+{
+}
+
+void GSocket_Cleanup()
+{
+}
+
 /* Constructors / Destructors */
 
 GSocket *GSocket_new()