summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Alexandru Ionescu <vlad@rabbitmq.com>2010-09-01 12:07:08 +0100
committerVlad Alexandru Ionescu <vlad@rabbitmq.com>2010-09-01 12:07:08 +0100
commit1c0694b6be30c0970cde799fe5d5548e1e449d2e (patch)
tree71d99de582a854c65779d1d8bc2f12eec2a883ad
parent70b482894568887c0196f542c9733613609f506f (diff)
downloadrabbitmq-server-bug23215.tar.gz
fixing premature generalisationbug23215
-rw-r--r--src/rabbit_writer.erl33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/rabbit_writer.erl b/src/rabbit_writer.erl
index f8d6cbd5..fc1d96cf 100644
--- a/src/rabbit_writer.erl
+++ b/src/rabbit_writer.erl
@@ -127,6 +127,21 @@ handle_message({send_command, MethodRecord, Content},
ok = internal_send_command_async(Sock, Channel, MethodRecord,
Content, FrameMax, Protocol),
State;
+handle_message({'$gen_call', From, {send_command_sync, MethodRecord}},
+ State = #wstate{sock = Sock, channel = Channel,
+ protocol = Protocol}) ->
+ ok = internal_send_command_async(Sock, Channel, MethodRecord, Protocol),
+ gen_server:reply(From, ok),
+ State;
+handle_message({'$gen_call', From, {send_command_sync, MethodRecord, Content}},
+ State = #wstate{sock = Sock,
+ channel = Channel,
+ frame_max = FrameMax,
+ protocol = Protocol}) ->
+ ok = internal_send_command_async(Sock, Channel, MethodRecord,
+ Content, FrameMax, Protocol),
+ gen_server:reply(From, ok),
+ State;
handle_message({send_command_and_notify, QPid, ChPid, MethodRecord, Content},
State = #wstate{sock = Sock,
channel = Channel,
@@ -140,27 +155,9 @@ handle_message({inet_reply, _, ok}, State) ->
State;
handle_message({inet_reply, _, Status}, _State) ->
exit({writer, send_failed, Status});
-handle_message({'$gen_call', From, Msg}, State) ->
- case handle_call(From, Msg, State) of
- {reply, Reply, State2} -> gen_server:reply(From, Reply), State2;
- {noreply, State2} -> State2;
- {stop, Reason, _State2} -> exit(Reason)
- end;
handle_message(Message, _State) ->
exit({writer, message_not_understood, Message}).
-handle_call({send_command_async, MethodRecord}, _From,
- State = #wstate{sock = Sock, channel = Channel,
- protocol = Protocol}) ->
- ok = internal_send_command_async(Sock, Channel, MethodRecord, Protocol),
- {reply, ok, State};
-handle_call({send_command_async, MethodRecord, Content}, _From,
- State = #wstate{sock = Sock, channel = Channel,
- frame_max = FrameMax, protocol = Protocol}) ->
- ok = internal_send_command_async(Sock, Channel, MethodRecord,
- Content, FrameMax, Protocol),
- {reply, ok, State}.
-
%---------------------------------------------------------------------------
send_command(W, MethodRecord) ->