@@ -318,6 +318,7 @@ class Parser : public AsyncWrap, public StreamListener { |
318 | 318 | num_fields_ = num_values_ = 0; |
319 | 319 | headers_completed_ = false; |
320 | 320 | chunk_extensions_nread_ = 0; |
| 321 | + received_data_ = true; |
321 | 322 | last_message_start_ = uv_hrtime(); |
322 | 323 | allocator_.Reset(); |
323 | 324 | url_.Reset(); |
@@ -724,6 +725,7 @@ class Parser : public AsyncWrap, public StreamListener { |
724 | 725 |
|
725 | 726 | if (connectionsList != nullptr) { |
726 | 727 | parser->connectionsList_ = connectionsList; |
| 728 | + parser->received_data_ = false; |
727 | 729 |
|
728 | 730 | // This protects from a DoS attack where an attacker establishes |
729 | 731 | // the connection without sending any data on applications where |
@@ -1070,6 +1072,7 @@ class Parser : public AsyncWrap, public StreamListener { |
1070 | 1072 | const char* current_buffer_data_; |
1071 | 1073 | bool headers_completed_ = false; |
1072 | 1074 | bool pending_pause_ = false; |
| 1075 | + bool received_data_ = false; |
1073 | 1076 | uint64_t header_nread_ = 0; |
1074 | 1077 | uint64_t chunk_extensions_nread_ = 0; |
1075 | 1078 | uint64_t max_http_header_size_; |
@@ -1150,7 +1153,7 @@ void ConnectionsList::Idle(const FunctionCallbackInfo<Value>& args) { |
1150 | 1153 | LocalVector<Value> result(isolate); |
1151 | 1154 | result.reserve(list->all_connections_.size()); |
1152 | 1155 | for (auto parser : list->all_connections_) { |
1153 | | - if (parser->last_message_start_ == 0) { |
| 1156 | + if (parser->last_message_start_ == 0 || !parser->received_data_) { |
1154 | 1157 | result.emplace_back(parser->object()); |
1155 | 1158 | } |
1156 | 1159 | } |
|