From: Guilhem Lavaux Date: Thu, 29 Jul 1999 17:23:28 +0000 (+0000) Subject: Typos. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7e1e096097346054f8194cf475d03ae9cde46647 Typos. Changed the timeout of wxSocketBase from 3600s to 600s Added #include in htmltag.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gsocket.h b/include/wx/gsocket.h index 5cf897619a..6b786f9a19 100644 --- a/include/wx/gsocket.h +++ b/include/wx/gsocket.h @@ -102,7 +102,7 @@ GSocketError GSocket_SetNonOriented(GSocket *socket); /* Server specific parts */ /* - GSocket_SetServer() setup the socket as a server. It uses the "Local" field + GSocket_SetServer() setups the socket as a server. It uses the "Local" field of GSocket. "Local" must be set by GSocket_SetLocal() before GSocket_SetServer() is called. In the other case, it returns GSOCK_INVADDR. */ diff --git a/samples/html/virtual/virtual.cpp b/samples/html/virtual/virtual.cpp index 99e848ee55..6efe0580be 100644 --- a/samples/html/virtual/virtual.cpp +++ b/samples/html/virtual/virtual.cpp @@ -63,6 +63,9 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& fs, const wxString& location) "sub-3
" "", location.GetData(), location.GetData(), location.GetData(), location.GetData()); + + // WARNING: wxMemoryInputStream will not free buf. + // There is a memory leak here. str = new wxMemoryInputStream(buf, strlen(buf)); f = new wxFSFile(str, location, "text/html", wxEmptyString); return f; diff --git a/src/common/http.cpp b/src/common/http.cpp index fe883d2e22..e41bea9b08 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -195,6 +195,10 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) wxChar buf[200]; // 200 is arbitrary. wxString tmp_str = path; + // If there is no User-Agent defined, define it. + if (GetHeader(_T("User-Agent")).IsNull()) + SetHeader(_T("User-Agent"), _T("wxWindows 2.x")); + switch (req) { case wxHTTP_GET: tmp_buf = _T("GET"); @@ -221,6 +225,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) if (!tmp_str.Contains(_T("HTTP/"))) { // TODO: support HTTP v0.9 which can have no header. + // FIXME: tmp_str is not put back in the in-queue of the socket. SetHeader(_T("Content-Length"), _T("-1")); SetHeader(_T("Content-Type"), _T("none/none")); RestoreState(); @@ -234,8 +239,15 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) token.NextToken(); tmp_str2 = token.NextToken(); - switch (wxAtoi(tmp_str2)) { - case 200: + switch (tmp_str2[0]) { + case _T('1'): + /* INFORMATION / SUCCESS */ + break; + case _T('2'): + /* SUCCESS */ + break; + case _T('3'): + /* REDIRECTION */ break; default: m_perr = wxPROTO_NOFILE; diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 56f16ce2e5..a29b30f8b2 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -72,7 +72,7 @@ wxSocketBase::wxSocketBase(wxSocketBase::wxSockFlags _flags, wxEvtHandler(), m_socket(NULL), m_flags(_flags), m_type(_type), m_neededreq(GSOCK_INPUT_FLAG | GSOCK_LOST_FLAG), - m_lcount(0), m_timeout(3600), + m_lcount(0), m_timeout(600), m_unread(NULL), m_unrd_size(0), m_unrd_cur(0), m_cbk(NULL), m_cdata(NULL), m_connected(FALSE), m_notify_state(FALSE), m_id(-1), @@ -85,7 +85,7 @@ wxSocketBase::wxSocketBase() : wxEvtHandler(), m_socket(NULL), m_flags(SPEED | WAITALL), m_type(SOCK_UNINIT), m_neededreq(GSOCK_INPUT_FLAG | GSOCK_LOST_FLAG), - m_lcount(0), m_timeout(3600), + m_lcount(0), m_timeout(600), m_unread(NULL), m_unrd_size(0), m_unrd_cur(0), m_cbk(NULL), m_cdata(NULL), m_connected(FALSE), m_notify_state(FALSE), m_id(-1), diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index 9f36d68957..99807b99a9 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -25,6 +25,7 @@ #endif #include +#include // for vsscanf #include