24
24
-define (OTHER_METRICS , [recv_cnt , send_cnt , send_pend , garbage_collection , state ,
25
25
timeout ]).
26
26
27
- -record (reader_state , {socket , conn_name , parse_state , processor_state , state ,
28
- conserve_resources , recv_outstanding , max_frame_size , frame_length ,
29
- stats_timer , parent , connection , heartbeat_sup , heartbeat ,
30
- timeout_sec % % heartbeat timeout value used, 0 means
31
- % % heartbeats are disabled
32
- }).
27
+ -record (reader_state , {
28
+ socket ,
29
+ conn_name ,
30
+ parse_state ,
31
+ processor_state ,
32
+ state ,
33
+ conserve_resources ,
34
+ recv_outstanding ,
35
+ max_frame_size ,
36
+ current_frame_size ,
37
+ stats_timer ,
38
+ parent ,
39
+ connection ,
40
+ heartbeat_sup , heartbeat ,
41
+ % % heartbeat timeout value used, 0 means
42
+ % % heartbeats are disabled
43
+ timeout_sec
44
+ }).
33
45
34
46
% %----------------------------------------------------------------------------
35
47
@@ -82,7 +94,7 @@ init([SupHelperPid, Ref, Configuration]) ->
82
94
heartbeat_sup = SupHelperPid ,
83
95
heartbeat = {none , none },
84
96
max_frame_size = MaxFrameSize ,
85
- frame_length = 0 ,
97
+ current_frame_size = 0 ,
86
98
state = running ,
87
99
conserve_resources = false ,
88
100
recv_outstanding = false })), # reader_state .stats_timer ),
@@ -226,7 +238,7 @@ process_received_bytes([], State) ->
226
238
process_received_bytes (Bytes ,
227
239
State = # reader_state {
228
240
max_frame_size = MaxFrameSize ,
229
- frame_length = FrameLength ,
241
+ current_frame_size = FrameLength ,
230
242
processor_state = ProcState ,
231
243
parse_state = ParseState }) ->
232
244
case rabbit_stomp_frame :parse (Bytes , ParseState ) of
@@ -238,7 +250,7 @@ process_received_bytes(Bytes,
238
250
{stop , normal , State };
239
251
false ->
240
252
{ok , State # reader_state {parse_state = ParseState1 ,
241
- frame_length = FrameLength1 }}
253
+ current_frame_size = FrameLength1 }}
242
254
end ;
243
255
{ok , Frame , Rest } ->
244
256
FrameLength1 = FrameLength + byte_size (Bytes ) - byte_size (Rest ),
@@ -252,7 +264,7 @@ process_received_bytes(Bytes,
252
264
PS = rabbit_stomp_frame :initial_state (),
253
265
NextState = maybe_block (State , Frame ),
254
266
process_received_bytes (Rest , NextState # reader_state {
255
- frame_length = 0 ,
267
+ current_frame_size = 0 ,
256
268
processor_state = NewProcState ,
257
269
parse_state = PS ,
258
270
connection = Conn });
0 commit comments