Skip to content

Commit

Permalink
对udp请求正确返回400,已重新发v0.3
Browse files Browse the repository at this point in the history
对udp请求正确返回400,已重新发v0.3
  • Loading branch information
1265578519 committed May 14, 2024
1 parent 320125b commit 4ce7763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion opentracker/ot_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int handle_udp6(int64 serversocket, struct ot_workstruct *ws) {
uint32_t numwant = ntohl(inpacket[92 / 4]);
size_t max_peers = ip6_isv4mapped(remoteip) ? OT_MAX_PEERS_UDP4 : OT_MAX_PEERS_UDP6;
if (numwant > max_peers)
numwant = max_peers;
numwant = 400;

ws->reply = ws->outbuf + 8;
ws->reply_size = 8 + add_peer_to_torrent_and_return_peers(FLAG_UDP, ws, numwant);
Expand Down
4 changes: 2 additions & 2 deletions opentracker/trackerlogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ typedef struct {
int bits;
} ot_net;
/* List of peers should fit in a single UDP packet (around 1200 bytes) */
#define OT_MAX_PEERS_UDP6 400
#define OT_MAX_PEERS_UDP4 400
#define OT_MAX_PEERS_UDP6 0
#define OT_MAX_PEERS_UDP4 0

#define OT_IP_SIZE6 16
#define OT_IP_SIZE4 4
Expand Down

1 comment on commit 4ce7763

@1265578519
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v0.3 20240514
修复间隔时间自动更新udp tracker只返回50个peer(v0.1 - v0.2 新建BT任务开始下载时可正确返回400用户),现强制锁定udp始终返回 numwant = 400
新增Top 100 torrents by leechers

Please sign in to comment.