[erlang-bugs] {header,1} inconsistency between TCP and SSL

Ingela Anderton Andin <>
Wed Aug 7 15:04:27 CEST 2013


Hi!

Andrew Thompson wrote:
> Today I noticed a difference in behaviour of the {header, 1} option when
> using TCP and SSL in erlang releases R15B02 and newer:
>
> https://gist.github.com/Vagabond/dabecf53ac8b4317e51c
>
> As you can see, SSL in {header, 1} mode no longer includes the empty
> binary as the second element in the list.
>
> I believe this change was made in this commit:
>
> https://github.com/erlang/otp/commit/8f97b428eb8f2fb89c3f9ec348f577304b1b9131
>
> If you change that back, things work the same as TCP again, but all the
> header_decode tests in ssl_packet_SUITE start to fail.
>
> I'm simply going to stop using {header,1} and just use the bit syntax,
> since I notice that Ingela considers it to be a silly option, but I
> wanted to at least point the inconsistency out, for posterity.
>
>   
 
Thank you for pointing this out.  This is option is quite old and was 
invented before the bitsyntax.  Nowadays just using the bitsyntax is a 
better option.
The change was made to conform to how inet (e.i. gen_tcp) handles the 
header 1 option but alas it seems we fixed it in one way and brok it in 
another.
Some old things could have been better documented ;)

Regards Ingela Erlang/OTP team - Ericsson AB


More information about the erlang-bugs mailing list