[erlang-questions] erlang:decode_packet question

Tony Rogvall <>
Mon Jan 11 12:17:01 CET 2010


On 11 jan 2010, at 09.38, Max Lapshin wrote:

> I cannot understand: it is buf or feature?
> 
Neither. If you check for example RFC 2616 you will see that there may be multiple lines.
In the case of multiple lines, the next line is initiated by a space or a tab.

/Tony


> erlang:decode_packet(httph_bin, <<"icy-name:Radio Zet\r\n">>, []).
> returns me
> {more,undefined}
> 
> but if I add any useless information in the tail, it works:
> 
> erlang:decode_packet(httph_bin, <<"icy-name:Radio Zet\r\nzz">>, []).
> {ok,{http_header,0,<<"Icy-Name">>,undefined,<<"Radio Zet">>},
>    <<"zz">>}
> 
> So to parse headers line by line, I have to artificially append some data.
> 
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
> 



More information about the erlang-questions mailing list