diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-01-31 14:04:46 +0000 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-01-31 14:04:46 +0000 |
| commit | 146d5909e36fd84c42a3a72f7035f9e4cd0ea0d5 (patch) | |
| tree | b839fcb3e6ef4c1d8f014c8779b5e8471eaa2791 | |
| parent | ff722cfaee7b255fc83c1d775dcc0084f2d2d1f9 (diff) | |
| download | rabbitmq-server-git-146d5909e36fd84c42a3a72f7035f9e4cd0ea0d5.tar.gz | |
Better comment for gen/0.
| -rw-r--r-- | src/rabbit_basic.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_guid.erl | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl index 55bbdf3a77..85a18c7185 100644 --- a/src/rabbit_basic.erl +++ b/src/rabbit_basic.erl @@ -139,7 +139,7 @@ message(XName, RoutingKey, #content{properties = Props} = DecodedContent) -> {ok, #basic_message{ exchange_name = XName, content = strip_header(DecodedContent, ?DELETED_HEADER), - id = rabbit_guid:gen_secure(), + id = rabbit_guid:gen(), is_persistent = is_message_persistent(DecodedContent), routing_keys = [RoutingKey | header_routes(Props#'P_basic'.headers)]}} diff --git a/src/rabbit_guid.erl b/src/rabbit_guid.erl index 5751d660a3..d17144bc69 100644 --- a/src/rabbit_guid.erl +++ b/src/rabbit_guid.erl @@ -90,9 +90,10 @@ blocks_to_binary({B1, B2, B3, B4}) -> %% generate a GUID. This function should be used when performance is a %% priority and predictability is not an issue. Otherwise, use gen_secure/0. gen() -> - %% We hash a fresh GUID with md5, split it in 5 blocks, and each time we - %% need a new guid we hash the first block and the counter and xor the - %% result with the remaining blocks. + %% We hash a fresh GUID with md5, split it in 4 blocks, and each time we + %% need a new guid we hash the first block and the counter and XOR the + %% result with the remaining blocks, removing the first block and inserting + %% the hash as the last block. {BS, I} = case get(guid) of undefined -> |
