From 7a8e53d855d46f0e48bc78d99c81fc9620368489 Mon Sep 17 00:00:00 2001 From: Mistagrooves Date: Wed, 22 Feb 2012 17:17:17 -0500 Subject: [PATCH] Updated method of checking for empty --- rebar.bat | 4 ++++ src/ibrowse_http_client.erl | 10 +++------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 rebar.bat diff --git a/rebar.bat b/rebar.bat new file mode 100644 index 0000000..87e1e1a --- /dev/null +++ b/rebar.bat @@ -0,0 +1,4 @@ +@echo off +setlocal +set rebarscript=%~f0 +"C:\Program Files (x86)\erl5.8.4\bin\escript.exe" "%rebarscript:.bat=%" %* diff --git a/src/ibrowse_http_client.erl b/src/ibrowse_http_client.erl index 5211630..4ad962f 100644 --- a/src/ibrowse_http_client.erl +++ b/src/ibrowse_http_client.erl @@ -562,17 +562,13 @@ do_send_body(Body, State, _TE) -> do_send_body1(Source, Resp, State, TE) -> case Resp of - {ok, <<>>} -> + {ok, Data} when Data == []; Data == <<>> -> do_send_body({Source}, State, TE); - {ok, <<>>, New_source_state} -> - do_send_body({Source, New_source_state}, State, TE); - {ok, []} -> - do_send_body({Source}, State, TE); - {ok, [], New_source_state} -> - do_send_body({Source, New_source_state}, State, TE); {ok, Data} -> do_send(maybe_chunked_encode(Data, TE), State), do_send_body({Source}, State, TE); + {ok, Data, New_source_state} when Data == []; Data == <<>> -> + do_send_body({Source, New_source_state}, State, TE); {ok, Data, New_source_state} -> do_send(maybe_chunked_encode(Data, TE), State), do_send_body({Source, New_source_state}, State, TE);