Skip to content

Commit

Permalink
Fix interface rename
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Aug 16, 2023
1 parent 2345ec1 commit b79467a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions p2p/http/libp2phttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func (s *streamReadCloser) Close() error {
return s.ReadCloser.Close()
}

func (rt *streamRoundTripper) GetPeerProtoMap() (PeerMeta, error) {
func (rt *streamRoundTripper) GetPeerMetadata() (PeerMeta, error) {
return rt.httpHost.getAndStorePeerMetadata(rt, rt.server)
}

Expand Down Expand Up @@ -393,13 +393,13 @@ type roundTripperForSpecificServer struct {
cachedProtos PeerMeta
}

func (rt *roundTripperForSpecificServer) GetPeerProtoMap() (PeerMeta, error) {
func (rt *roundTripperForSpecificServer) GetPeerMetadata() (PeerMeta, error) {
// Do we already have the peer's protocol mapping?
if rt.cachedProtos != nil {
return rt.cachedProtos, nil
}

// if the underlying roundtripper implements getPeerProtoMap, use that
// if the underlying roundtripper implements GetPeerMetadata, use that
if g, ok := rt.RoundTripper.(PeerMetadataGetter); ok {
wk, err := g.GetPeerMetadata()
if err == nil {
Expand Down Expand Up @@ -449,12 +449,12 @@ type namespacedRoundTripper struct {
protocolPrefixRaw string
}

func (rt *namespacedRoundTripper) GetPeerProtoMap() (PeerMeta, error) {
func (rt *namespacedRoundTripper) GetPeerMetadata() (PeerMeta, error) {
if g, ok := rt.RoundTripper.(PeerMetadataGetter); ok {
return g.GetPeerMetadata()
}

return nil, fmt.Errorf("can not get peer protocol map. Inner roundtripper does not implement getPeerProtoMap")
return nil, fmt.Errorf("can not get peer protocol map. Inner roundtripper does not implement GetPeerMetadata")
}

// RoundTrip implements http.RoundTripper.
Expand Down

0 comments on commit b79467a

Please sign in to comment.