Inets 4.0 and HTTP/1.1 "100 Continue" responses

Ingela Anderton <>
Fri Dec 3 11:18:11 CET 2004


Heinrich Venter wrote:
> It looks like I have managed to fix the problem with the 100 Continue
> response lines
Well not really! However I will fix it for the next open source release.

> The idea is that if the "100 Continue" response is recognised, the Body
> is re-parsed from scratch.  I am not sure if all the extra response
> handling in the parsing case is neccesary.
> I also don't know if the behavior of the header "expect=100-continue"
> will stil be correct.
I do not agree with this idea! When you receive a 100-continue
response the body should be sent if the request had a
expect:100-continue header and then we wait for the next response from
the server or if not we ignore this response and wait for the next
response.
 
> %%% RFC2616, Section 10.1.1
> %%% Note:
> %%% - Only act on the 100 status if the request included the
> %%%   "Expect:100-continue" header, otherwise just ignore this response.
> status_continue(Req = #http_request_h{expect="100-continue"}, Session)
> ->
>     {_, Body} = Req#request.content,
>     http_transport:send(Session#tcp_session.scheme, 
> 			Session#tcp_session.socket, Body),
>     {ok, continue};
> 
> status_continue(_Req, _Session) ->
>     error_logger:info_msg("Found Continue"),
>     {ok, continue}.
You are however right that this function did not have a correct return
value. In fact this could not ever have worked as intended as the first
argument is not of type http_request_h! (I think it might be an
unfortunate mistake made when evolving the the old unsupported
client). Alas testing is of the nature that it can always be improved!

-- 
/Ingela

Ericsson AB - OTP team









More information about the erlang-questions mailing list