summaryrefslogtreecommitdiff
path: root/src/rabbit_msg_file.erl
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-09-01 12:09:33 +0100
committerMatthew Sackman <matthew@lshift.net>2009-09-01 12:09:33 +0100
commitf112cd9df2dbf427c576e79100515f8ebdfe6357 (patch)
treec0d7c7589a4aa50c2a1b104efeadce5c60dd5c47 /src/rabbit_msg_file.erl
parentdfda3707d08a0b72fcfba594dc113ef91192a05f (diff)
downloadrabbitmq-server-f112cd9df2dbf427c576e79100515f8ebdfe6357.tar.gz
Read through all of Matthias changes, no problems. In here, one cosmetic, and one change so that rmf:read returns the MsgId off disk to be later matched. This is purely defensive.
Diffstat (limited to 'src/rabbit_msg_file.erl')
-rw-r--r--src/rabbit_msg_file.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_msg_file.erl b/src/rabbit_msg_file.erl
index 6cf11ac8..70b04c09 100644
--- a/src/rabbit_msg_file.erl
+++ b/src/rabbit_msg_file.erl
@@ -70,13 +70,13 @@ read(FileHdl, TotalSize) ->
MsgIdBinSize:?INTEGER_SIZE_BITS,
Rest:SizeWriteOkBytes/binary>>} ->
BodySize = Size - MsgIdBinSize,
- <<_MsgId:MsgIdBinSize/binary, MsgBody:BodySize/binary,
+ <<MsgId:MsgIdBinSize/binary, MsgBody:BodySize/binary,
StopByte:?WRITE_OK_SIZE_BITS>> = Rest,
Persistent = case StopByte of
?WRITE_OK_TRANSIENT -> false;
?WRITE_OK_PERSISTENT -> true
end,
- {ok, {MsgBody, Persistent, BodySize}};
+ {ok, {binary_to_term(MsgId), MsgBody, Persistent, BodySize}};
KO -> KO
end.