فهرست منبع

* Fixed a possible cause for cpu spinning on segfault. (Removed a memory alloc in fatal())

svn: 2173
Bryan Drewery 21 سال پیش
والد
کامیت
db621f702e
2فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 1 0
      doc/UPDATES
  2. 7 2
      src/mod/server.mod/servmsg.c

+ 1 - 0
doc/UPDATES

@@ -154,6 +154,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed cosmetic bug with removing ignores.
 * cmd_dump now has a substitution. '$n' is replaced with the bot's current IRC nick.
 * Added rate var 'flood-g' which will set +g for 60 seconds after this many msgs:sec has been detected. (#74)
+* Fixed a possible cause for cpu spinning on segfault.
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 7 - 2
src/mod/server.mod/servmsg.c

@@ -303,8 +303,13 @@ static int got442(char *from, char *msg)
 void nuke_server(const char *reason)
 {
   if (serv >= 0 && servidx >= 0) {
-    if (reason)
-      dprintf(DP_DUMP, "QUIT :%s\n", reason);
+    if (reason) {
+      char buf[101] = "";
+      size_t len = 0;
+
+      len = simple_snprintf(buf, sizeof(buf), "QUIT :%s\r\n", reason);
+      write_to_server(buf, len);
+    }
 
     sleep(1);
     disconnect_server(servidx, DO_LOST);