[erlang-questions] Re: ssl and {active, once} - bug?

Tony Rogvall tony@REDACTED
Mon Apr 19 15:23:24 CEST 2010


The packet type for http headers is 'httph' (not the 'h' appended) 
So you need to switch packet type after you received the request in 'http' mode

/Tony

On 19 apr 2010, at 15.03, Roberto Ostinelli wrote:

> 2010/4/19 Tony Rogvall <tony@REDACTED>:
>> You must switch to http header packet processing !
>> Use {packet, httph} or {packet,httph_bin} after the initial request.
>> End of headers is signaled by http_eoh.
>> After http_eoh you must switch to content processing {packet, 0} and then read possible content.
>> The size of the content is givent by the header Content-Length or if chunked encoding is used
>> the size given before each chunk.
>> 
>> Hope this helps
>> 
>> /Tony
>> 
> 
> hi tony,
> 
> well i am starting the server with the options:
> 
> 	Options = [
> 		binary, {packet, http}, {reuseaddr, true}, {active, false},
> 		{backlog, 128}, {ssl_imp, new},
> 		{certfile, "/Users/roberto/Code/sslbug/server.pem"},
> 		{keyfile, "/Users/roberto/Code/sslbug/privkey.pem"},
> 		{password, "roberto"}
> 	],
> 
> which does include {packet, http}. is this not enough? i normally
> switch to {packet, 0} only when i go passive to read body of requests,
> after eoh.
> 
> r.
> 
> ________________________________________________________________
> 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