Commit 8410f684 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Drop connection if client hello is too large

parent ff44e211
......@@ -306,6 +306,15 @@ int Connection::tls_handshake() {
// We have limited space for read buffer, so stop reading if it
// filled up.
if (tls.rb->wleft() == 0) {
if (tls.handshake_state != TLS_CONN_WRITE_STARTED) {
// Reading 16KiB before writing server hello is unlikely for
// ordinary client.
if (LOG_ENABLED(INFO)) {
LOG(INFO) << "tls: client hello is too large";
}
return -1;
}
rlimit.stopw();
ev_timer_stop(loop, &rt);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment