diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2011-01-13 01:54:12 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-01-13 01:54:12 +0000 |
commit | 6a4b29d4761df133061f2da5908d2c288f5c9fe2 (patch) | |
tree | ef81dc10483d765d26ad9483f4c3c197abadf4c0 | |
parent | 65a5ba3b58a04c80ec0d212dc9a506574bf4f64a (diff) | |
download | rabbitmq-server-6a4b29d4761df133061f2da5908d2c288f5c9fe2.tar.gz |
cosmetic
-rw-r--r-- | src/rabbit_channel.erl | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 1b998f31..dc160452 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -532,13 +532,12 @@ handle_method(#'basic.publish'{exchange = ExchangeNameBin, DecodedContent = rabbit_binary_parser:ensure_content_decoded(Content), check_user_id_header(DecodedContent#content.properties, State), IsPersistent = is_message_persistent(DecodedContent), - {MsgSeqNo, State1} - = case ConfirmEnabled of - false -> {undefined, State}; - true -> SeqNo = State#ch.publish_seqno, - {SeqNo, - State#ch{publish_seqno = SeqNo + 1}} - end, + {MsgSeqNo, State1} = + case ConfirmEnabled of + false -> {undefined, State}; + true -> SeqNo = State#ch.publish_seqno, + {SeqNo, State#ch{publish_seqno = SeqNo + 1}} + end, Message = #basic_message{exchange_name = ExchangeName, routing_key = RoutingKey, content = DecodedContent, @@ -1217,13 +1216,11 @@ process_routing_result(routed, [], MsgSeqNo, _, State) -> send_confirms([MsgSeqNo], State); process_routing_result(routed, _, undefined, _, State) -> State; -process_routing_result(routed, QPids, MsgSeqNo, _, - State = #ch{queues_for_msg = QFM, - unconfirmed = UC}) -> - QFM1 = dict:store(MsgSeqNo, sets:from_list(QPids), QFM), +process_routing_result(routed, QPids, MsgSeqNo, _, State) -> + #ch{queues_for_msg = QFM, unconfirmed = UC} = State, [maybe_monitor(QPid) || QPid <- QPids], - State#ch{queues_for_msg = QFM1, - unconfirmed = gb_sets:add(MsgSeqNo, UC)}. + State#ch{queues_for_msg = dict:store(MsgSeqNo, sets:from_list(QPids), QFM), + unconfirmed = gb_sets:add(MsgSeqNo, UC)}. lock_message(true, MsgStruct, State = #ch{unacked_message_q = UAMQ}) -> State#ch{unacked_message_q = queue:in(MsgStruct, UAMQ)}; |