+15 April 2026: Wouter
+ - Fix RFC7766 compliance when client sends EOF over TCP. It stops
+ pending replies and closes. Thanks to Yuxiao Wu, Tsinghua
+ University for the report.
+
14 April 2026: Wouter
- Fix #1017: memory corruption related core dumps.
When alloc_reg_obtain has an empty list, return a new allocation.
tcp_req_info_handle_read_close(struct tcp_req_info* req)
{
verbose(VERB_ALGO, "tcp channel read side closed %d", req->cp->fd);
- /* reset byte count for (potential) partial read */
- req->cp->tcp_byte_count = 0;
- /* if we still have results to write, pick up next and write it */
- if(req->num_done_req != 0) {
- tcp_req_pickup_next_result(req);
- tcp_req_info_setup_listen(req);
- return 1;
- }
- /* if nothing to do, this closes the connection */
- if(req->num_open_req == 0 && req->num_done_req == 0)
- return 0;
- /* otherwise, we must be waiting for dns resolve, wait with timeout */
- req->read_is_closed = 1;
- tcp_req_info_setup_listen(req);
- return 1;
+ /* RFC 7766 6.2.4 says to drop pending replies when client closes. */
+ return 0; /* drop connection */
}
void