+bool wxURL::ParseURL()
+{
+ // If the URL was already parsed (m_protocol != NULL), pass this section.
+ if (!m_protocol)
+ {
+ // Clean up
+ CleanData();
+
+ // Make sure we have a protocol/scheme
+ if (!HasScheme())
+ {
+ m_error = wxURL_SNTXERR;
+ return false;
+ }
+
+ // Find and create the protocol object
+ if (!FetchProtocol())
+ {
+ m_error = wxURL_NOPROTO;
+ return false;
+ }
+
+ // Do we need a host name ?
+ if (m_protoinfo->m_needhost)
+ {
+ // Make sure we have one, then
+ if (!HasServer())
+ {
+ m_error = wxURL_SNTXERR;
+ return false;
+ }
+ }
+ }
+
+#if wxUSE_PROTOCOL_HTTP
+ if (m_useProxy)
+ {
+ // Third, we rebuild the URL.
+ m_url = m_scheme + wxT(":");
+ if (m_protoinfo->m_needhost)
+ m_url = m_url + wxT("//") + m_server;
+
+ // We initialize specific variables.
+ if (m_protocol)
+ m_protocol->Destroy();
+ m_protocol = m_proxy; // FIXME: we should clone the protocol
+ }
+#endif // wxUSE_PROTOCOL_HTTP
+
+ m_error = wxURL_NOERR;
+ return true;