mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-30 19:40:54 +00:00
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
|
||||
// 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user