Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

http: use closeWrapper instead of releaseWrapper #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0intro
Copy link
Contributor

@0intro 0intro commented Jan 6, 2016

Pooly opens HTTP connections with keep-alive disabled,
but tries to reuse open connections after an HTTP response
has been received. This lead the HTTP server to reset
the TCP connection.

This change implements a closeWrapper, analog to releaseWrapper.
However, closeWrapper closes the TCP connection, instead of
putting it back to the connection pool. Now, NewHTTPTransport
can use closeWrapper instead of releaseWrapper.

Pooly opens HTTP connections with keep-alive disabled,
but tries to reuse open connections after an HTTP response
has been received. This lead the HTTP server to reset
the TCP connection.

This change implements a closeWrapper, analog to releaseWrapper.
However, closeWrapper closes the TCP connection, instead of
putting it back to the connection pool. Now, NewHTTPTransport
can use closeWrapper instead of releaseWrapper.
@3XX0
Copy link
Owner

3XX0 commented Jan 10, 2016

This kind of defeat the purpose of Pooly (i.e. having a pool of connection).
Disabling the keep-alive is needed otherwise the HTTP standard library won't call Close.
On the other hand it looks like they set the close header as well: https://golang.org/src/net/http/server.go#L992

I guess we need to leverage the Hijacker interface

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants