erlang:decode_packet question

Max Lapshin <>
Mon Jan 11 09:38:06 CET 2010


I cannot understand: it is buf or feature?

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.


More information about the erlang-questions mailing list