happyfish100 / happyfish100/fastdfs-client-java

TrackerClient.listStorages协议传参最大长度和服务端不太符合

Open
#110 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.6k
Forks
891
PR merge metrics
No merged PRs in 30d

Description

TrackerClient.listStorages 第三个参数storageIpAddr,似乎在tracker服务端是指storageId。不支持ipv6之前 id的最大长度和ip最大长度一致,所以没有问题,支持ipv6之后,ip最长长度变成46,而id还是16,客户端如果传入ipv6地址,会传更大的协议包体,服务端会解析失败。

607行最大长度是不是限制下改成FDFS_STORAGE_ID_MAX_SIZE

https://github.com/happyfish100/fastdfs-client-java/blob/9d9b1d7fdb4b789029732eceb69a62061ffb496f/src/main/java/org/csource/fastdfs/TrackerClient.java#L604-L607

https://github.com/happyfish100/fastdfs/blob/030520cb3aad56004e92ab097fc6f1e0a10c652e/tracker/tracker_service.c#L2155-L2168

1704872715548

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/main/java/org/csource/fastdfs/TrackerClient.java at lines 604-607, then compare the parameter handling with tracker_service.c lines 2155-2168 in the linked FastDFS server source. Verify the maximum length used for storageIpAddr and test that an IPv6 value produces a protocol payload the server can parse successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.