From b9da9d4ed3ef9fe7b1488506555e3605aeb500ed Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 16 Dec 2012 16:00:18 +0900 Subject: Use 64 bits random bytes as GID This change replaces the current 64 bit sequential GID with 64 bits random bytes GID in an attempt to support persistent GID. Internally, the GID is stored as uint64_t. For human representation and RPC interface, GID is represented as 16 bytes hex string. For console readout, 16 bytes are too long, so it is abbreviated to first 6 bytes. When querying GID in RPC calls, user can speicfy the prefix of GID as long as the prefix is shared by more than 1 GID entries. --- src/HttpResponseCommand.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/HttpResponseCommand.cc') diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index e85a0329..c04e5818 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -189,7 +189,7 @@ bool HttpResponseCommand::executeInternal() getDownloadContext()->setChecksumVerified(true); A2_LOG_NOTICE (fmt(MSG_DOWNLOAD_ALREADY_COMPLETED, - getRequestGroup()->getGID(), + GroupId::toHex(getRequestGroup()->getGID()).c_str(), getRequestGroup()->getFirstFilePath().c_str())); poolConnection(); getFileEntry()->poolRequest(getRequest()); @@ -453,7 +453,7 @@ bool HttpResponseCommand::handleOtherEncoding getDownloadContext()->setChecksumVerified(true); A2_LOG_NOTICE (fmt(MSG_DOWNLOAD_ALREADY_COMPLETED, - getRequestGroup()->getGID(), + GroupId::toHex(getRequestGroup()->getGID()).c_str(), getRequestGroup()->getFirstFilePath().c_str())); } poolConnection(); -- cgit