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

Increased time-out to 5 minutes (now that the concurrent clients issue is resolved).

Uses new global property "logged_in" to check authentication.
parent 23ce7b3f
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
const VERSION = "1.00 Alpha"; const VERSION = "1.00 Alpha";
var debug = false; var debug = false;
var authenticated = false;
// Parse arguments // Parse arguments
for(i=0;i<argc;i++) for(i=0;i<argc;i++)
...@@ -40,7 +39,7 @@ writeln(format("200 %s News (Synchronet NNTP Service v%s)",system.name,VERSION)) ...@@ -40,7 +39,7 @@ writeln(format("200 %s News (Synchronet NNTP Service v%s)",system.name,VERSION))
while(client.socket.is_connected) { while(client.socket.is_connected) {
// Get Request // Get Request
cmdline = client.socket.recvline(512 /*maxlen*/, 10 /*timeout*/); cmdline = client.socket.recvline(512 /*maxlen*/, 300 /*timeout*/);
if(cmdline==null) { if(cmdline==null) {
log("!TIMEOUT waiting for request"); log("!TIMEOUT waiting for request");
...@@ -67,11 +66,9 @@ while(client.socket.is_connected) { ...@@ -67,11 +66,9 @@ while(client.socket.is_connected) {
writeln("381 More authentication required"); writeln("381 More authentication required");
break; break;
case "PASS": case "PASS":
log(format("login(%s,%s)",username,cmd[2])); if(login(username,cmd[2]))
if(login(username,cmd[2])) {
writeln("281 Authentication successful"); writeln("281 Authentication successful");
authenticated=true; else
} else
writeln("502 Authentication failure"); writeln("502 Authentication failure");
break; break;
default: default:
...@@ -88,7 +85,7 @@ while(client.socket.is_connected) { ...@@ -88,7 +85,7 @@ while(client.socket.is_connected) {
break; break;
} }
if(!authenticated) { if(!logged_in) {
writeln("502 Authentication required"); writeln("502 Authentication required");
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment