killme2008 / xmemcached

High performance, easy to use multithreaded memcached client in java.
http://fnil.net/xmemcached
Apache License 2.0
757 stars 280 forks source link

Fix authentication on IP change #81

Closed saschat closed 6 years ago

saschat commented 6 years ago

This fixes #68

The problem was the the AuthInfoMap stores an AuthInfo for a server's InetSocketAddress. Unfortunately, the InetSocketAddress hash is based on the resolved IP which can change. For this reason I changed the AuthInfoMap to store the AuthInfo based on the servers (hostname:port) string.

Note, I tried to fix this problem without changing any public interface but I don't like it. I could also change the MemcachedClient.getAuthInfoMap() from public Map<InetSocketAddress, AuthInfo> getAuthInfoMap(); to public Map<String, AuthInfo> getAuthInfoMap(); instead. This would be a bit nicer but change the interface. What do you think?

Review by commit. The first commit only removes trailing whitespaces. The code changes are all in the second commit.

killme2008 commented 6 years ago

@saschat Thanks a lot

saschat commented 6 years ago

Thank you!

saschat commented 6 years ago

@killme2008 Is it possible to make a release to the Maven repo of version 2.4.3 containing this fix?

killme2008 commented 6 years ago

@saschat OK, i will release it today.

saschat commented 6 years ago

@killme2008 Thanks a lot!

killme2008 commented 6 years ago

@saschat I released 2.4.3, it may take sometime to be synced into maven central repository.

https://github.com/killme2008/xmemcached/releases/tag/xmemcached-2.4.3