packages/hyprspace: 0.6.0 -> 0.6.1, close PeX streams correctly

This commit is contained in:
Max Headroom 2023-03-23 23:26:38 +01:00
parent 3792b2be5c
commit 9358527fb5
2 changed files with 5 additions and 1 deletions

View file

@ -82,8 +82,10 @@ func RequestPeX(ctx context.Context, host host.Host, peers []peer.ID) (addrInfos
for {
str, err := buf.ReadString('\n')
if err == io.EOF {
s.Close()
return addrInfos, nil
} else if checkErrPeX(err, s) {
s.Close()
return nil, err
}
str = strings.TrimSuffix(str, "\n")
@ -92,10 +94,12 @@ func RequestPeX(ctx context.Context, host host.Host, peers []peer.ID) (addrInfos
addrStr := splits[1]
peerId, err := peer.Decode(idStr)
if checkErrPeX(err, s) {
s.Close()
return nil, err
}
ma, err := multiaddr.NewMultiaddr(addrStr)
if checkErrPeX(err, s) {
s.Close()
return nil, err
}
fmt.Printf("[-] Got PeX peer: %s/p2p/%s\n", addrStr, idStr)

View file

@ -10,7 +10,7 @@
};
packages.hyprspace = with pkgs; buildGo119Module {
pname = "hyprspace";
version = "0.6.0";
version = "0.6.1";
src = with inputs.nix-filter.lib; let
dirs = map inDirectory;