[erlang-questions] [ANN] Cowboy 0.6.1

240 views
Skip to first unread message

Loïc Hoguin

unread,
Aug 8, 2012, 8:00:06 AM8/8/12
to erlang-questions
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-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Zabrane Mickael

unread,
Aug 8, 2012, 10:10:44 AM8/8/12
to Loïc Hoguin, erlang-questions
Hi Loïc,

Congrats for this new release.
Did it include the parsing of HTTP headers without the decode_packet call?

Regards,
Zabrane

Loïc Hoguin

unread,
Aug 8, 2012, 10:14:50 AM8/8/12
to Zabrane Mickael, erlang-questions
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.

Max Lapshin

unread,
Aug 8, 2012, 10:52:04 AM8/8/12
to Loïc Hoguin, erlang-questions
What is better: rewrite parsing in erlang, either add translation of
atoms to binaries?
Isn't parsing via decode_packet very fast?

Loïc Hoguin

unread,
Aug 8, 2012, 11:39:32 AM8/8/12
to Max Lapshin, erlang-questions
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.

Max Lapshin

unread,
Aug 8, 2012, 11:44:56 AM8/8/12
to Loïc Hoguin, erlang-questions
Ok, I see.

Zabrane Mickael

unread,
Aug 12, 2012, 6:08:59 PM8/12/12
to Loïc Hoguin, erlang-questions
Hi guys,

> 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.


That should be very easy too !

Regards,
Zabrane

Zabrane Mickael

unread,
Aug 14, 2012, 6:41:31 AM8/14/12
to Loïc Hoguin, erlang-questions
Hi Loïc,

Compiling lastest Cowboy from github with R15B01 and running Dialyzer, I got this:

cowboy $ make dialyze
Checking whether the PLT .cowboy.plt is up-to-date... yes
Proceeding with analysis...
cowboy_http_protocol.erl:36: Callback info about the cowboy_protocol behaviour is not available


Did you noticed that?

Regards,
Zabrane

Loïc Hoguin

unread,
Aug 14, 2012, 6:48:23 AM8/14/12
to Zabrane Mickael, erlang-questions
That's something that got added to R15, but if you use it it can't
compile on R14, so since we are dropping R14 in the next version we
simply waited before adding the callback specs.

On 08/14/2012 12:41 PM, Zabrane Mickael wrote:
> Hi Loïc,
>
> Compiling lastest Cowboy from github with R15B01 and running Dialyzer, I got this:
>
> cowboy $ make dialyze
> Checking whether the PLT .cowboy.plt is up-to-date... yes
> Proceeding with analysis...
> cowboy_http_protocol.erl:36: Callback info about the cowboy_protocol behaviour is not available
>
>
> Did you noticed that?
>
> Regards,
> Zabrane
>


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

Motiejus Jakštys

unread,
Aug 14, 2012, 6:48:49 AM8/14/12
to Zabrane Mickael, erlang-questions
On Tue, Aug 14, 2012 at 1:41 PM, Zabrane Mickael <zabr...@gmail.com> wrote:
> Hi Loïc,
>
> Compiling lastest Cowboy from github with R15B01 and running Dialyzer, I got this:
>
> cowboy $ make dialyze
> Checking whether the PLT .cowboy.plt is up-to-date... yes
> Proceeding with analysis...
> cowboy_http_protocol.erl:36: Callback info about the cowboy_protocol behaviour is not available
>
>
> Did you noticed that?

This email explains it:
http://erlang.org/pipermail/erlang-questions/2012-June/067428.html


--
Motiejus Jakštys

Max Lapshin

unread,
Oct 2, 2012, 1:09:13 AM10/2/12
to Motiejus Jakštys, erlang-questions
Hi, Loic.


How would it be possible to do this thing in new cowboy:

https://github.com/erlyvideo/flussonic/blob/master/apps/flussonic/src/mpegts_handler.erl#L61

I need to send stream via HTTP without end and without chunked response.
Reply all
Reply to author
Forward
0 new messages