]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc.c
Fix server reconnection
[ngircd-alex.git] / src / ngircd / irc.c
index d1e1d41ac9b9e0cf824b72357002e54f787360e6..8c08cdc1a744fc939d183d2fa16a5c657b788ed8 100644 (file)
@@ -138,8 +138,6 @@ IRC_KILL(CLIENT *Client, REQUEST *Req)
                return IRC_WriteErrClient(Client, ERR_NOPRIVILEGES_MSG,
                                          Client_ID(Client));
 
-       _IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2)
-
        /* Get prefix (origin); use the client if no prefix is given. */
        if (Req->prefix)
                prefix = Client_Search(Req->prefix);
@@ -280,11 +278,6 @@ IRC_TRACE(CLIENT *Client, REQUEST *Req)
 
        IRC_SetPenalty(Client, 3);
 
-       /* Bad number of arguments? */
-       if (Req->argc > 1)
-               return IRC_WriteErrClient(Client, ERR_NORECIPIENT_MSG,
-                                         Client_ID(Client), Req->command);
-
        _IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
        _IRC_GET_TARGET_SERVER_OR_RETURN_(target, Req, 0, from)
 
@@ -362,8 +355,6 @@ IRC_HELP(CLIENT *Client, REQUEST *Req)
 
        IRC_SetPenalty(Client, 2);
 
-       _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
-
        if ((Req->argc == 0 && array_bytes(&Conf_Helptext) > 0)
            || (Req->argc >= 1 && strcasecmp(Req->argv[0], "Commands") != 0)) {
                /* Help text available and requested */
@@ -450,6 +441,12 @@ Help(CLIENT *Client, const char *Topic)
        return CONNECTED;
 }
 
+/**
+ * Get pointer to a static string representing the connection "options".
+ *
+ * @param Idx Connection index.
+ * @return Pointer to static (global) string buffer.
+ */
 static char *
 #ifdef ZLIB
 Option_String(CONN_ID Idx)
@@ -460,16 +457,22 @@ Option_String(UNUSED CONN_ID Idx)
        static char option_txt[8];
 #ifdef ZLIB
        UINT16 options;
-
-       options = Conn_Options(Idx);
 #endif
 
+       assert(Idx != NONE);
+
+       options = Conn_Options(Idx);
        strcpy(option_txt, "F");        /* No idea what this means, but the
                                         * original ircd sends it ... */
+#ifdef SSL_SUPPORT
+       if(options & CONN_SSL)          /* SSL encrypted link */
+               strlcat(option_txt, "s", sizeof(option_txt));
+#endif
 #ifdef ZLIB
-       if(options & CONN_ZIP)          /* zlib compression supported. */
-               strcat(option_txt, "z");
+       if(options & CONN_ZIP)          /* zlib compression enabled */
+               strlcat(option_txt, "z", sizeof(option_txt));
 #endif
+       LogDebug(" *** %d: %d = %s", Idx, options, option_txt);
 
        return option_txt;
 } /* Option_String */
@@ -502,6 +505,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
        if (Req->argc > 2) {
                if (!SendErrors)
                        return CONNECTED;
+               IRC_SetPenalty(Client, 2);
                return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
                                          Client_ID(Client), Req->command);
        }