[erlang-bugs] gen_tcp/new_ssl http packet inconsistency when reading malformed header

Ingela Anderton Andin ingela@REDACTED
Tue Jun 22 15:28:20 CEST 2010


Hi again!

Maybe I spoke to early. I according to the documentation:

"A socket in passive mode will return {ok, HttpPacket} from gen_tcp:recv"

"HttpPacket = HttpRequest | HttpResponse | HttpHeader | http_eoh | 
HttpError"

"HttpError = {http_error, HttpString}"

So ssl does acctualy return what the documentation says it should.

I am not sure if we dare change the gen_tcp:recv or not but that would
be the "right" thing to do.

Regards Ingela Erlang/OTP team - Ericsson AB

Ingela Anderton Andin wrote:
> Hi!
>
> Thank you for reporting this, we will change ssl to work the same way 
> as gen_tcp.
>
> Regards Ingela Erlang/OTP team - Ericsson AB
>
> Jonas Boberg wrote:
>> The new_ssl and gen_tcp sockets does not return
>> http packet decode errors in the same way.
>>
>> How to repeat:
>> 1. Run a ssl(new_ssl)/gen_tcp server with the http packet option set
>> 2. Send a http request with a malformed header field to the server
>>
>> new_ssl/gen_tcp will return different values when reading the header:
>> ssl:recv(SSLSocket, 0) -> {ok, {http_error, _Str}} 
>> gen_tcp:recv(Socket, 0) -> {error, {http_error, _Str}}
>> Erlang version: R13B04 (no fix mentioned in in the release notes of 
>> R14A).
>>
>> /Jonas
>> ---------------------------------------------------
>>
>> ---------------------------------------------------
>>
>> WE'VE CHANGED NAMES!
>>
>> Since January 1st 2010 Erlang Training and Consulting Ltd. has become 
>> ERLANG SOLUTIONS LTD.
>>
>> www.erlang-solutions.com
>>
>>
>> ________________________________________________________________
>> erlang-bugs (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-bugs-unsubscribe@REDACTED
>>
>>   
>
>
> ________________________________________________________________
> erlang-bugs (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-bugs-unsubscribe@REDACTED
>



More information about the erlang-bugs mailing list