+
+// ----------------------------------------------------------------------
+// A module which deletes the default proxy if we created it
+// ----------------------------------------------------------------------
+
+#if wxUSE_SOCKETS
+
+class wxURLModule : public wxModule
+{
+public:
+ virtual bool OnInit();
+ virtual void OnExit();
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxURLModule)
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxURLModule, wxModule)
+
+bool wxURLModule::OnInit()
+{
+ // env var HTTP_PROXY contains the address of the default proxy to use if
+ // set, but don't try to create this proxy right now because it will slow
+ // down the program startup (especially if there is no DNS server
+ // available, in which case it may take up to 1 minute)
+
+ if ( getenv("HTTP_PROXY") )
+ {
+ wxURL::ms_useDefaultProxy = TRUE;
+ }
+
+ return TRUE;
+}
+
+void wxURLModule::OnExit()
+{
+ delete wxURL::ms_proxyDefault;
+ wxURL::ms_proxyDefault = NULL;
+}
+
+#endif // wxUSE_SOCKETS