NewConnectionAlways global session flag which will create new connection for every HTTP request and close this connection after request's response received.
Added HttpClientRequestFlag.DedicatedConnection flag which will force to create new HTTP connection for this specific request. Note: Connection is not going to be closed.
HttpClientRequestFlag.CloseConnection flag will force HTTP client to send send Connection: close HTTP header with specific HTTP request and it also closes connection after response will be received.
So now, instead of using NewConnectionAlways you can specify both DedicatedConnection and CloseConnection to get equal behavior.
This is proper fix for issue and replaces https://github.com/status-im/nim-chronos/pull/321. With this fix
NewConnectionAlways
global session flag which will create new connection for every HTTP request and close this connection after request's response received.HttpClientRequestFlag.DedicatedConnection
flag which will force to create new HTTP connection for this specific request. Note: Connection is not going to be closed.HttpClientRequestFlag.CloseConnection
flag will force HTTP client to send sendConnection: close
HTTP header with specific HTTP request and it also closes connection after response will be received.So now, instead of using
NewConnectionAlways
you can specify bothDedicatedConnection
andCloseConnection
to get equal behavior.