X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4846abaf45a5a1b2ba4392fab7fdc45f1518f4d7..c7abc967cda4ca459214626c1f3592e1ac363f81:/src/common/ftp.cpp?ds=sidebyside diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 9ef749df6f..090138b5d7 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -60,16 +60,13 @@ IMPLEMENT_PROTOCOL(wxFTP, _T("ftp"), _T("ftp"), TRUE) wxFTP::wxFTP() : wxProtocol() { - wxChar tmp[256]; - m_lastError = wxPROTO_NOERR; m_streaming = FALSE; m_user = _T("anonymous"); - wxGetUserName(tmp, 256); - m_passwd.sprintf(_T("%s@"),tmp); - wxGetHostName(tmp, 256); - m_passwd += tmp; + m_passwd = wxGetUserId(); + m_passwd += '@'; + m_passwd += wxGetHostName(); SetNotify(0); } @@ -155,7 +152,7 @@ bool wxFTP::SendCommand(const wxString& command, char exp_ret) return FALSE; } tmp_str = command + _T("\r\n"); - wxWX2MBbuf tmp_buf = tmp_str.mb_str(); + const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); if (Write(MBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) { m_lastError = wxPROTO_NETERR; return FALSE; @@ -358,6 +355,7 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path) in_stream->m_ftpsize = wxAtoi(WXSTRINGCAST str_size); } + sock->SetFlags(WAITALL); return in_stream; } @@ -404,10 +402,6 @@ wxList *wxFTP::GetList(const wxString& wildcard) return NULL; } - sock->SetEventHandler(*GetNextHandler(), m_id); - sock->Notify(m_notifyme); - sock->SetNotify(m_neededreq); - return file_list; } #endif