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

No longer closes client socket when QUIT (the service server handles this).

Logs number of chars posted.
parent 71ed7e09
No related branches found
No related tags found
No related merge requests found
...@@ -95,6 +95,7 @@ var username=''; ...@@ -95,6 +95,7 @@ var username='';
var msgbase=null; var msgbase=null;
var selected=null; var selected=null;
var current_article=0; var current_article=0;
var quit=false;
writeln(format("200 %s News (Synchronet %s%s-%s NNTP Service %s)" writeln(format("200 %s News (Synchronet %s%s-%s NNTP Service %s)"
,system.name,system.version,system.revision,system.platform,REVISION)); ,system.name,system.version,system.revision,system.platform,REVISION));
...@@ -102,7 +103,7 @@ writeln(format("200 %s News (Synchronet %s%s-%s NNTP Service %s)" ...@@ -102,7 +103,7 @@ writeln(format("200 %s News (Synchronet %s%s-%s NNTP Service %s)"
if(!no_anonymous) if(!no_anonymous)
login("guest"); // Login as guest/anonymous by default login("guest"); // Login as guest/anonymous by default
while(client.socket.is_connected) { while(client.socket.is_connected && !quit) {
// Get Request // Get Request
cmdline = client.socket.recvline(512 /*maxlen*/, 300 /*timeout*/); cmdline = client.socket.recvline(512 /*maxlen*/, 300 /*timeout*/);
...@@ -163,7 +164,7 @@ while(client.socket.is_connected) { ...@@ -163,7 +164,7 @@ while(client.socket.is_connected) {
continue; continue;
case "QUIT": case "QUIT":
writeln("205 closing connection - goodbye!"); writeln("205 closing connection - goodbye!");
client.socket.close(); quit=true;
continue; continue;
} }
...@@ -558,7 +559,7 @@ while(client.socket.is_connected) { ...@@ -558,7 +559,7 @@ while(client.socket.is_connected) {
//log(format("msgtxt: %s",line)); //log(format("msgtxt: %s",line));
if(line==".") { if(line==".") {
log("End of message text"); log(format("End of message text (%u chars)",body.length));
break; break;
} }
if(line=="" && header) { if(line=="" && header) {
...@@ -624,7 +625,8 @@ while(client.socket.is_connected) { ...@@ -624,7 +625,8 @@ while(client.socket.is_connected) {
if(msgbase.open!=undefined && msgbase.open()==false) if(msgbase.open!=undefined && msgbase.open()==false)
continue; continue;
if(msgbase.save_msg(hdr,body)) { if(msgbase.save_msg(hdr,body)) {
log(format("%s posted a message on %s",user.alias,newsgroups[n])); log(format("%s posted a message (%lu chars) on %s"
,user.alias, body.length, newsgroups[n]));
writeln("240 article posted ok"); writeln("240 article posted ok");
posted=true; posted=true;
msgs_posted++; msgs_posted++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment