[cvslog] [CVS] Module eggdrop1.8: Change committed

cvs at eggheads.org cvs at eggheads.org
Sat Jun 16 10:04:12 CST 2012


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.8
Commit time: 2012-06-16 16:04:12 UTC
Committer  : Thomas Sader <thommey at gmail.com>

Modified files:
     doc/Changes1.8 src/dcc.c src/dns.c src/patch.h src/tcl.c
     src/tclhash.c

Log message:

Call Tcl's bgerror on Eggdrop background errors.

---------------------- diff included ----------------------
Index: eggdrop1.8/doc/Changes1.8
diff -u eggdrop1.8/doc/Changes1.8:1.59 eggdrop1.8/doc/Changes1.8:1.60
--- eggdrop1.8/doc/Changes1.8:1.59	Thu Jun 14 18:04:59 2012
+++ eggdrop1.8/doc/Changes1.8	Sat Jun 16 10:04:02 2012
@@ -1,4 +1,4 @@
-$Id: Changes1.8,v 1.59 2012/06/15 00:04:59 thommey Exp $
+$Id: Changes1.8,v 1.60 2012/06/16 16:04:02 thommey Exp $
 
 Eggdrop Changes (since version 1.8.0)
 
@@ -6,6 +6,10 @@
 
 1.8.0 (CVS):
 
+  - Call Tcl's bgerror on Eggdrop background errors. This allows custom
+    code to react to errors (and output full $::errorInfo, for example).
+    Patch by: thommey
+
   - Remove wrong truncation of ERR_YOUREBANNEDCREEP output to console.
     Found by: Edelstahl / Patch by: thommey
 
Index: eggdrop1.8/src/dcc.c
diff -u eggdrop1.8/src/dcc.c:1.10 eggdrop1.8/src/dcc.c:1.11
--- eggdrop1.8/src/dcc.c:1.10	Sat Feb 26 13:22:37 2011
+++ eggdrop1.8/src/dcc.c	Sat Jun 16 10:04:02 2012
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.10 2011/02/26 19:22:37 thommey Exp $
+ * $Id: dcc.c,v 1.11 2012/06/16 16:04:02 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1931,6 +1931,7 @@
   Tcl_SetVar(interp, "_a", args, 0);
   if (Tcl_VarEval(interp, name, " $_n $_a", NULL) == TCL_ERROR) {
     putlog(LOG_MISC, "*", DCC_TCLERROR, name, tcl_resultstring());
+    Tcl_BackgroundError(interp);
     return -1;
   }
   return tcl_resultint();
Index: eggdrop1.8/src/dns.c
diff -u eggdrop1.8/src/dns.c:1.2 eggdrop1.8/src/dns.c:1.3
--- eggdrop1.8/src/dns.c:1.2	Thu Aug  5 12:12:05 2010
+++ eggdrop1.8/src/dns.c	Sat Jun 16 10:04:02 2012
@@ -4,7 +4,7 @@
  *   provides the code used by the bot if the DNS module is not loaded
  *   DNS Tcl commands
  *
- * $Id: dns.c,v 1.2 2010/08/05 18:12:05 pseudo Exp $
+ * $Id: dns.c,v 1.3 2012/06/16 16:04:02 thommey Exp $
  */
 /*
  * Written by Fabian Knittel <fknittel at gmx.de>
@@ -264,11 +264,15 @@
     argv[1] = tclinfo->paras;
     output = Tcl_Concat(2, argv);
 
-    if (Tcl_Eval(interp, output) == TCL_ERROR)
+    if (Tcl_Eval(interp, output) == TCL_ERROR) {
       putlog(LOG_MISC, "*", DCC_TCLERROR, tclinfo->proc, tcl_resultstring());
+      Tcl_BackgroundError(interp);
+    }
     Tcl_Free(output);
-  } else if (Tcl_Eval(interp, Tcl_DStringValue(&list)) == TCL_ERROR)
+  } else if (Tcl_Eval(interp, Tcl_DStringValue(&list)) == TCL_ERROR) {
     putlog(LOG_MISC, "*", DCC_TCLERROR, tclinfo->proc, tcl_resultstring());
+    Tcl_BackgroundError(interp);
+  }
 
   Tcl_DStringFree(&list);
 
Index: eggdrop1.8/src/patch.h
diff -u eggdrop1.8/src/patch.h:1.40 eggdrop1.8/src/patch.h:1.41
--- eggdrop1.8/src/patch.h:1.40	Thu Jun 14 18:04:59 2012
+++ eggdrop1.8/src/patch.h	Sat Jun 16 10:04:02 2012
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.40 2012/06/15 00:04:59 thommey Exp $
+ * $Id: patch.h,v 1.41 2012/06/16 16:04:02 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1339718497");            /* current unixtime */
+patch("1339862435");            /* current unixtime */
 /*
  *
  *
  */
-patch("creep");
+patch("bgerror");
 /*
  *
  *
Index: eggdrop1.8/src/tcl.c
diff -u eggdrop1.8/src/tcl.c:1.10 eggdrop1.8/src/tcl.c:1.11
--- eggdrop1.8/src/tcl.c:1.10	Fri Sep  9 15:38:39 2011
+++ eggdrop1.8/src/tcl.c	Sat Jun 16 10:04:02 2012
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.10 2011/09/09 21:38:39 thommey Exp $
+ * $Id: tcl.c,v 1.11 2012/06/16 16:04:02 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -879,6 +879,7 @@
   if (code != TCL_OK) {
     putlog(LOG_MISC, "*", "Tcl error in script for '%s':", whatzit);
     putlog(LOG_MISC, "*", "%s", result);
+    Tcl_BackgroundError(interp);
   }
 
 #ifdef USE_TCL_ENCODING
@@ -914,6 +915,7 @@
   if (code != TCL_OK) {
     putlog(LOG_MISC, "*", "Tcl error in file '%s':", fname);
     putlog(LOG_MISC, "*", "%s", result);
+    Tcl_BackgroundError(interp);
     code = 0; /* JJM: refactored to remove premature return */
   } else {
     /* Refresh internal variables */
Index: eggdrop1.8/src/tclhash.c
diff -u eggdrop1.8/src/tclhash.c:1.5 eggdrop1.8/src/tclhash.c:1.6
--- eggdrop1.8/src/tclhash.c:1.5	Fri Jul  8 17:12:54 2011
+++ eggdrop1.8/src/tclhash.c	Sat Jun 16 10:04:02 2012
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.5 2011/07/08 23:12:54 thommey Exp $
+ * $Id: tclhash.c,v 1.6 2012/06/16 16:04:02 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -744,6 +744,7 @@
   if (x == TCL_ERROR) {
     /* FIXME: we really should be able to log longer errors */
     putlog(LOG_MISC, "*", "Tcl error [%s]: %.*s", proc, 400, tcl_resultstring());
+    Tcl_BackgroundError(interp);
 
     return BIND_EXECUTED;
   }
----------------------- End of diff -----------------------


More information about the Changes mailing list