Permalink
Browse files

merge fix from trunk for bidi support

SVN Revision: 814
  • Loading branch information...
1 parent ead790a commit 7df23f08ca23dfb2fa3a5cca08a9912a5d5f5cd9 @nniclausse nniclausse committed Mar 3, 2008
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/tsung/ts_client.erl
View
@@ -245,6 +245,17 @@ handle_info({NetEvent, Socket, Data}, think,State=#state_rcv{
NewSocket = ts_utils:inet_setopts(Proto, State#state_rcv.socket,
[{active, once}]),
{next_state, think, NewState#state_rcv{socket=NewSocket}};
+% bidi is false, but parse is also false: continue even if we get data
+handle_info({NetEvent, _Socket, Data}, think, State = #state_rcv{request=Req} )
+ when (Req#ts_request.ack /= parse) and ((NetEvent == tcp) or (NetEvent==ssl)) ->
+ ts_mon:rcvmes({State#state_rcv.dump, self(), Data}),
+ ts_mon:add({ sum, size_rcv, size(Data)}),
+ ?LOGF("Data receive from socket in state think, ack=~p, skip~n",
+ [Req#ts_request.ack],?NOTICE),
+ ?DebugF("Data was ~p~n",[Data]),
+ NewSocket = ts_utils:inet_setopts(State#state_rcv.protocol, State#state_rcv.socket,
+ [{active, once}]),
+ {next_state, think, State#state_rcv{socket=NewSocket}};
handle_info({NetEvent, _Socket, Data}, think, State)
when (NetEvent == tcp) or (NetEvent==ssl) ->
ts_mon:rcvmes({State#state_rcv.dump, self(), Data}),

0 comments on commit 7df23f0

Please sign in to comment.