nghttpx: Drop connection if client hello is too large
This commit is contained in:
parent
ff44e211ed
commit
8410f684fb
|
@ -306,6 +306,15 @@ int Connection::tls_handshake() {
|
||||||
// We have limited space for read buffer, so stop reading if it
|
// We have limited space for read buffer, so stop reading if it
|
||||||
// filled up.
|
// filled up.
|
||||||
if (tls.rb->wleft() == 0) {
|
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();
|
rlimit.stopw();
|
||||||
ev_timer_stop(loop, &rt);
|
ev_timer_stop(loop, &rt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue