-
Notifications
You must be signed in to change notification settings - Fork 144
Add fix for upcoming OTP release, and some other small things #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
According to HTTP spec, space is a MAY but preferred way to separate HTTP header name and field value. Not having a space there can cause problems.
…f setopts returns an error, we can't use the socket...
…erefore we use erlang:decode_packet/3 instead. This should make chunked ssl work with both old and new erlang versions.
…e how to da that in a sain way...
This will make the error report a bit nicer imho.
Conflicts: src/lhttpc.app.src src/lhttpc_types.hrl
|
The man page for erlang:decode_packet/3 says: erlang:decode_packet(Type,Bin,Options) -> {ok,Packet,Rest} | Where does the {'http_error', Data} come from? BR, Den 13 september 2011 11:16 skrev Oscar Hellström
|
(thank you dialyzer)
|
Oh, I misinterpreted the dialyzer warning... I thought it was complaining about a clause I didn't match... The http_error comes from the possible return value {ok, {http_error, Reason}, Tail}. Will push another commit. |
|
A fix for this was pushed, should really have added a test for it though... |
|
Looks good to me. If the ssl socket options patch is "okay", then we should merge. |
|
It seems that OTP will actually add support for {packet, httph} at some point, so this workaround might be useless. http://erlang.org/pipermail/erlang-questions/2011-September/061145.html |
|
I guess we can chose to remove the ssl:setopts fix (if OTP will include the fix in the next release), but I think there is some value in the rest of the commits. Well, mainly the test with broken trailers. |
|
In which version does it not exist? Or did it never exist? |
|
It's missing in "new ssl". This means it doesn't work per default with OTP HEAD from here. |
|
I think the fix was included in the latest OTP, I'll try to create a new pull request without the workaround this weekend. |
|
Ok, good stuff. |
Partial upload/download fix
fix ssl_inet6 test
…e_time_warnings Handle OTP 21 compile-time warnings
There is now a dialyzer warning, which I'd like to get rid of, but I also don't like to add code branches which canot be reached... Any suggestions on how to deal with this:
lhttpc_client.erl:577: The pattern {'http_error', Data} can never match the type {'error',_} | {'ok',binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []) | {'http_error',string()} | {'http_request','DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT' | 'TRACE' | string(),'*' | string() | {'abs_path',string()} | {'scheme',string(),string()} | {'absoluteURI','http' | 'https',string(),'undefined' | non_neg_integer(),string()},{non_neg_integer(),non_neg_integer()}} | {'http_response',{non_neg_integer(),non_neg_integer()},integer(),string()},binary()}