forked from I2P_Developers/i2p.i2p
* I2PTunnelHTTPServer: Start timer before reading the first line (ticket #1071)
This commit is contained in:
@@ -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 {
|
|||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user