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

Ingela Andin ingela@REDACTED
Wed Apr 21 11:55:13 CEST 2010


Acctualy the patch that I mentioned makes ssl behave as gen_tcp that
will automaticaly change
from http to httph.

Regards Ingela Erlang OTP team Ericsson AB

2010/4/19 Tony Rogvall <tony@REDACTED>:
> 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
>>
>
>
> ________________________________________________________________
> 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