[mw-devel] MW3 r1339 - trunk/src

psycodom at sucs.org psycodom at sucs.org
Mon Sep 16 18:05:37 BST 2013


Author: psycodom
Date: 2013-09-16 18:05:36 +0100 (Mon, 16 Sep 2013)
New Revision: 1339

Modified:
   trunk/src/js.c
   trunk/src/socket.h
Log:
Operation callbacks don't seem to fire automatically so this makes sure they're fired when a ^C or timeout interupt happens so our scripts actually stop
iloop protection now repaired



Modified: trunk/src/js.c
===================================================================
--- trunk/src/js.c	2013-09-16 15:44:36 UTC (rev 1338)
+++ trunk/src/js.c	2013-09-16 17:05:36 UTC (rev 1339)
@@ -125,6 +125,7 @@
 static void js_timeout(void *ptr)
 {
 	js_interrupted=2;
+	JS_TriggerOperationCallback(jsrt);
 }
 
 /* clears the timeout event when a js finishes (or the js uses input) */
@@ -1164,6 +1165,7 @@
 
 static JSBool js_operation_callback(JSContext *cx) {
 	JSObject *global = JS_GetGlobalObject(cx);
+	
 	if (global) {
 		if (js_interrupted==1) {
 			JS_ReportError(cx,"Script execution interupted");
@@ -1174,7 +1176,6 @@
 		}
 
 	}
-	
 	return JS_TRUE;
 }
 
@@ -1183,6 +1184,7 @@
 void js_stop_execution(void)
 {
 	js_interrupted=1;
+	JS_TriggerOperationCallback(jsrt);
 }
 
 int js_isrunning(void)

Modified: trunk/src/socket.h
===================================================================
--- trunk/src/socket.h	2013-09-16 15:44:36 UTC (rev 1338)
+++ trunk/src/socket.h	2013-09-16 17:05:36 UTC (rev 1339)
@@ -5,7 +5,7 @@
 #include <jansson.h>
 #include "list.h"
 
-#define IPCPORT_DEFAULT	9999
+#define IPCPORT_DEFAULT	9998
 
 enum ipcsock_state {
 	IPCSTATE_CONNECTED,




More information about the mw-devel mailing list