]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Improve command parser logic when there are more params than Command::max_params
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index b1bfaa9fddd690d2d39470e0605af5a0ab312d5a..3a8a58b5fd4eba87015bb8582a22d7920fe9e81c 100644 (file)
@@ -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;