Skip to content

HTTPClientSession KeepAlive and setMaxKeepAliveRequests #4458

@micheleselea

Description

@micheleselea

In HTTPClientSession::write there's a code to try "reconnect and resend" if a connection is keepalive and we got an Exception
That is nice, but same behavior happens, often (I think always) in HTTPClientSession::receiveResponse with ssl connesions

Consider for example this environment
HTTPClientSession -> HTTPServer

we configure HTTPServer with setMaxKeepAliveRequests(10)
An HTTPClientSession will connect make 10 requests without problem, than the HTTPClientSession server side is closed.
The 11th HTTPClientSession request will do a HTTPClientSession::write without problem but obviously the receiveResponse will fail with Poco::Net::ConnectionAbortedException or Poco::Net::NoMessageException and your request is lost.
I think it's more complicated to deal with that error as for the ::write function, probably we should automatically "reconnect write and receive" but I understand it's not simple as in write
What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions