Permalink
Browse files

Fixed bug with the save_response_to_file option.

  • Loading branch information...
1 parent 9c4f414 commit 6ed0f3efeee94ea6576d5a35ab966c463efc1cc4 Chandrashekhar Mullaparthi committed Feb 9, 2011
Showing with 15 additions and 5 deletions.
  1. +9 −3 README
  2. +0 −1 src/ibrowse.erl
  3. +6 −1 src/ibrowse_http_client.erl
View
12 README
@@ -18,7 +18,7 @@ ibrowse is available under two different licenses. LGPL or the BSD license.
Comments to : Chandrashekhar.Mullaparthi@gmail.com
-Version : 2.1.3
+Version : 2.1.4
Latest version : git://github.com/cmullaparthi/ibrowse.git
@@ -51,6 +51,7 @@ Paul J. Davis
Peter Kristensen
Ram Krishnan
Richard Cameron
+Ryan Zezeski
Sean Hinde
Seth Falcon
Steve Vinoski
@@ -61,6 +62,11 @@ tholschuh (https://github.com/tholschuh/)
CONTRIBUTIONS & CHANGE HISTORY
==============================
+09-02-2011 - v2.1.4
+ * Fixed a bug reported by Ryan Zezeski with the
+ save_response_to_file option.
+ https://github.com/cmullaparthi/ibrowse/issues#issue/33
+
16-01-2011 - v2.1.3
* Fixed issues with streaming and chunked responses when using
the 'caller controls socket' feature. See following links for
@@ -297,7 +303,7 @@ CONTRIBUTIONS & CHANGE HISTORY
12-01-2007 - Derek Upham sent in a bug fix. The reset_state function was not
behaving correctly when the transfer encoding was not chunked.
-13-11-2006 - Youns Hafri reported a bug where ibrowse was not returning the
+13-11-2006 - Youns Hafri reported a bug where ibrowse was not returning the
temporary filename when the server was closing the connection
after sending the data (as in HTTP/1.0).
Released ibrowse under the BSD license
@@ -316,7 +322,7 @@ CONTRIBUTIONS & CHANGE HISTORY
22-Nov-2005 - Added ability to generate requests using the Chunked
Transfer-Encoding.
-08-May-2005 - Youns Hafri made a CRUX LINUX port of ibrowse.
+08-May-2005 - Youns Hafri made a CRUX LINUX port of ibrowse.
http://yhafri.club.fr/crux/index.html
Here are some usage examples. Enjoy!
View
@@ -7,7 +7,6 @@
%%%-------------------------------------------------------------------
%% @author Chandrashekhar Mullaparthi <chandrashekhar dot mullaparthi at gmail dot com>
%% @copyright 2005-2011 Chandrashekhar Mullaparthi
-%% @version 2.1.3
%% @doc The ibrowse application implements an HTTP 1.1 client in erlang. This
%% module implements the API of the HTTP client. There is one named
%% process called 'ibrowse' which assists in load balancing and maintaining configuration. There is one load balancing process per unique webserver. There is
@@ -1278,7 +1278,12 @@ handle_response(#request{from=From, stream_to=StreamTo, req_id=ReqId,
reply_buffer = RepBuf,
recvd_headers = RespHeaders}=State) when SaveResponseToFile /= false ->
Body = RepBuf,
- ok = file:close(Fd),
+ case Fd of
+ undefined ->
+ ok;
+ _ ->
+ ok = file:close(Fd)
+ end,
ResponseBody = case TmpFilename of
undefined ->
Body;

0 comments on commit 6ed0f3e

Please sign in to comment.