- // Retrieve service number
- pos2 = temp_url.Find(':', TRUE);
- if (pos2 != -1 && pos2 < pos) {
- m_servname = url(pos2, pos);
- if (!m_servname.IsNumber())
- return FALSE;
- pos2 = pos;
- temp_url = temp_url(0, pos2);
- }
+ m_error = wxURL_NOERR;
+ if (HasUserInfo())
+ {
+ size_t dwPasswordPos = m_userinfo.find(':');
+
+ if (dwPasswordPos == wxString::npos)
+ m_protocol->SetUser(m_userinfo);
+ else
+ {
+ m_protocol->SetUser(m_userinfo(0, dwPasswordPos));
+ m_protocol->SetPassword(m_userinfo(dwPasswordPos+1, m_userinfo.length() + 1));
+ }
+ }
+
+#if wxUSE_URL_NATIVE
+ // give the native implementation to return a better stream
+ // such as the native WinINet functionality under MS-Windows
+ if (m_nativeImp)
+ {
+ wxInputStream *rc;
+ rc = m_nativeImp->GetInputStream(this);
+ if (rc != 0)
+ return rc;
+ }
+ // else use the standard behaviour
+#endif // wxUSE_URL_NATIVE
+
+#if wxUSE_SOCKETS
+ wxIPV4address addr;
+
+ // m_protoinfo is NULL when we use a proxy
+ if (!m_useProxy && m_protoinfo->m_needhost)
+ {
+ if (!addr.Hostname(m_server))
+ {
+ m_error = wxURL_NOHOST;
+ return NULL;
+ }
+
+ addr.Service(m_port);
+
+ if (!m_protocol->Connect(addr, true)) // Watcom needs the 2nd arg for some reason
+ {
+ m_error = wxURL_CONNERR;
+ return NULL;
+ }
+ }
+#endif
+
+ wxString fullPath;