Skip to content
Snippets Groups Projects
Commit f4f60b56 authored by rswindell's avatar rswindell
Browse files

Added checking of js.terminated property.

parent c713dd7b
No related branches found
No related tags found
No related merge requests found
...@@ -82,6 +82,9 @@ for(i=0;i<argc;i++) { ...@@ -82,6 +82,9 @@ for(i=0;i<argc;i++) {
cfg_fname = argv[i]; cfg_fname = argv[i];
} }
if(this.js==undefined) // v3.10?
js = { terminated: false };
// Write a string to the server socket // Write a string to the server socket
function write(str) function write(str)
{ {
...@@ -258,7 +261,7 @@ for(i in area) { ...@@ -258,7 +261,7 @@ for(i in area) {
break; break;
} }
if(file_exists(stop_semaphore)) if(js.terminated || file_exists(stop_semaphore))
break; break;
// printf("%s\r\n",area[i].toString()); // printf("%s\r\n",area[i].toString());
...@@ -326,7 +329,11 @@ for(i in area) { ...@@ -326,7 +329,11 @@ for(i in area) {
if(debug) if(debug)
print("exporting local messages"); print("exporting local messages");
last_msg=msgbase.last_msg; last_msg=msgbase.last_msg;
for(;socket.is_connected && ptr<=last_msg && !file_exists(stop_semaphore);ptr++) { for(;socket.is_connected
&& ptr<=last_msg
&& !js.terminated
&& !file_exists(stop_semaphore)
;ptr++) {
if(this.console!=undefined) if(this.console!=undefined)
console.line_counter = 0; console.line_counter = 0;
hdr = msgbase.get_msg_header( hdr = msgbase.get_msg_header(
...@@ -472,7 +479,11 @@ for(i in area) { ...@@ -472,7 +479,11 @@ for(i in area) {
ptr++; ptr++;
} }
for(;socket.is_connected && ptr<=last_msg && !file_exists(stop_semaphore);ptr++) { for(;socket.is_connected
&& ptr<=last_msg
&& !js.terminated
&& !file_exists(stop_semaphore)
;ptr++) {
if(this.console!=undefined) if(this.console!=undefined)
console.line_counter = 0; console.line_counter = 0;
writeln(format("ARTICLE %lu",ptr)); writeln(format("ARTICLE %lu",ptr));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment