Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Aug 8, 2023
1 parent 20b4b56 commit 8a0605a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions p2p/http/libp2phttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ type HTTPHost struct {
rootHandler http.ServeMux
wk WellKnownHandler
httpRoundTripper *http.Transport
recentHTTPAddrs *lru.Cache[peer.ID, httpAddr]
peerMetadata *lru.Cache[peer.ID, WellKnownProtoMap]
streamHost host.Host // may be nil
httpTransport *httpTransport
// recentHTTPAddrs is an lru cache of recently used HTTP addresses. This
// lets us know if we've recently connected to an HTTP endpoint and might
// have a warm idle connection for it (managed by the underlying HTTP
// roundtripper). In some cases, this lets us reuse our existing custom roundtripper (i.e. SNI != host).
recentHTTPAddrs *lru.Cache[peer.ID, httpAddr]
// peerMetadata is an lru cache of a peer's well-known protocol map.
peerMetadata *lru.Cache[peer.ID, WellKnownProtoMap]
streamHost host.Host // may be nil
httpTransport *httpTransport
}

type httpTransport struct {
Expand Down

0 comments on commit 8a0605a

Please sign in to comment.