]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/client.c
irc_string.h -> match.h, irc_string.h; includes changed
[irc/rqf/shadowircd.git] / src / client.c
index 5bb34131b9ee1fad083fdf4cf3a8853049996209..0d4f5a198371c39ff3612e43bb6ab7e3c63646c8 100644 (file)
@@ -31,8 +31,7 @@
 #include "class.h"
 #include "common.h"
 #include "hash.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "packet.h"
@@ -85,8 +84,7 @@ struct Dictionary *nd_dict = NULL;
 enum
 {
        D_LINED,
-       K_LINED,
-       G_LINED
+       K_LINED
 };
 
 rb_dlink_list dead_list;
@@ -403,7 +401,6 @@ notify_banned_client(struct Client *client_p, struct ConfItem *aconf, int ban)
        static const char conn_closed[] = "Connection closed";
        static const char d_lined[] = "D-lined";
        static const char k_lined[] = "K-lined";
-       static const char g_lined[] = "G-lined";
        const char *reason = NULL;
        const char *exit_reason = conn_closed;
 
@@ -419,9 +416,6 @@ notify_banned_client(struct Client *client_p, struct ConfItem *aconf, int ban)
                case D_LINED:
                        reason = d_lined;
                        break;
-               case G_LINED:
-                       reason = g_lined;
-                       break;
                default:
                        reason = k_lined;
                        break;
@@ -1236,7 +1230,7 @@ dead_link(struct Client *client_p)
        abt = (struct abort_client *) rb_malloc(sizeof(struct abort_client));
 
        if(client_p->flags & FLAGS_SENDQEX)
-               strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
+               rb_strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
        else
                rb_snprintf(abt->notice, sizeof(abt->notice), "Write error: %s", strerror(errno));
 
@@ -1517,6 +1511,7 @@ exit_local_client(struct Client *client_p, struct Client *source_p, struct Clien
                  const char *comment)
 {
        unsigned long on_for;
+       char tbuf[26];
 
        exit_generic_client(client_p, source_p, from, comment);
        clear_monitor(source_p);
@@ -1543,7 +1538,7 @@ exit_local_client(struct Client *client_p, struct Client *source_p, struct Clien
        on_for = rb_current_time() - source_p->localClient->firsttime;
 
        ilog(L_USER, "%s (%3lu:%02lu:%02lu): %s!%s@%s %d/%d",
-               myctime(rb_current_time()), on_for / 3600,
+               rb_ctime(rb_current_time(), tbuf, sizeof(tbuf)), on_for / 3600,
                (on_for % 3600) / 60, on_for % 60,
                source_p->name, source_p->username, source_p->host,
                source_p->localClient->sendK, source_p->localClient->receiveK);
@@ -1960,9 +1955,9 @@ close_connection(struct Client *client_p)
        {
                struct server_conf *server_p;
 
-               ServerStats.is_sv++;\r
-               ServerStats.is_sbs += client_p->localClient->sendB;\r
-               ServerStats.is_sbr += client_p->localClient->receiveB;\r
+               ServerStats.is_sv++;
+               ServerStats.is_sbs += client_p->localClient->sendB;
+               ServerStats.is_sbr += client_p->localClient->receiveB;
                ServerStats.is_sti += rb_current_time() - client_p->localClient->firsttime;
 
                /*
@@ -1986,9 +1981,9 @@ close_connection(struct Client *client_p)
        }
        else if(IsClient(client_p))
        {
-               ServerStats.is_cl++;\r
-               ServerStats.is_cbs += client_p->localClient->sendB;\r
-               ServerStats.is_cbr += client_p->localClient->receiveB;\r
+               ServerStats.is_cl++;
+               ServerStats.is_cbs += client_p->localClient->sendB;
+               ServerStats.is_cbr += client_p->localClient->receiveB;
                ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime;
        }
        else
@@ -2058,7 +2053,7 @@ error_exit_client(struct Client *client_p, int error)
        }
 
        if(error == 0)
-               strlcpy(errmsg, "Remote host closed the connection", sizeof(errmsg));
+               rb_strlcpy(errmsg, "Remote host closed the connection", sizeof(errmsg));
        else
                rb_snprintf(errmsg, sizeof(errmsg), "Read error: %s", strerror(current_error));