X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8a4df1595bc8ce70286afe99f122f64916790ad4..f5ba273ecd799f652736ce2bc830283787302a56:/src/common/protocol.cpp diff --git a/src/common/protocol.cpp b/src/common/protocol.cpp index c535c79258..542752e318 100644 --- a/src/common/protocol.cpp +++ b/src/common/protocol.cpp @@ -69,7 +69,8 @@ bool wxProtocol::Reconnect() { wxIPV4address addr; - if (!GetPeer(addr)) { + if (!GetPeer(addr)) + { Close(); return FALSE; } @@ -77,6 +78,7 @@ bool wxProtocol::Reconnect() return FALSE; if (!Connect(addr)) return FALSE; + return TRUE; } @@ -88,7 +90,7 @@ wxProtocolError GetLine(wxSocketBase *sock, wxString& result) { bool found; avail = sock->Read(tmp_buf, PROTO_BSIZE).LastCount(); - if (sock->LastError() != 0 || avail == 0) + if (sock->Error() || avail == 0) return wxPROTO_NETERR; memcpy(tmp_str, tmp_buf, avail); @@ -110,7 +112,7 @@ wxProtocolError GetLine(wxSocketBase *sock, wxString& result) { result = result.Left(result.Length()-1); size = ret-tmp_str+1; - sock->CreatePushbackBefore(&tmp_buf[size], avail-size); + sock->Unread(&tmp_buf[size], avail-size); return wxPROTO_NOERR; #undef PROTO_BSIZE } @@ -128,9 +130,7 @@ public: void OnExit(); }; -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxProtocolModule, wxModule) -#endif bool wxProtocolModule::OnInit() {