I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 5187bf1e authored by zzz's avatar zzz
Browse files

* I2PTunnelHTTPServer: Start timer before reading the first line (ticket #1071)

parent 99471d8e
No related branches found
No related tags found
No related merge requests found
...@@ -527,6 +527,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { ...@@ -527,6 +527,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
HashMap<String, List<String>> headers = new HashMap<String, List<String>>(); HashMap<String, List<String>> headers = new HashMap<String, List<String>>();
StringBuilder buf = new StringBuilder(128); StringBuilder buf = new StringBuilder(128);
// slowloris / darkloris
long expire = ctx.clock().now() + TOTAL_HEADER_TIMEOUT;
boolean ok = DataHelper.readLine(in, command); boolean ok = DataHelper.readLine(in, command);
if (!ok) throw new IOException("EOF reached while reading the HTTP command [" + command.toString() + "]"); if (!ok) throw new IOException("EOF reached while reading the HTTP command [" + command.toString() + "]");
...@@ -547,8 +549,6 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { ...@@ -547,8 +549,6 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
if (trimmed > 0) if (trimmed > 0)
ctx.statManager().addRateData("i2ptunnel.httpNullWorkaround", trimmed, 0); ctx.statManager().addRateData("i2ptunnel.httpNullWorkaround", trimmed, 0);
// slowloris / darkloris
long expire = ctx.clock().now() + TOTAL_HEADER_TIMEOUT;
int i = 0; int i = 0;
while (true) { while (true) {
if (++i > MAX_HEADERS) if (++i > MAX_HEADERS)
......
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