~ubuntu-branches/ubuntu/trusty/ejabberd/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/http-tls-leaks.patch

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs, Konstantin Khomoutov, Gerfried Fuchs
  • Date: 2010-01-14 20:40:53 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20100114204053-knme5bdbp0etweq9
Tags: 2.1.1-1
[ Konstantin Khomoutov ]
* New upstream release.
  This also fixes a bug in ejabberdctl (closes: #560824).
* Update mod_admin_extra to upstream revision 1049.
* Remove obsolete patches (those backported from 2.1.1).
* Suggest imagemagick instead of recommending it (closes: #560889).

[ Gerfried Fuchs ]
* Switch Vcs-* fields to point to new git repository. All the conversion
  work was actually done by Konstantin.
* Call debconf-updatepo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Fix memory and port leaks in web administration
2
 
interface when TLS is enabled for the HTTP listener.
3
 
 
4
 
This issue is tracked upstream as EJAB-1119.
5
 
 
6
 
This changeset was introduced in revisions 2790, 2792 in
7
 
branch http://svn.process-one.net/ejabberd/branches/ejabberd-2.1.x
8
 
 
9
 
The first stable version containing the fix is 2.1.1.
10
 
 
11
 
--- a/src/web/ejabberd_http.erl (revision 2789)
12
 
+++ b/src/web/ejabberd_http.erl (revision 2792)
13
 
@@ -35,6 +35,9 @@
14
 
         receive_headers/1,
15
 
         url_encode/1]).
16
 
 
17
 
+%% Callbacks
18
 
+-export([init/2]).
19
 
+
20
 
 -include("ejabberd.hrl").
21
 
 -include("jlib.hrl").
22
 
 -include("ejabberd_http.hrl").
23
 
@@ -79,7 +82,10 @@
24
 
 start(SockData, Opts) ->
25
 
     supervisor:start_child(ejabberd_http_sup, [SockData, Opts]).
26
 
 
27
 
-start_link({SockMod, Socket}, Opts) ->
28
 
+start_link(SockData, Opts) ->
29
 
+    {ok, proc_lib:spawn_link(ejabberd_http, init, [SockData, Opts])}.
30
 
+
31
 
+init({SockMod, Socket}, Opts) ->
32
 
     TLSEnabled = lists:member(tls, Opts),
33
 
     TLSOpts = lists:filter(fun({certfile, _}) -> true;
34
 
                              (_) -> false
35
 
@@ -129,11 +135,10 @@
36
 
     ?DEBUG("S: ~p~n", [RequestHandlers]),
37
 
 
38
 
     ?INFO_MSG("started: ~p", [{SockMod1, Socket1}]),
39
 
-    {ok, proc_lib:spawn_link(ejabberd_http,
40
 
-                            receive_headers,
41
 
-                            [#state{sockmod = SockMod1,
42
 
-                                    socket = Socket1,
43
 
-                                    request_handlers = RequestHandlers}])}.
44
 
+    State = #state{sockmod = SockMod1,
45
 
+                   socket = Socket1,
46
 
+                   request_handlers = RequestHandlers},
47
 
+    receive_headers(State).
48
 
 
49
 
 
50
 
 become_controller(_Pid) ->