Explorar el Código

Release under BSD license. Fix for bug reported by Younes Hafri. See README for more details

pull/16/head
chandrusf hace 18 años
padre
commit
f39609df94
Se han modificado 4 ficheros con 42 adiciones y 13 borrados
  1. +10
    -0
      BSD_LICENSE
  2. +18
    -8
      README
  3. +13
    -4
      src/ibrowse_http_client.erl
  4. +1
    -1
      vsn.mk

+ 10
- 0
BSD_LICENSE Ver fichero

@ -0,0 +1,10 @@
Copyright (c) 2006, Chandrashekhar Mullaparthi
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the T-Mobile nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 18
- 8
README Ver fichero

@ -1,4 +1,4 @@
$Id: README,v 1.5 2006/10/12 09:25:29 chandrusf Exp $
$Id: README,v 1.6 2006/11/13 20:41:36 chandrusf Exp $
ibrowse is a HTTP client. The following are a list of features.
- RFC2616 compliant (AFAIK)
@ -15,23 +15,33 @@ ibrowse is a HTTP client. The following are a list of features.
- Can talk to Secure webservers using SSL
- any other features in the code not listed here :)
ibrowse is available under two different licenses. LGPL and the BSD license.
Comments to : Chandrashekhar.Mullaparthi@t-mobile.co.uk
CONTRIBUTIONS & CHANGE HISTORY
==============================
08-May-2005 - Youns Hafri made a CRUX LINUX port of ibrowse.
http://yhafri.club.fr/crux/index.html
13-11-2006 - Youns 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
22-Nov-2005 - Added ability to generate requests using the Chunked
Transfer-Encoding.
12-10-2006 - Chris Newcombe reported bug in dealing with requests where no
body is expected in the response. The first request would succeed
and the next request would hang.
24-May-2006 - Sean Hinde reported a bug. Async responses with pipelining was
returning the wrong result.
08-Dec-2005 - Richard Cameron (camster@citeulike.org). Patch to ibrowse to
prevent port number being included in the Host header when port
80 is intended.
12-10-2006 - Chris Newcombe reported bug in dealing with requests where no
body is expected in the response. The first request would succeed
and the next request would hang.
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.
http://yhafri.club.fr/crux/index.html
Here are some usage examples. Enjoy!

+ 13
- 4
src/ibrowse_http_client.erl Ver fichero

@ -6,7 +6,7 @@
%%% Created : 11 Oct 2003 by Chandrashekhar Mullaparthi <chandrashekhar.mullaparthi@t-mobile.co.uk>
%%%-------------------------------------------------------------------
-module(ibrowse_http_client).
-vsn('$Id: ibrowse_http_client.erl,v 1.7 2006/10/12 09:25:30 chandrusf Exp $ ').
-vsn('$Id: ibrowse_http_client.erl,v 1.8 2006/11/13 20:41:36 chandrusf Exp $ ').
-behaviour(gen_server).
%%--------------------------------------------------------------------
@ -410,13 +410,22 @@ handle_sock_closed(#state{cur_req=undefined}) ->
%% of response. There maybe requests pipelined which need a response.
handle_sock_closed(#state{reply_buffer=Buf, reqs=Reqs, http_status_code=SC,
is_closing=IsClosing, cur_req=CurReq,
tmp_file_name=TmpFilename, tmp_file_fd=Fd,
status=get_body, recvd_headers=Headers}=State) ->
#request{from=From, stream_to=StreamTo, req_id=ReqId} = CurReq,
case IsClosing of
true ->
{_, Reqs_1} = queue:out(Reqs),
% {{value, Req}, Reqs_1} = queue:out(Reqs),
do_reply(From, StreamTo, ReqId, {ok, SC, Headers, lists:flatten(lists:reverse(Buf))}),
case TmpFilename of
undefined ->
do_reply(From, StreamTo, ReqId,
{ok, SC, Headers,
lists:flatten(lists:reverse(Buf))});
_ ->
file:close(Fd),
do_reply(From, StreamTo, ReqId,
{ok, SC, Headers, {file, TmpFilename}})
end,
do_error_reply(State#state{reqs = Reqs_1}, connection_closed);
_ ->
do_error_reply(State, connection_closed)
@ -858,9 +867,9 @@ handle_response(#request{from=From, stream_to=StreamTo, req_id=ReqId},
send_timer=ReqTimer,
recvd_headers = RespHeaders}=State) ->
State_1 = set_cur_request(State),
file:close(Fd),
do_reply(From, StreamTo, ReqId, {ok, SCode, RespHeaders, {file, TmpFilename}}),
cancel_timer(ReqTimer, {eat_message, {req_timedout, From}}),
file:close(Fd),
State_1#state{tmp_file_name=undefined, tmp_file_fd=undefined};
handle_response(#request{from=From, stream_to=StreamTo, req_id=ReqId},
#state{http_status_code=SCode, recvd_headers=RespHeaders,

+ 1
- 1
vsn.mk Ver fichero

@ -1,2 +1,2 @@
IBROWSE_VSN = 1.2.2
IBROWSE_VSN = 1.2.3

Cargando…
Cancelar
Guardar