X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspsocket.cpp;h=3a8a58b5fd4eba87015bb8582a22d7920fe9e81c;hb=84b40a76b8093a3bd505e79b06c685853c7726d1;hp=b1bfaa9fddd690d2d39470e0605af5a0ab312d5a;hpb=8428bbb387d4b1195156f0ab5a676d17b69b8d5f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index b1bfaa9fd..3a8a58b5f 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -112,7 +112,7 @@ BufferedSocketError BufferedSocket::BeginConnect(const irc::sockets::sockaddrs& this->Timeout = new SocketTimeout(this->GetFd(), this, timeout, ServerInstance->Time()); ServerInstance->Timers->AddTimer(this->Timeout); - ServerInstance->Logs->Log("SOCKET", LOG_DEBUG,"BufferedSocket::DoConnect success"); + ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "BufferedSocket::DoConnect success"); return I_ERR_NONE; } @@ -130,7 +130,7 @@ void StreamSocket::Close() } catch (CoreException& modexcept) { - ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT,"%s threw an exception: %s", + ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); } IOHook = NULL; @@ -200,7 +200,7 @@ void StreamSocket::DoRead() error = "Connection closed"; ServerInstance->SE->ChangeEventMask(this, FD_WANT_NO_READ | FD_WANT_NO_WRITE); } - else if (errno == EAGAIN) + else if (SocketEngine::IgnoreError()) { ServerInstance->SE->ChangeEventMask(this, FD_WANT_FAST_READ | FD_READ_WILL_BLOCK); } @@ -291,7 +291,7 @@ void StreamSocket::DoWrite() } else if (rv < 0) { - if (errno == EAGAIN || errno == EINTR) + if (errno == EINTR || SocketEngine::IgnoreError()) ServerInstance->SE->ChangeEventMask(this, FD_WANT_FAST_WRITE | FD_WRITE_WILL_BLOCK); else SetError(strerror(errno)); @@ -317,7 +317,7 @@ void StreamSocket::DoWrite() } catch (CoreException& modexcept) { - ServerInstance->Logs->Log("SOCKET", LOG_DEBUG,"%s threw an exception: %s", + ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason()); } } @@ -388,7 +388,7 @@ void StreamSocket::DoWrite() { error = "Connection closed"; } - else if (errno == EAGAIN) + else if (SocketEngine::IgnoreError()) { eventChange = FD_WANT_FAST_WRITE | FD_WRITE_WILL_BLOCK; } @@ -433,7 +433,7 @@ void StreamSocket::WriteData(const std::string &data) bool SocketTimeout::Tick(time_t) { - ServerInstance->Logs->Log("SOCKET", LOG_DEBUG,"SocketTimeout::Tick"); + ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "SocketTimeout::Tick"); if (ServerInstance->SE->GetRef(this->sfd) != this->sock) return false;