[erlang-mochiweb] Fixed regression (see https://github.com/mochi/mochiweb/issues/97 )

Peter Lemenkov peter at fedoraproject.org
Sat Jan 26 12:18:02 UTC 2013


commit 463e0c86e81b5437bf849cbc7b231b26aa8a17e0
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Sat Jan 26 16:17:48 2013 +0400

    Fixed regression (see https://github.com/mochi/mochiweb/issues/97 )
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 ...hiweb-0001-96-mochifmt_records-regression.patch |    2 +-
 ...ochiweb-acceptor-blocked-in-ssl-handshake.patch |    2 +-
 ...b-0003-fix-mochiweb_request-regression-97.patch |   40 ++++++++++++++++++++
 erlang-mochiweb.spec                               |    8 +++-
 4 files changed, 49 insertions(+), 3 deletions(-)
---
diff --git a/erlang-mochiweb-0001-96-mochifmt_records-regression.patch b/erlang-mochiweb-0001-96-mochifmt_records-regression.patch
index 9f99adf..5117571 100644
--- a/erlang-mochiweb-0001-96-mochifmt_records-regression.patch
+++ b/erlang-mochiweb-0001-96-mochifmt_records-regression.patch
@@ -1,7 +1,7 @@
 From 6d3d7901791417eaa7f17c81a8477210d0884ed0 Mon Sep 17 00:00:00 2001
 From: Bob Ippolito <bob at redivi.com>
 Date: Thu, 24 Jan 2013 12:58:14 -0800
-Subject: [PATCH 1/2] #96 - mochifmt_records regression
+Subject: [PATCH 1/3] #96 - mochifmt_records regression
 
 ---
  CHANGES.md               | 5 +++++
diff --git a/erlang-mochiweb-0002-Fix-Mochiweb-acceptor-blocked-in-ssl-handshake.patch b/erlang-mochiweb-0002-Fix-Mochiweb-acceptor-blocked-in-ssl-handshake.patch
index 2ddf064..c05d371 100644
--- a/erlang-mochiweb-0002-Fix-Mochiweb-acceptor-blocked-in-ssl-handshake.patch
+++ b/erlang-mochiweb-0002-Fix-Mochiweb-acceptor-blocked-in-ssl-handshake.patch
@@ -1,7 +1,7 @@
 From a79466f14c6cede7f74c13e7553e5f73353cff74 Mon Sep 17 00:00:00 2001
 From: Wei Cao <cyg.cao at gmail.com>
 Date: Thu, 16 Aug 2012 10:53:07 +0800
-Subject: [PATCH 2/2] Fix Mochiweb acceptor blocked in ssl handshake
+Subject: [PATCH 2/3] Fix Mochiweb acceptor blocked in ssl handshake
 
 Acceptor cannot be recycled until ssl handshake is done,
 so it's possible and easy for all acceptors be blocked between the point
diff --git a/erlang-mochiweb-0003-fix-mochiweb_request-regression-97.patch b/erlang-mochiweb-0003-fix-mochiweb_request-regression-97.patch
new file mode 100644
index 0000000..73104e5
--- /dev/null
+++ b/erlang-mochiweb-0003-fix-mochiweb_request-regression-97.patch
@@ -0,0 +1,40 @@
+From 97c19d17b208a25d262b7bacc203d122d1becd26 Mon Sep 17 00:00:00 2001
+From: Bob Ippolito <bob at redivi.com>
+Date: Fri, 25 Jan 2013 16:19:05 -0800
+Subject: [PATCH 3/3] fix mochiweb_request regression #97
+
+---
+ CHANGES.md               | 2 ++
+ src/mochiweb_request.erl | 4 +++-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/CHANGES.md b/CHANGES.md
+index 2114a57..ae16240 100644
+--- a/CHANGES.md
++++ b/CHANGES.md
+@@ -1,5 +1,7 @@
+ Version 2.4.1 released XXXX-XX-XX
+ 
++* Fixed issue in mochiweb_request introduced in v2.4.0
++  https://github.com/mochi/mochiweb/issues/97
+ * Fixed issue in mochifmt_records introduced in v2.4.0
+   https://github.com/mochi/mochiweb/issues/96
+ 
+diff --git a/src/mochiweb_request.erl b/src/mochiweb_request.erl
+index 0eacc71..1b431d3 100644
+--- a/src/mochiweb_request.erl
++++ b/src/mochiweb_request.erl
+@@ -306,7 +306,9 @@ respond({Code, ResponseHeaders, {file, IoDevice}},
+         'HEAD' ->
+             ok;
+         _ ->
+-            mochiweb_io:iodevice_stream(fun send/2, IoDevice)
++            mochiweb_io:iodevice_stream(
++              fun (Body) -> send(Body, THIS) end,
++              IoDevice)
+     end,
+     Response;
+ respond({Code, ResponseHeaders, chunked}, {?MODULE, [_Socket, Method, _RawPath, Version, _Headers]}=THIS) ->
+-- 
+1.8.1
+
diff --git a/erlang-mochiweb.spec b/erlang-mochiweb.spec
index 1ffc810..b17c97b 100644
--- a/erlang-mochiweb.spec
+++ b/erlang-mochiweb.spec
@@ -7,7 +7,7 @@
 
 Name:		erlang-%{realname}
 Version:	2.4.0
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	An Erlang library for building lightweight HTTP servers
 Group:		Development/Libraries
 License:	MIT
@@ -18,6 +18,8 @@ Source0:	%{upstream}-%{realname}-v%{version}-%{patchnumber}-g%{git_tag}.tar.gz
 Patch1:		erlang-mochiweb-0001-96-mochifmt_records-regression.patch
 # used in CouchDB, see https://github.com/mochi/mochiweb/issues/70
 Patch2:		erlang-mochiweb-0002-Fix-Mochiweb-acceptor-blocked-in-ssl-handshake.patch
+# Backported from master
+Patch3:		erlang-mochiweb-0003-fix-mochiweb_request-regression-97.patch
 BuildRequires:	erlang-rebar
 BuildRequires:	erlang-xmerl
 Requires:	erlang-compiler%{?_isa}
@@ -42,6 +44,7 @@ An Erlang library for building lightweight HTTP servers.
 %setup -q -n %{upstream}-%{realname}-%{git_tag}
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 
 %build
@@ -106,6 +109,9 @@ rebar eunit -v
 
 
 %changelog
+* Sat Jan 26 2013 Peter Lemenkov <lemenkov at gmail.com> - 2.4.0-2
+- Fixed regression (see https://github.com/mochi/mochiweb/issues/97 )
+
 * Fri Jan 25 2013 Peter Lemenkov <lemenkov at gmail.com> - 2.4.0-1
 - Ver. 2.4.0 (fix for Erlang R16)
 - Dropped patches for EL5 (Erlang R12B)


More information about the scm-commits mailing list