Skip to content

Commit

Permalink
额外记录 humanReadable 的 PeerID
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Oct 8, 2024
1 parent 710035c commit f3d77c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -59,6 +60,7 @@ public void executeAnnounce(PeerAnnounce announce) {
null,
announce.reqIp(),
ByteUtil.filterUTF8(ByteUtil.bytesToHex(announce.peerId())),
new String(announce.peerId, StandardCharsets.ISO_8859_1),
announce.peerIp(),
announce.peerPort(),
ByteUtil.bytesToHex(announce.infoHash()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class TrackedPeer {
@Column(nullable = false)
private String peerId;
@Column(nullable = false)
private String peerIdHumanReadable;
@Column(nullable = false)
private InetAddress peerIp;
@Column(nullable = false)
private Integer peerPort;
Expand Down

0 comments on commit f3d77c5

Please sign in to comment.