Skip to content
Snippets Groups Projects
Commit 48e8ab1d authored by deuce's avatar deuce
Browse files

Fix closed connection detection.

parent 3f631e03
No related branches found
No related tags found
No related merge requests found
...@@ -534,14 +534,7 @@ function handle_request() { ...@@ -534,14 +534,7 @@ function handle_request() {
do { do {
if (this.LORD.pending > 0) { if (this.LORD.pending > 0) {
if (this.LORD.buf.length < this.LORD.pending) { if (this.LORD.buf.length >= this.LORD.pending) {
if (this.buf.length === 0) {
close_sock(this);
return
}
break;
}
else {
tmp = this.LORD.buf.substr(0, this.LORD.pending); tmp = this.LORD.buf.substr(0, this.LORD.pending);
this.LORD.buf = this.LORD.buf.substr(this.LORD.pending); this.LORD.buf = this.LORD.buf.substr(this.LORD.pending);
this.LORD.pending = 0; this.LORD.pending = 0;
...@@ -550,6 +543,8 @@ function handle_request() { ...@@ -550,6 +543,8 @@ function handle_request() {
return; return;
} }
} }
else
break;
} }
else { else {
// TODO: Better sanity checking... // TODO: Better sanity checking...
...@@ -571,6 +566,10 @@ function handle_request() { ...@@ -571,6 +566,10 @@ function handle_request() {
} }
} }
} while(true); } while(true);
if (buf.length === 0) {
close_sock(this);
}
} }
function main() { function main() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment