diff --git a/src/sbbs3/exec.cpp b/src/sbbs3/exec.cpp index c425f2d4a9b0c9001628ccd733fec3a568faee6c..999f8d4dcab4e43ebde766ff5041fe70bf3f2241 100644 --- a/src/sbbs3/exec.cpp +++ b/src/sbbs3/exec.cpp @@ -8,7 +8,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -548,7 +548,8 @@ js_OperationCallback(JSContext *cx) return(JS_FALSE); } - if(sbbs->js_callback.auto_terminate && !sbbs->online) { + if(sbbs->js_callback.auto_terminate && !sbbs->online + && ++sbbs->js_callback.offline_counter >= 10) { JS_ReportWarning(cx,"Disconnected"); sbbs->js_callback.counter=0; JS_SetOperationCallback(cx, js_OperationCallback); diff --git a/src/sbbs3/sbbsdefs.h b/src/sbbs3/sbbsdefs.h index f19bba70b8007325676786a20380bd0002a0b1f0..b75ea0ba4a27b4bf08355d5ee98c5d4d3103601f 100644 --- a/src/sbbs3/sbbsdefs.h +++ b/src/sbbs3/sbbsdefs.h @@ -8,7 +8,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2015 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -85,6 +85,7 @@ typedef struct js_callback { uint32_t yield_interval; uint32_t gc_interval; uint32_t gc_attempts; + uint32_t offline_counter; BOOL auto_terminate; volatile BOOL* terminated; BOOL bg;