Page 1 of 1

keep-alive

Posted: Mon May 15, 2023 7:24 pm
by Alan5432
What would it take to have the ability to SetOption for 'Connection'. Either setting it to 'Keep-Alive' or 'Close'.

Re: keep-alive

Posted: Mon May 15, 2023 8:05 pm
by Scott Klement
This is already possible to do.

Technically, it should not be necessary. The HTTP/1.1 spec is such that keep-alive is the default, and close is really not needed, since you can just close the connection.

But, if you have an unusual circumstances (for example, if communicating with an HTTP/1.0 server) you can define the Connection: header by using an http_xproc with the HTTP_POINT_ADDL_HEADER exit point.

then, in order for this values to be meaningful, you need to use the http_persist_xxx set of routines. If you telling it to keep the connection alive, there's no point in calling the non-persistent routines since they close the connection every time. But with the persist routines, you can keep it active between calls.