Subject: Re: [bug#47174] [PATCH v2 2/2] substitute: Handle closing connections to substitute servers.

From: Christopher Baines <[email-masked]>
Date: Thu, 20 May 2021 11:59:06 +0100

Mathieu Othacehe <[email-masked]> writes:

>> +                       (match (assq 'connection (response-headers response))
>> +                         (('connection 'close)
>> +                          (lambda ()
>> +                            (close-port port)))
>
> You could maybe factorize it in a close-connection? procedure. Out of
> curiosity, when does the remote server asks for connection closing?

A server can at any time ask for the connection to be closed. With NGinx
for example, by default, it'll close connections after 1000 requests:

  http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive_requests