Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove amqp relative code

  • Loading branch information...
commit b058a44cd3ac29adb5042ff3db4543218a0592af 1 parent a7d4d0e
@erylee authored
Showing with 9 additions and 53 deletions.
  1. +9 −16 src/rabbit_reader.erl
  2. +0 −37 src/rabbit_types.erl
View
25 src/rabbit_reader.erl
@@ -23,7 +23,7 @@
-export([system_continue/3, system_terminate/4, system_code_change/4]).
--export([init/4, mainloop/2]).
+-export([init/2, mainloop/2]).
-export([conserve_memory/2, server_properties/1]).
@@ -37,7 +37,7 @@
%%--------------------------------------------------------------------------
--record(v1, {parent, sock, connection, callback, recv_len, pending_recv,
+-record(v1, {parent, clientpid, sock, connection, callback, recv_len, pending_recv,
connection_state, queue_collector, stats_timer,
channel_sup_sup_pid, start_heartbeat_fun, buf, buf_len,
auth_mechanism, auth_state}).
@@ -76,11 +76,9 @@
rabbit_framing:amqp_table()).
%% These specs only exists to add no_return() to keep dialyzer happy
--spec(init/4 :: (pid(), pid(), pid(), rabbit_heartbeat:start_heartbeat_fun())
- -> no_return()).
--spec(start_connection/7 ::
- (pid(), pid(), pid(), rabbit_heartbeat:start_heartbeat_fun(), any(),
- rabbit_net:socket(),
+-spec(init/2 :: (pid(), pid()) -> no_return()).
+-spec(start_connection/5 ::
+ (pid(), pid(), any(), rabbit_net:socket(),
fun ((rabbit_net:socket()) ->
rabbit_types:ok_or_error2(
rabbit_net:socket(), any()))) -> no_return()).
@@ -109,7 +107,7 @@ init(Parent, ClientPid) ->
receive
{go, Sock, SockTransform} ->
start_connection(
- Parent, ChannelSupSupPid,Deb, Sock, SockTransform)
+ Parent, ClientPid, Deb, Sock, SockTransform)
end.
system_continue(Parent, Deb, State) ->
@@ -187,7 +185,7 @@ socket_op(Sock, Fun) ->
exit(normal)
end.
-start_connection(Parent, ClientPid, Deb, Sock, SockTransform) ->
+start_connection(Parent, _ClientPid, Deb, Sock, SockTransform) ->
process_flag(trap_exit, true),
{PeerAddress, PeerPort} = socket_op(Sock, fun rabbit_net:peername/1),
PeerAddressS = rabbit_misc:ntoab(PeerAddress),
@@ -210,7 +208,6 @@ start_connection(Parent, ClientPid, Deb, Sock, SockTransform) ->
recv_len = 0,
pending_recv = false,
connection_state = pre_init,
- heartbeater = none,
clientpid = clientpid,
buf = [],
buf_len = 0,
@@ -340,9 +337,7 @@ handle_other(Other, _Deb, _State) ->
%% internal error -> something worth dying for
exit({unexpected_message, Other}).
-switch_callback(State = #v1{connection_state = blocked,
- heartbeater = Heartbeater}, Callback, Length) ->
- ok = rabbit_heartbeat:pause_monitor(Heartbeater),
+switch_callback(State = #v1{connection_state = blocked }, Callback, Length) ->
State#v1{callback = Callback, recv_len = Length};
switch_callback(State, Callback, Length) ->
State#v1{callback = Callback, recv_len = Length}.
@@ -358,9 +353,7 @@ internal_conserve_memory(true, State = #v1{connection_state = running}) ->
State#v1{connection_state = blocking};
internal_conserve_memory(false, State = #v1{connection_state = blocking}) ->
State#v1{connection_state = running};
-internal_conserve_memory(false, State = #v1{connection_state = blocked,
- heartbeater = Heartbeater}) ->
- ok = rabbit_heartbeat:resume_monitor(Heartbeater),
+internal_conserve_memory(false, State = #v1{connection_state = blocked}) ->
State#v1{connection_state = running};
internal_conserve_memory(_Conserve, State) ->
State.
View
37 src/rabbit_types.erl
@@ -21,11 +21,7 @@
-ifdef(use_specs).
-export_type([maybe/1, info/0, infos/0, info_key/0, info_keys/0,
- message/0, msg_id/0, basic_message/0,
- delivery/0, content/0, decoded_content/0, undecoded_content/0,
- unencoded_content/0, encoded_content/0, message_properties/0,
vhost/0, ctag/0, amqp_error/0, r/1, r2/2, r3/3, listener/0,
- binding/0, binding_source/0, binding_destination/0,
amqqueue/0,
connection/0, protocol/0, user/0, internal_user/0,
username/0, password/0, password_hash/0, ok/1, error/1,
@@ -41,37 +37,6 @@
%% TODO: make this more precise by tying specific class_ids to
%% specific properties
--type(undecoded_content() ::
- #content{class_id :: rabbit_framing:amqp_class_id(),
- properties :: 'none',
- properties_bin :: binary(),
- payload_fragments_rev :: [binary()]} |
- #content{class_id :: rabbit_framing:amqp_class_id(),
- properties :: rabbit_framing:amqp_property_record(),
- properties_bin :: 'none',
- payload_fragments_rev :: [binary()]}).
--type(unencoded_content() :: undecoded_content()).
--type(decoded_content() ::
- #content{class_id :: rabbit_framing:amqp_class_id(),
- properties :: rabbit_framing:amqp_property_record(),
- properties_bin :: maybe(binary()),
- payload_fragments_rev :: [binary()]}).
--type(encoded_content() ::
- #content{class_id :: rabbit_framing:amqp_class_id(),
- properties :: maybe(rabbit_framing:amqp_property_record()),
- properties_bin :: binary(),
- payload_fragments_rev :: [binary()]}).
--type(content() :: undecoded_content() | decoded_content()).
--type(message() :: basic_message()).
--type(delivery() ::
- #delivery{mandatory :: boolean(),
- immediate :: boolean(),
- sender :: pid(),
- message :: message()}).
--type(message_properties() ::
- #message_properties{expiry :: pos_integer() | 'undefined',
- needs_confirming :: boolean()}).
-
-type(info_key() :: atom()).
-type(info_keys() :: [info_key()]).
@@ -98,8 +63,6 @@
host :: rabbit_networking:hostname(),
port :: rabbit_networking:ip_port()}).
-
-
-type(amqqueue() ::
#amqqueue{name :: rabbit_amqqueue:name(),
durable :: boolean(),
Please sign in to comment.
Something went wrong with that request. Please try again.