meh / cauldron

I wonder what kind of Elixir is boiling in there.
74 stars 7 forks source link

set a smaller buffer size en macosx #1

Closed edmz closed 11 years ago

meh commented 11 years ago

I was going to do this change but I needed someone with OS X first.

{ :ok, s } = :gen_tcp.connect('google.com', 80, [])
:inet.getopts(s, [:recbuf])

Could you run this code first please? On Linux it's 87380 so I'd like to see how small that is on OS X first.

edmz commented 11 years ago

{:ok, [recbuf: 131874]}

edmz commented 11 years ago

Does that number make sense? 131874 is lower than 87380.

meh commented 11 years ago

What's the reason for lowering it down? (I know there's a bug related to it so I'm trying to figure out why it's crashing)

I thought it was actually smaller and 131_874 is bigger than 87_380, someone on IRC was having an issue where it would crash with an emsgsize error, so I thought it was too small.

edmz commented 11 years ago

It was crashing for me and I reported it to you on IRC.

edmz commented 11 years ago

FWIW, if I remove that code that sets the buffer crash I get the error:

=ERROR REPORT==== 6-Aug-2013::18:20:10 ===
Error in process <0.159.0> with exit value: {{case_clause,{error,emsgsize}},[{'Elixir.Cauldron.HTTP',headers,2,    [{file,"/Users/eduardo/Documents/Work/logical/einel/deps/cauldron/lib/cauldron/http.ex"},{line,349}]},{'Elixir.Cauldron.HTTP',headers,1,[{file,"/Users...
edmz commented 11 years ago

Ha, if I set the buffer to 131_874 it works just fine.

meh commented 11 years ago

a1aaac2c1ef87297d1adf00e90e8ef6aa62100b7 should fix this, I'll reopen it if it's not the case.