Skip to content
Snippets Groups Projects
Commit c0feb818 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Return 1 on failure (e.g. authentication failure), not 0

Only log message header read error if the msgbase.status is non-zero

Don't try to import anything if the stop semfile is signaled while
exporting.

Increment revision to 1.2
parent 3127e4f4
Branches
Tags
No related merge requests found
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
// s no subject filtering // s no subject filtering
// m Moderate imported messages // m Moderate imported messages
const REVISION = "1.114"; const REVISION = "1.2";
printf("Synchronet NewsLink %s session started\r\n", REVISION); printf("Synchronet NewsLink %s session started\r\n", REVISION);
...@@ -174,7 +174,7 @@ cfg_file = new File(cfg_fname); ...@@ -174,7 +174,7 @@ cfg_file = new File(cfg_fname);
if(!cfg_file.open("r")) { if(!cfg_file.open("r")) {
printf("!Error %d opening %s\r\n",errno,cfg_fname); printf("!Error %d opening %s\r\n",errno,cfg_fname);
delete cfg_file; delete cfg_file;
exit(); exit(1);
} }
while(!cfg_file.eof) { while(!cfg_file.eof) {
...@@ -275,7 +275,7 @@ if(debug) { ...@@ -275,7 +275,7 @@ if(debug) {
if(host==undefined || !host.length) { if(host==undefined || !host.length) {
print("!No news server specified"); print("!No news server specified");
exit(); exit(1);
} }
printf("Connecting to %s port %d ...\r\n",host,port); printf("Connecting to %s port %d ...\r\n",host,port);
...@@ -286,7 +286,7 @@ if(!socket.connect(host, port, connect_timeout)) { ...@@ -286,7 +286,7 @@ if(!socket.connect(host, port, connect_timeout)) {
printf("!Error %d connecting to %s port %d\r\n" printf("!Error %d connecting to %s port %d\r\n"
,socket.last_error,host,port); ,socket.last_error,host,port);
delete socket; delete socket;
exit(); exit(1);
} }
print("Connected"); print("Connected");
if(tls) { if(tls) {
...@@ -310,7 +310,7 @@ if(username!=undefined && username.length) { ...@@ -310,7 +310,7 @@ if(username!=undefined && username.length) {
if(rsp==null || rsp[0]!='2') { if(rsp==null || rsp[0]!='2') {
printf("!Authentication FAILURE: %s\r\n", rsp); printf("!Authentication FAILURE: %s\r\n", rsp);
delete socket; delete socket;
exit(); exit(1);
} }
} }
print("Authenticated"); print("Authenticated");
...@@ -454,7 +454,8 @@ for(sub in area) { ...@@ -454,7 +454,8 @@ for(sub in area) {
/* message number */ ptr /* message number */ ptr
); );
if(hdr == null) { if(hdr == null) {
alert("Failed to read msg header #" + ptr); if(msgbase.status != 0)
alert("Error " + msgbase.error + " reading msg header #" + ptr);
continue; continue;
} }
if(!hdr.id) { if(!hdr.id) {
...@@ -579,6 +580,9 @@ for(sub in area) { ...@@ -579,6 +580,9 @@ for(sub in area) {
export_ptr = ptr; export_ptr = ptr;
save_ptr(ini_file, "export_ptr", export_ptr); save_ptr(ini_file, "export_ptr", export_ptr);
if(stop_sem_signaled())
break;
/***************************/ /***************************/
/* IMPORT Network Messages */ /* IMPORT Network Messages */
/***************************/ /***************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment