[erlang-questions] getting the path of an http request as binary

Pablo Platt pablo.platt@REDACTED
Thu Feb 11 15:42:51 CET 2010


>> Is it possible to get the Path as binary without having to convert  it?
>Socket option {packet, http_bin}

In mochiweb_socket_server/init the BaseOpts have {packet, 0}
Which according to the inet docs means that "no packaging is done".

What will replacing {packet, 0} with {packet, http_bin}do?
I probably can't expect it to just work.





________________________________
From: Sverker Eriksson <sverker@REDACTED>
To: Pablo Platt <pablo.platt@REDACTED>
Cc: erlang-questions@REDACTED
Sent: Thu, February 11, 2010 4:24:07 PM
Subject: Re: [erlang-questions] getting the path of an http request as binary

Pablo Platt wrote:
> Hi
>
> mochiweb uses:
> gen_tcp:recv(Socket, 0, ?REQUEST_RECV_TIMEOUT)
> which result with:
> {ok, {http_request, Method, Path, Version}}
> where the Path is a list.
>
> Is it possible to get the Path as binary without having to convert it?
>
>  
Socket option {packet, http_bin}

> Are there docs about http_binary packet parser in R13B03?
>
>  
inet:setopts/2
erlang:decode_packet/3

/Sverker, Erlang/OTPEricsson


________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED


      


More information about the erlang-questions mailing list