Hi, 

find attached the debdiff to correct the stable version of tsung

Cheers,

-- 
Mehdi Abaakouk
mail: sil...@sileht.net
irc: sileht
diff -Nru tsung-1.4.2/debian/changelog tsung-1.4.2/debian/changelog
--- tsung-1.4.2/debian/changelog        2012-01-08 07:33:27.000000000 +0100
+++ tsung-1.4.2/debian/changelog        2012-10-24 18:47:51.000000000 +0200
@@ -1,3 +1,10 @@
+tsung (1.4.2-2) unstable; urgency=low
+
+  * debian/patches:
+    - debian/patches/02_fix_tsung_recorder_crash_dump.diff (Closes: 691354)
+
+ -- Mehdi Abaakouk <sil...@sileht.net>  Wed, 24 Oct 2012 18:28:42 +0200
+
 tsung (1.4.2-1) unstable; urgency=low
 
   * New upstream version. (Closes: 653211)
diff -Nru tsung-1.4.2/debian/patches/02_fix_tsung_recorder_crash_dump.diff 
tsung-1.4.2/debian/patches/02_fix_tsung_recorder_crash_dump.diff
--- tsung-1.4.2/debian/patches/02_fix_tsung_recorder_crash_dump.diff    
1970-01-01 01:00:00.000000000 +0100
+++ tsung-1.4.2/debian/patches/02_fix_tsung_recorder_crash_dump.diff    
2012-10-24 18:18:31.000000000 +0200
@@ -0,0 +1,64 @@
+commit 839efc2fdbe88f6241996e4ecdbd2acfd03171d7
+Author: Nicolas Niclausse <nico...@niclux.org>
+Date:   Mon Sep 10 12:37:23 2012 +0200
+
+    fix race condition in recorder (TSUN-218)
+
+diff --git a/src/tsung_recorder/ts_client_proxy.erl 
b/src/tsung_recorder/ts_client_proxy.erl
+index c2865df..1c9f0ee 100644
+--- a/src/tsung_recorder/ts_client_proxy.erl
++++ b/src/tsung_recorder/ts_client_proxy.erl
+@@ -45,7 +45,7 @@
+ 
+ %%--------------------------------------------------------------------
+ %% External exports
+--export([start/1]).
++-export([start/1, set_active/1]).
+ 
+ %% gen_server callbacks
+ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
+@@ -61,6 +61,10 @@
+ start(Socket) ->
+     gen_server:start_link(?MODULE, [Socket], []).
+ 
++%% tells the client to activate socket
++set_active(Pid) ->
++    gen_server:cast(Pid, {set_active}).
++
+ %%====================================================================
+ %% Server functions
+ %%====================================================================
+@@ -99,6 +103,10 @@ handle_call(_Request, _From, State) ->
+ %%          {noreply, State, Timeout} |
+ %%          {stop, Reason, State}            (terminate/2 is called)
+ %%--------------------------------------------------------------------
++handle_cast({set_active}, State=#proxy{clientsock=Socket}) ->
++    ts_utils:inet_setopts(tcp, Socket,[{active, once}]),
++    {noreply, State};
++
+ handle_cast(_Msg, State) ->
+     {noreply, State}.
+ 
+diff --git a/src/tsung_recorder/ts_proxy_listener.erl 
b/src/tsung_recorder/ts_proxy_listener.erl
+index fa3ba58..d2b6e23 100644
+--- a/src/tsung_recorder/ts_proxy_listener.erl
++++ b/src/tsung_recorder/ts_proxy_listener.erl
+@@ -120,7 +120,8 @@ handle_call({accepted, _Tag, ClientSock}, _From, State) ->
+     case ts_client_proxy_sup:start_child(ClientSock) of
+         {ok, Pid} ->
+             ?LOGF("New connection from~p~n", 
[inet:peername(ClientSock)],?INFO),
+-            ok = gen_tcp:controlling_process(ClientSock, Pid);
++            ok = gen_tcp:controlling_process(ClientSock, Pid),
++            ts_client_proxy:set_active(Pid);
+         Error ->
+             ?LOGF("Failed to launch new client ~p~n",[Error],?ERR),
+             gen_tcp:close(ClientSock)
+@@ -199,7 +200,7 @@ activate(State=#state{plugin=Plugin})->
+         undefined ->
+             Portno=?config(proxy_listen_port),
+             Opts = lists:append(Plugin:socket_opts(),
+-                                [{reuseaddr, true}, {active, once}]),
++                                [{reuseaddr, true}, {active, false}]),
+             case gen_tcp:listen(Portno, Opts) of
+                 {ok, ServerSock} ->
+                     {ok, State#state
diff -Nru tsung-1.4.2/debian/patches/series tsung-1.4.2/debian/patches/series
--- tsung-1.4.2/debian/patches/series   2012-01-08 07:30:04.000000000 +0100
+++ tsung-1.4.2/debian/patches/series   2012-10-24 18:19:45.000000000 +0200
@@ -1 +1,2 @@
 01_spelling_corrections.diff
+02_fix_tsung_recorder_crash_dump.diff

Attachment: signature.asc
Description: Digital signature

Reply via email to