[erlang-questions] [ANN] Cowboy 0.6.1

Loïc Hoguin essen@REDACTED
Wed Aug 8 17:39:32 CEST 2012


decode_packet would be a lot faster if it wasn't doing most things it's 
actually doing that make it more problematic for me to handle requests. 
Problems include:

* using both atoms and binaries for header names
* for binary header names, changing the case but only for name length < 
22 characters, and with a weird behavior if it contains "--"
* returning tuples for everything (forces me to handle all the different 
errors at the same level, and makes it harder to read)
* not allowing me to fail early (see previous)

I can simplify the code a lot by not using it, all without sacrificing 
performance because I can still use binary BIFs instead. The only thing 
that requires a little Erlang code is parsing the request line.

On 08/08/2012 04:52 PM, Max Lapshin wrote:
> What is better: rewrite parsing in erlang, either add translation of
> atoms to binaries?
> Isn't parsing via decode_packet very fast?
>
> On Wed, Aug 8, 2012 at 6:14 PM, Loïc Hoguin <essen@REDACTED> wrote:
>> Nope that one comes after 0.8. It breaks API compatibility because the point
>> is most importantly to remove the inconsistencies of decode_packet like the
>> header name being either atom() or binary() and such.
>>
>>
>> On 08/08/2012 04:10 PM, Zabrane Mickael wrote:
>>>
>>> Hi Loïc,
>>>
>>> Congrats for this new release.
>>> Did it include the parsing of HTTP headers without the decode_packet call?
>>>
>>> Regards,
>>> Zabrane
>>>
>>> On Aug 8, 2012, at 2:00 PM, Loïc Hoguin wrote:
>>>
>>>> Hello,
>>>>
>>>> Tagged a new version before starting to break API compatibility for the
>>>> upcoming big release. This version contains a few fixes that do not break
>>>> compatibility. I do not plan to make another release before 0.8.
>>>>
>>>> Changes are:
>>>>
>>>> *   Add hello_world, rest_hello_world, chunked_hello_world,
>>>>      echo_get, echo_post and static examples.
>>>>
>>>> *   Add support for the "Expect: 100-continue" header.
>>>>
>>>> *   Keep the original 'Host' header value instead of modifying it.
>>>>
>>>> *   Fix use of parsed headers cache.
>>>>
>>>> *   REST: fix the matching of charsets.
>>>>
>>>> *   REST: allow <<"type/subtype">> format for content_types_accepted.
>>>>
>>>> *   Improve typespecs.
>>>>
>>>> I urge everyone to get out of master for a little while because the
>>>> switch to Ranch will break your project until you make the necessary
>>>> changes.
>>>>
>>>> Thanks for your understanding.
>>>>
>>>> --
>>>> Loïc Hoguin
>>>> Erlang Cowboy
>>>> Nine Nines
>>>> http://ninenines.eu
>>>> _______________________________________________
>>>> erlang-questions mailing list
>>>> erlang-questions@REDACTED
>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Loïc Hoguin
>> Erlang Cowboy
>> Nine Nines
>> http://ninenines.eu
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions


-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the erlang-questions mailing list