diff options
author | Loïc Hoguin <[email protected]> | 2016-08-29 12:39:49 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-08-29 12:40:03 +0200 |
commit | c807880f7ac73f813b2660ea81a00f7712a4e793 (patch) | |
tree | ba1d09e9b177f230665a80513b33fbd532000ce4 /archives/extend/attachments | |
parent | b1df25a7d9cda697513650659b781b55b40898f8 (diff) | |
download | ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.tar.gz ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.tar.bz2 ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.zip |
Add old mailing list archives
Diffstat (limited to 'archives/extend/attachments')
225 files changed, 9202 insertions, 0 deletions
diff --git a/archives/extend/attachments/20121030/3de26c28/attachment.html b/archives/extend/attachments/20121030/3de26c28/attachment.html new file mode 100644 index 00000000..7246475a --- /dev/null +++ b/archives/extend/attachments/20121030/3de26c28/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div>Hi everyone, newb questions here:</div><div><br></div><div>Is the reason why the type specification for the init callback lists various "<span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">{</span><span class="n" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">loop</span><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">,..." </span><font face="arial, helvetica, sans-serif"><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-size:12px;line-height:16px;white-space:pre">tuples, because a single module can implement cowboy_loop_handler and cowboy_http_handler?</span></font></div><br> +<div><font face="arial, helvetica, sans-serif"><span class="p" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-size:12px;line-height:16px;white-space:pre">And this way, a dializier warning will not be triggered?</span><span style="color:rgb(51,51,51);font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,204)"> </span></font></div><br> +<a href="https://github.com/extend/cowboy/blob/master/src/cowboy_http_handler.erl#L39">https://github.com/extend/cowboy/blob/master/src/cowboy_http_handler.erl#L39</a><div><br></div><div>Because looking at the handler code,�<a href="https://github.com/extend/cowboy/blob/master/src/cowboy_protocol.erl#L473">https://github.com/extend/cowboy/blob/master/src/cowboy_protocol.erl#L473</a>�if the {loop, * is returned from init, then the�<font face="arial, helvetica, sans-serif"><span class="nf" style="font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">handle</span><span class="p" style="color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px">(</span><span class="nv" style="font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px;color:rgb(0,128,128)">Req</span><span class="p" style="color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px">,</span><span style="background-color:rgb(248,248,248);color:rgb(51,51,51);font-size:13px;line-height:19px"> </span><span class="nv" style="font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px;color:rgb(0,128,128)">State</span><span class="p" style="color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px">) will not be processed.</span></font></div><br> +<div><span class="p" style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px"><br></span></div><div><span class="p" style="color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px"><font face="arial, helvetica, sans-serif">Also, is it safe to say that Handler:init is like "before" in lot's of web frameworks. I can place validation\authentication logic there.</font></span></div><br> +<div><span class="p" style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px"><br></span></div><div>Sincerely,</div><div><br> +<br></div><div>-rambocoder</div><br> + +</tt> diff --git a/archives/extend/attachments/20121216/2d0b0da5/attachment.html b/archives/extend/attachments/20121216/2d0b0da5/attachment.html new file mode 100644 index 00000000..982e5a1e --- /dev/null +++ b/archives/extend/attachments/20121216/2d0b0da5/attachment.html @@ -0,0 +1,25 @@ +<tt> +See you there!<div><br></div><div>Jeremy (banachtarski)</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Dec 16, 2012 at 10:24 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br><br> +<br><br> +I have started the #ninenines IRC Channel on <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> for anyone looking for quick help or willing to participate in Cowboy development or any other related project (Ranch, Bullet, Sheriff and upcoming projects).<br><br> +<br> +<br><br> +Discussions will be centered about these projects and related subjects.<br><br> +<br><br> +Repositories will soon be updated with information about this IRC channel.<br><br> +<br><br> +Feel free to come and hang out.<span class="HOEnZb"><font color="#888888"><br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20121220/631f7f13/attachment.html b/archives/extend/attachments/20121220/631f7f13/attachment.html new file mode 100644 index 00000000..78784c07 --- /dev/null +++ b/archives/extend/attachments/20121220/631f7f13/attachment.html @@ -0,0 +1,6 @@ +<tt> +Does anybody know either from benchmarks or real world data what is the average memory footprint of each concurrent HTTPS connection to cowboy?<div><br></div><div>SSL app in Erlang reuses SSL session-ids so I am not sure if the Apache Bench I test with reuses the session id or it does not.</div><br> +<div><br></div><div>BTW, what makes an erlang api "documented" vs "undocumented". For example ssl:session_info/1 function here ( <a href="https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L411">https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L411</a> ) has a spec and a short doc, but session_info is not described�<a href="http://www.erlang.org/doc/man/ssl.html">http://www.erlang.org/doc/man/ssl.html</a> .ssl:session_info/1 is a useful function to be able to track if the load generator is reusing the SSL session_id or it is generating new one, because that would make all the difference during measurement due to Erlang caching SSL sessions by default.</div><br> +<div><br></div><div>Sincerely,</div><div><br></div><div>rambocoder</div><br> + +</tt> diff --git a/archives/extend/attachments/20121221/8bfb2f11/attachment.html b/archives/extend/attachments/20121221/8bfb2f11/attachment.html new file mode 100644 index 00000000..9650a876 --- /dev/null +++ b/archives/extend/attachments/20121221/8bfb2f11/attachment.html @@ -0,0 +1,44 @@ +<tt> +In my preliminary testing, I used Jmeter this morning since it's an easy GUI load testing app and this is what I am seeing:<div><br></div><div>With R15B03-01 [smp:4:4] [async-threads:4] [hipe] [kernel-poll:true], when I establish 1K concurrent connections via HTTPS, each connection takes up about 68K of memory.<br><br> +<div><br></div><div>Unfortunately, after about 1050-1200 connections, on my test server the Erlang scheduler jumps to 100% CPU utilization on all 4 schedulers, while up to that point the scheduler's load was oscillating up and down. Using the Observer, there is only 1 ssl_connection_sup in the ssl application, having to deal with 1000+ gen_fsm workers, so that might be the bottleneck. Since the ulimit on my server is 50000 I don't think I am hitting any type of file handler's limit.</div><br> +<div><br></div><div>Loïc and the group, am I missing some setting that is causing the scheduler to go to 100% CPU and the run que in observer to be 99?</div><div><br></div><div><table cellpadding="0" class="cf an5" id=":zc" style="border-collapse:collapse;outline:none;overflow:hidden;table-layout:fixed;width:202px;color:rgb(34,34,34);font-family:arial,sans-serif;text-align:start;background-color:rgb(255,255,255)"><br> +<tbody><tr><td class="anQ" style="margin:0px;overflow:hidden;text-overflow:ellipsis;vertical-align:top">Sincerely,<br><br>rambocoder</td></tr></tbody></table></div><div><br><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 6:45 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 12/21/2012 04:34 AM, rambocoder wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Does anybody know either from benchmarks or real world data what is the<br><br> +average memory footprint of each concurrent HTTPS connection to cowboy?<br><br> +</blockquote><br> +<br></div><br> +I don't have anything, sorry. I'm guessing it consumes a lot more than TCP though.<div class="im"><br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +SSL app in Erlang reuses SSL session-ids so I am not sure if the Apache<br><br> +Bench I test with reuses the session id or it does not.<br><br> +</blockquote><br> +<br></div><br> +I wouldn't know, but I wouldn't trust Apache Bench doing the right thing. Any other benchmark tool usually works better in my experience.<div class="im"><br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +BTW, what makes an erlang api "documented" vs "undocumented". For<br><br> +example ssl:session_info/1 function here (<br><br> +<a href="https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L411" target="_blank">https://github.com/erlang/otp/<u></u>blob/maint/lib/ssl/src/ssl.<u></u>erl#L411</a> ) has<br><br> +a spec and a short doc, but session_info is not described<br><br> +<a href="http://www.erlang.org/doc/man/ssl.html" target="_blank">http://www.erlang.org/doc/man/<u></u>ssl.html</a> .ssl:session_info/1 is a useful<br><br> +function to be able to track if the load generator is reusing the SSL<br><br> +session_id or it is generating new one, because that would make all the<br><br> +difference during measurement due to Erlang caching SSL sessions by default.<br><br> +</blockquote><br> +<br></div><br> +The documentation is separate (they're not using edoc). It's perhaps not deemed useful enough for documenting it. I wouldn't worry about using it for measurements though.<br><br> +<br><br> +Try asking Ingela on the ML about it, perhaps they just forgot to document it.<span class="HOEnZb"><font color="#888888"><br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +</font></span></blockquote></div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20121221/945f636e/attachment.html b/archives/extend/attachments/20121221/945f636e/attachment.html new file mode 100644 index 00000000..e10a9807 --- /dev/null +++ b/archives/extend/attachments/20121221/945f636e/attachment.html @@ -0,0 +1,108 @@ +<tt> +Long story short, I solved the problem by adding {max_connections, 50000} to cowboy:start_https because it default to 1024 at <a href="https://github.com/extend/ranch/blob/master/src/ranch_listener_sup.erl#L30">https://github.com/extend/ranch/blob/master/src/ranch_listener_sup.erl#L30</a><div><br> +<br></div><div>However, before I figured out that setting, I did run eprof and these are the function calls it was spending most of it's time on<br><div><div><br></div><div><br></div><div><div>FUNCTION CALLS % TIME [uS / CALLS]</div><br> +<div>-------- ----- --- ---- [----------]</div></div><div>dict:get_slot/2 174 1.73 1658 [ 9.53]</div><div><div>dict:on_bucket/3 171 1.77 1701 [ 9.95]</div><br> +<div>erlang:setelement/3 684 3.23 3098 [ 4.53]</div><div>dict:store_bkt_val/3 600 5.24 5028 [ 8.38]</div><div><br></div><div>Then I ran etop and it showed that ranch_acceptor:maybe_wait had the most reductions were, so I looked at the code in that <a href="https://github.com/extend/ranch/blob/master/src/ranch_acceptor.erl#L72">https://github.com/extend/ranch/blob/master/src/ranch_acceptor.erl#L72</a> and realized that like a newb I did not set the maximum connections for the listener :)</div><br> +<div><br></div><div>Problem solved. Looks like I won't need to put HAProxy in front of Cowboy after all.</div><div><br></div><div>Thank you,</div><div><br></div><div>rambocoder</div><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 11:51 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can you try enabling eprof to see where the VM spends its time?<div class="im"><br><br> +<br><br> +On 12/21/2012 05:49 PM, rambocoder wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +In my preliminary testing, I used Jmeter this morning since it's an<br><br> +easy GUI load testing app and this is what I am seeing:<br><br> +<br><br> +With R15B03-01 [smp:4:4] [async-threads:4] [hipe] [kernel-poll:true],<br><br> +when I establish 1K concurrent connections via HTTPS, each connection<br><br> +takes up about 68K of memory.<br><br> +<br><br> +Unfortunately, after about 1050-1200 connections, on my test server the<br><br> +Erlang scheduler jumps to 100% CPU utilization on all 4 schedulers,<br><br> +while up to that point the scheduler's load was oscillating up and down.<br><br> +Using the Observer, there is only 1 ssl_connection_sup in the ssl<br><br> +application, having to deal with 1000+ gen_fsm workers, so that might be<br><br> +the bottleneck. Since the ulimit on my server is 50000 I don't think I<br><br> +am hitting any type of file handler's limit.<br><br> +<br><br> +Loïc and the group, am I missing some setting that is causing the<br><br> +scheduler to go to 100% CPU and the run que in observer to be 99?<br><br> +<br><br> +Sincerely,<br><br> +<br><br> +rambocoder<br><br> +<br><br> +<br><br> +<br><br> +On Fri, Dec 21, 2012 at 6:45 AM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class="im"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + On 12/21/2012 04:34 AM, rambocoder wrote:<br><br> +<br><br> + Does anybody know either from benchmarks or real world data what<br><br> + is the<br><br> + average memory footprint of each concurrent HTTPS connection to<br><br> + cowboy?<br><br> +<br><br> +<br><br> + I don't have anything, sorry. I'm guessing it consumes a lot more<br><br> + than TCP though.<br><br> +<br><br> +<br><br> + SSL app in Erlang reuses SSL session-ids so I am not sure if the<br><br> + Apache<br><br> + Bench I test with reuses the session id or it does not.<br><br> +<br><br> +<br><br> + I wouldn't know, but I wouldn't trust Apache Bench doing the right<br><br> + thing. Any other benchmark tool usually works better in my experience.<br><br> +<br><br> +<br><br> + BTW, what makes an erlang api "documented" vs "undocumented". For<br><br> + example ssl:session_info/1 function here (<br></div><br> + <a href="https://github.com/erlang/otp/__blob/maint/lib/ssl/src/ssl.__erl#L411" target="_blank">https://github.com/erlang/otp/<u></u>__blob/maint/lib/ssl/src/ssl._<u></u>_erl#L411</a><div class="im"><br><br> + <<a href="https://github.com/erlang/otp/blob/maint/lib/ssl/src/ssl.erl#L411" target="_blank">https://github.com/erlang/<u></u>otp/blob/maint/lib/ssl/src/<u></u>ssl.erl#L411</a>><br><br> + ) has<br><br> + a spec and a short doc, but session_info is not described<br></div><br> + <a href="http://www.erlang.org/doc/man/__ssl.html" target="_blank">http://www.erlang.org/doc/man/<u></u>__ssl.html</a><div class="im"><br><br> + <<a href="http://www.erlang.org/doc/man/ssl.html" target="_blank">http://www.erlang.org/doc/<u></u>man/ssl.html</a>> .ssl:session_info/1 is<br><br> + a useful<br><br> + function to be able to track if the load generator is reusing<br><br> + the SSL<br><br> + session_id or it is generating new one, because that would make<br><br> + all the<br><br> + difference during measurement due to Erlang caching SSL sessions<br><br> + by default.<br><br> +<br><br> +<br><br> + The documentation is separate (they're not using edoc). It's perhaps<br><br> + not deemed useful enough for documenting it. I wouldn't worry about<br><br> + using it for measurements though.<br><br> +<br><br> + Try asking Ingela on the ML about it, perhaps they just forgot to<br><br> + document it.<br><br> +<br><br> + --<br><br> + Loďc Hoguin<br><br> + Erlang Cowboy<br><br> + Nine Nines<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +<br><br> +<br></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loïc Hoguin</font></span><div class="HOEnZb"><div class="h5"><br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +</div></div></blockquote></div><br></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130103/bae06e70/attachment.html b/archives/extend/attachments/20130103/bae06e70/attachment.html new file mode 100644 index 00000000..d8306a06 --- /dev/null +++ b/archives/extend/attachments/20130103/bae06e70/attachment.html @@ -0,0 +1,54 @@ +<tt> +Loic, it would be great to hear a bit, what problems have you met with.<div><br></div><div>What issues with stability can be in acceptor pool?</div><div><br></div><div>Also I have question about updating protocol options: have you done something with the problem that after updating protocol options existing workers are running with old config?<span></span><br><br> +<br>On Tuesday, December 25, 2012, Loïc Hoguin wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ho ho ho!<br><br> +<br><br> +I have just tagged version 0.6.0 of the Ranch project!<br><br> +<br><br> +Ranch is a socket acceptor pool for TCP protocols.<br><br> +<br><br> + <a href="https://github.com/extend/ranch" target="_blank">https://github.com/extend/<u></u>ranch</a><br><br> +<br><br> +Ranch is used by the next version of Cowboy, 0.8.0, set to be released early February, but also in Basho's Riak multi-data center replication amongst others.<br><br> +<br><br> +All tickets have been resolved. A significant contribution was made by Andrew Majorov to improve the fault tolerance capabilities of the application, making sure it always restarts properly when things go wrong. This has been made possible thanks to the amazing project from Daniel Luna, chaos_monkey (<a href="https://github.com/dluna/chaos_monkey" target="_blank">https://github.com/dluna/<u></u>chaos_monkey</a>).<br><br> +<br> +<br><br> +The guide has also been improved and completed.<br><br> +<br><br> + <a href="http://ninenines.eu/docs/en/ranch/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/<u></u>ranch/HEAD/guide/introduction</a><br><br> +<br><br> +If the guide isn't enough, drop by our new IRC channel dedicated to Cowboy, Ranch and all our other projects! #ninenines on Freenode.<br><br> +<br><br> +Following is the list of change since last time:<br><br> +<br><br> + * Improve fault tolerance thanks to chaos_monkey testing<br><br> + * Add 'nodelay' option to transports<br><br> + * Add 'verify' option to ranch_ssl transport<br><br> + * Add 'socket' option to pass an already open socket to the listener<br><br> + * Add Transport:sendfile/2 function (uses a fallback if unavailable)<br><br> + * Allow IP tuples in Transport:connect/3<br><br> + * Add ranch:set_max_connections/2 to update the value live<br><br> + * Add ranch:get_max_connections/1 to retrieve it<br><br> +<br><br> +We are always looking for feedback, especially now that there is no ticket left open on this project. If you are using Ranch and have questions or needs that it doesn't cover, please send them to us.<br><br> +<br><br> +Commercial support will be available starting from January, ping me if you are interested. Details will be announced at a later time on the <a href="http://ninenines.eu" target="_blank">ninenines.eu</a> mailing list.<br><br> +<br> +<br><br> +I want to thank all contributors for helping this project by opening tickets, sending patches and offering feedback. I am as always very grateful for any and all contributions. I wouldn't have made it this far without the tremendous help I receive everyday.<br><br> +<br> +<br><br> +Thanks to all and have a nice holiday!<br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +Erlang Santa<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a>[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</blockquote></div><br> + +</tt> diff --git a/archives/extend/attachments/20130103/d9dbc1a5/attachment.html b/archives/extend/attachments/20130103/d9dbc1a5/attachment.html new file mode 100644 index 00000000..7a05b607 --- /dev/null +++ b/archives/extend/attachments/20130103/d9dbc1a5/attachment.html @@ -0,0 +1,157 @@ +<tt> +<div dir="ltr">ok<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 3, 2013 at 5:51 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Existing acceptors were using the old options for the next connection and then switched to the new options. But that has been fixed a long time ago. Ranch doesn't have that issue.<div class="im"><br> +<br><br> +<br><br> +On 01/03/2013 02:32 PM, Max Lapshin wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +I mean situation that after cowboy:update_options existing acceptors are<br><br> +still working with old routes.<br><br> +Currently it is useless API, so I have to stop cowboy and start it back.<br><br> +<br><br> +<br><br> +On Thu, Jan 3, 2013 at 4:46 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class="im"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + Haven't had any stability issue. What we did here is ensure that<br><br> + when any process gets killed for any reason, especially reasons we<br><br> + can't foresee, Ranch continues to work as expected.<br><br> +<br><br> + Ranch not updating protocol options for existing connections isn't a<br><br> + problem, it won't be "fixed". Ranch can't guess how connection<br><br> + processes are implemented. It's up to you to allow this if you need<br><br> + it. The upgrade updates the options for all acceptors and all future<br><br> + connections, that's it.<br><br> +<br><br> +<br><br> + On 01/03/2013 10:30 AM, Max Lapshin wrote:<br><br> +<br><br> + Loic, it would be great to hear a bit, what problems have you<br><br> + met with.<br><br> +<br><br> + What issues with stability can be in acceptor pool?<br><br> +<br><br> + Also I have question about updating protocol options: have you done<br><br> + something with the problem that after updating protocol options<br><br> + existing<br><br> + workers are running with old config?<br><br> +<br><br> + On Tuesday, December 25, 2012, Loïc Hoguin wrote:<br><br> +<br><br> + Ho ho ho!<br><br> +<br><br> + I have just tagged version 0.6.0 of the Ranch project!<br><br> +<br><br> + Ranch is a socket acceptor pool for TCP protocols.<br><br> +<br></div><br> + <a href="https://github.com/extend/____ranch" target="_blank">https://github.com/extend/____<u></u>ranch</a><br><br> + <<a href="https://github.com/extend/__ranch" target="_blank">https://github.com/extend/__<u></u>ranch</a>><div class="im"><br><br> + <<a href="https://github.com/extend/__ranch" target="_blank">https://github.com/extend/__<u></u>ranch</a><br><br> + <<a href="https://github.com/extend/ranch" target="_blank">https://github.com/extend/<u></u>ranch</a>>><br><br> +<br><br> +<br><br> + Ranch is used by the next version of Cowboy, 0.8.0, set to be<br><br> + released early February, but also in Basho's Riak<br><br> + multi-data center<br><br> + replication amongst others.<br><br> +<br><br> + All tickets have been resolved. A significant contribution<br><br> + was made<br><br> + by Andrew Majorov to improve the fault tolerance<br><br> + capabilities of the<br><br> + application, making sure it always restarts properly when<br><br> + things go<br><br> + wrong. This has been made possible thanks to the amazing<br><br> + project<br><br> + from Daniel Luna, chaos_monkey<br></div><br> + (<a href="https://github.com/dluna/____chaos_monkey" target="_blank">https://github.com/dluna/____<u></u>chaos_monkey</a><br><br> + <<a href="https://github.com/dluna/__chaos_monkey" target="_blank">https://github.com/dluna/__<u></u>chaos_monkey</a>><div class="im"><br><br> + <<a href="https://github.com/dluna/__chaos_monkey" target="_blank">https://github.com/dluna/__<u></u>chaos_monkey</a><br><br> + <<a href="https://github.com/dluna/chaos_monkey" target="_blank">https://github.com/dluna/<u></u>chaos_monkey</a>>>).<br><br> +<br><br> +<br><br> + The guide has also been improved and completed.<br><br> +<br></div><br> + <a href="http://ninenines.eu/docs/en/____ranch/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/__<u></u>__ranch/HEAD/guide/<u></u>introduction</a><br><br> + <<a href="http://ninenines.eu/docs/en/__ranch/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/_<u></u>_ranch/HEAD/guide/introduction</a><u></u>><div><div class="h5"><br><br> +<br><br> +<br><br> + <<a href="http://ninenines.eu/docs/en/__ranch/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/_<u></u>_ranch/HEAD/guide/introduction</a><br><br> + <<a href="http://ninenines.eu/docs/en/ranch/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/<u></u>ranch/HEAD/guide/introduction</a>><u></u>><br><br> +<br><br> + If the guide isn't enough, drop by our new IRC channel<br><br> + dedicated to<br><br> + Cowboy, Ranch and all our other projects! #ninenines on<br><br> + Freenode.<br><br> +<br><br> + Following is the list of change since last time:<br><br> +<br><br> + * Improve fault tolerance thanks to chaos_monkey testing<br><br> + * Add 'nodelay' option to transports<br><br> + * Add 'verify' option to ranch_ssl transport<br><br> + * Add 'socket' option to pass an already open socket to<br><br> + the listener<br><br> + * Add Transport:sendfile/2 function (uses a fallback if<br><br> + unavailable)<br><br> + * Allow IP tuples in Transport:connect/3<br><br> + * Add ranch:set_max_connections/2 to update the value live<br><br> + * Add ranch:get_max_connections/1 to retrieve it<br><br> +<br><br> + We are always looking for feedback, especially now that<br><br> + there is no<br><br> + ticket left open on this project. If you are using Ranch<br><br> + and have<br><br> + questions or needs that it doesn't cover, please send them<br><br> + to us.<br><br> +<br><br> + Commercial support will be available starting from January,<br><br> + ping me<br><br> + if you are interested. Details will be announced at a later<br><br> + time on<br><br> + the <a href="http://ninenines.eu" target="_blank">ninenines.eu</a> <<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a>><br><br> + <<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a>> mailing list.<br><br> +<br><br> +<br><br> + I want to thank all contributors for helping this project<br><br> + by opening<br><br> + tickets, sending patches and offering feedback. I am as<br><br> + always very<br><br> + grateful for any and all contributions. I wouldn't have<br><br> + made it this<br><br> + far without the tremendous help I receive everyday.<br><br> +<br><br> + Thanks to all and have a nice holiday!<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + Erlang Santa<br><br> + Nine Nines<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br></div></div><br> + ______________________________<u></u>_____________________<br><br> + erlang-questions mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">erlang-questions@<u></u>erlang.org</a>><br><br> + <a href="http://erlang.org/mailman/____listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/____<u></u>listinfo/erlang-questions</a><br><br> + <<a href="http://erlang.org/mailman/__listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/__<u></u>listinfo/erlang-questions</a>><div class="im"><br><br> + <<a href="http://erlang.org/mailman/__listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/__<u></u>listinfo/erlang-questions</a><br><br> + <<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a>>><br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + Erlang Cowboy<br><br> + Nine Nines<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +</div></blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130103/f6c7fd25/attachment.html b/archives/extend/attachments/20130103/f6c7fd25/attachment.html new file mode 100644 index 00000000..e86b276c --- /dev/null +++ b/archives/extend/attachments/20130103/f6c7fd25/attachment.html @@ -0,0 +1,97 @@ +<tt> +<div dir="ltr"><div>I mean situation that after cowboy:update_options existing acceptors are still working with old routes.<br></div>Currently it is useless API, so I have to stop cowboy and start it back.<br></div><div class="gmail_extra"><br> +<br><br><div class="gmail_quote">On Thu, Jan 3, 2013 at 4:46 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Haven't had any stability issue. What we did here is ensure that when any process gets killed for any reason, especially reasons we can't foresee, Ranch continues to work as expected.<br><br> +<br><br> +Ranch not updating protocol options for existing connections isn't a problem, it won't be "fixed". Ranch can't guess how connection processes are implemented. It's up to you to allow this if you need it. The upgrade updates the options for all acceptors and all future connections, that's it.<div class="im"><br> +<br><br> +<br><br> +On 01/03/2013 10:30 AM, Max Lapshin wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +Loic, it would be great to hear a bit, what problems have you met with.<br><br> +<br><br> +What issues with stability can be in acceptor pool?<br><br> +<br><br> +Also I have question about updating protocol options: have you done<br><br> +something with the problem that after updating protocol options existing<br><br> +workers are running with old config?<br><br> +<br><br> +On Tuesday, December 25, 2012, Loïc Hoguin wrote:<br><br> +<br><br> + Ho ho ho!<br><br> +<br><br> + I have just tagged version 0.6.0 of the Ranch project!<br><br> +<br><br> + Ranch is a socket acceptor pool for TCP protocols.<br><br> +<br></div><br> + <a href="https://github.com/extend/__ranch" target="_blank">https://github.com/extend/__<u></u>ranch</a> <<a href="https://github.com/extend/ranch" target="_blank">https://github.com/extend/<u></u>ranch</a>><div class="im"><br> +<br><br> +<br><br> + Ranch is used by the next version of Cowboy, 0.8.0, set to be<br><br> + released early February, but also in Basho's Riak multi-data center<br><br> + replication amongst others.<br><br> +<br><br> + All tickets have been resolved. A significant contribution was made<br><br> + by Andrew Majorov to improve the fault tolerance capabilities of the<br><br> + application, making sure it always restarts properly when things go<br><br> + wrong. This has been made possible thanks to the amazing project<br><br> + from Daniel Luna, chaos_monkey<br></div><br> + (<a href="https://github.com/dluna/__chaos_monkey" target="_blank">https://github.com/dluna/__<u></u>chaos_monkey</a><br><br> + <<a href="https://github.com/dluna/chaos_monkey" target="_blank">https://github.com/dluna/<u></u>chaos_monkey</a>>).<div class="im"><br><br> +<br><br> + The guide has also been improved and completed.<br><br> +<br></div><br> + <a href="http://ninenines.eu/docs/en/__ranch/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/__<u></u>ranch/HEAD/guide/introduction</a><div class="im"><br><br> + <<a href="http://ninenines.eu/docs/en/ranch/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/<u></u>ranch/HEAD/guide/introduction</a>><br><br> +<br><br> + If the guide isn't enough, drop by our new IRC channel dedicated to<br><br> + Cowboy, Ranch and all our other projects! #ninenines on Freenode.<br><br> +<br><br> + Following is the list of change since last time:<br><br> +<br><br> + * Improve fault tolerance thanks to chaos_monkey testing<br><br> + * Add 'nodelay' option to transports<br><br> + * Add 'verify' option to ranch_ssl transport<br><br> + * Add 'socket' option to pass an already open socket to the listener<br><br> + * Add Transport:sendfile/2 function (uses a fallback if unavailable)<br><br> + * Allow IP tuples in Transport:connect/3<br><br> + * Add ranch:set_max_connections/2 to update the value live<br><br> + * Add ranch:get_max_connections/1 to retrieve it<br><br> +<br><br> + We are always looking for feedback, especially now that there is no<br><br> + ticket left open on this project. If you are using Ranch and have<br><br> + questions or needs that it doesn't cover, please send them to us.<br><br> +<br><br> + Commercial support will be available starting from January, ping me<br><br> + if you are interested. Details will be announced at a later time on<br></div><br> + the <a href="http://ninenines.eu" target="_blank">ninenines.eu</a> <<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a>> mailing list.<div class="im"><br><br> +<br><br> + I want to thank all contributors for helping this project by opening<br><br> + tickets, sending patches and offering feedback. I am as always very<br><br> + grateful for any and all contributions. I wouldn't have made it this<br><br> + far without the tremendous help I receive everyday.<br><br> +<br><br> + Thanks to all and have a nice holiday!<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + Erlang Santa<br><br> + Nine Nines<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br></div><br> + ______________________________<u></u>___________________<br><br> + erlang-questions mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> + <a href="http://erlang.org/mailman/__listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/__<u></u>listinfo/erlang-questions</a><br><br> + <<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a>><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130117/19bfde40/attachment.html b/archives/extend/attachments/20130117/19bfde40/attachment.html new file mode 100644 index 00000000..7bed6877 --- /dev/null +++ b/archives/extend/attachments/20130117/19bfde40/attachment.html @@ -0,0 +1,20 @@ +<tt> +<div dir="ltr">Thanks<font face="arial, sans-serif"><span style="white-space:nowrap">�Lo�c!</span></font></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 17, 2013 at 10:33 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Short, quick and semi-private announcement: Ranch 0.6.1 has been tagged.<br><br> +<br><br> +It includes a few guide updates, the addition of the raw option for specifying platform-specific socket options, and performance improvements when using the {max_connections, infinity} option.<br><br> +<br><br> +Enjoy!<span class="HOEnZb"><font color="#888888"><br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130125/7d0820aa/attachment.html b/archives/extend/attachments/20130125/7d0820aa/attachment.html new file mode 100644 index 00000000..53a6c745 --- /dev/null +++ b/archives/extend/attachments/20130125/7d0820aa/attachment.html @@ -0,0 +1,35 @@ +<tt> +Hi Loic,<div><br></div><div>I'd like to send feedback very much. But right now Cowboy is just used as demo in my company --- BesTV (<a href="http://www.bestv.com.cn">www.bestv.com.cn</a>), which is the largest IPTV and intenetTV operator in China. Although I think Cowby is good, the production environment is still dominated by Java and mainstream HTTP servers. Because I'm from Ericsson, I hope to promote Erlang here but it's not so easy. I would send the data if Cowboy would be used in production and fully tested.</div><br> +<div><br></div><div>Thank you!</div><div>Barco<br><br><div class="gmail_quote">On Fri, Jan 25, 2013 at 5:23 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br><br> +<br><br> +I'm looking into perhaps starting a project related to Cowboy and could use some feedback from users, particularly in the realm of numbers.<br><br> +<br><br> +If you use Cowboy and have it in production where:<br><br> +<br><br> +�* �Latency is vital<br><br> +�* �Throughput is vital<br><br> +�* �Concurrent number of connections is huge<br><br> +�* �Load is huge (or would be with another solution)<br><br> +<br><br> +Then I'd like to hear from you!<br><br> +<br><br> +Please send me average numbers, statistics, graphs or anything where I can see how well it performs for you! In private if you prefer. Tell me if I can quote you or your company about it. Please answer even if we briefly discussed it in the past.<br><br> +<br> +<br><br> +(If you found that it didn't perform enough for your needs you should probably open a ticket, or, if you can't, send me a private email.)<br><br> +<br><br> +Looking forward to the feedback. Thanks!<span class="HOEnZb"><font color="#888888"><br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130204/3c258140/attachment.html b/archives/extend/attachments/20130204/3c258140/attachment.html new file mode 100644 index 00000000..4bf7a15b --- /dev/null +++ b/archives/extend/attachments/20130204/3c258140/attachment.html @@ -0,0 +1,20 @@ +<tt> +<div dir="ltr">It is rebar compatible<div><br></div><div><a href="https://github.com/extend/cowboy/blob/master/rebar.config">https://github.com/extend/cowboy/blob/master/rebar.config</a><br></div><div><br></div><div style><br> +I use it with rebar all the time.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 24, 2013 at 2:41 PM, Grzegorz Junka <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br> +I understand the move away from Rebar but I'd like to see the project to be still Rebar-compatible. Would that be a problem? Mainly I am thinking about dependencies. The Cowboy Makefile assumes that Ranch is in its deps folder. If Cowboy is a part of a bigger application, and most often it will be in such a role rather than a standalone application, then all dependencies should be kept in one place. In that case it would be the main project's deps folder, not Cowboy's deps folder. Can the compilation process be split into compiling Cowboy dependencies separately from Cowboy itself?<br><br> +<br> +<br><br> +something like:<br><br> +<br><br> +all: compile-deps compile-cowboy<br><br> +<br><br> +Then if Cowboy is a dependency itself it may be just compiled without the dependency (as it will be compiled when the main project is compiled).<br><br> +<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130204/c34e6aa6/attachment.html b/archives/extend/attachments/20130204/c34e6aa6/attachment.html new file mode 100644 index 00000000..723b1717 --- /dev/null +++ b/archives/extend/attachments/20130204/c34e6aa6/attachment.html @@ -0,0 +1,79 @@ +<tt> +<html><br> + <head><br> + <meta content="text/html; charset=ISO-8859-1"<br> + http-equiv="Content-Type"><br> + </head><br> + <body text="#000000" bgcolor="#FFFFFF"><br> + <div class="moz-cite-prefix"><br> + <pre><div class="line" id="LC32">deps/ranch:</div><div class="line" id="LC33"> @mkdir -p <span class="k">$(</span>DEPS_DIR<span class="k">)</span></div><div class="line" id="LC34"> git clone -n -- <a class="moz-txt-link-freetext" href="https://github.com/extend/ranch.git">https://github.com/extend/ranch.git</a> <span class="k">$(</span>DEPS_DIR<span class="k">)</span>/ranch</div><div class="line" id="LC35"> <span class="nb">cd</span> <span class="k">$(</span>DEPS_DIR<span class="k">)</span>/ranch ; git checkout -q <span class="k">$(</span>RANCH_VSN<span class="k">)</span></div></pre><br> + <br><br> + Am I to understand that the only way of having the dependencies in<br> + another folder than cowboy/deps is to use Rebar (e.g. if compiling<br> + using the makefile it will always assume that dependencies are in<br> + local deps folder)?<br><br> + <br><br> + Would be good to have a target to compile cowboy without<br> + dependencies.<br><br> + <br><br> + <br><br> + On 04/02/2013 20:10, Jeremy Ong wrote:<br><br> + </div><br> + <blockquote<br> +cite="mid:CAKD1GY7+fvMOR6PhOz=QGAi8r2T_Obf4gCjaH4hN_=J+hNyw4w@mail.gmail.com"<br> + type="cite"><br> + <div dir="ltr">It is rebar compatible<br> + <div><br><br> + </div><br> + <div><a moz-do-not-send="true"<br> + href="https://github.com/extend/cowboy/blob/master/rebar.config">https://github.com/extend/cowboy/blob/master/rebar.config</a><br><br> + </div><br> + <div><br><br> + </div><br> + <div style=""><br> + I use it with rebar all the time.</div><br> + </div><br> + <div class="gmail_extra"><br><br> + <br><br> + <div class="gmail_quote">On Thu, Jan 24, 2013 at 2:41 PM,<br> + Grzegorz Junka <span dir="ltr"><<a moz-do-not-send="true"<br> + href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br> + wrote:<br><br> + <blockquote class="gmail_quote" style="margin:0 0 0<br> + .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br> + I understand the move away from Rebar but I'd like to see<br> + the project to be still Rebar-compatible. Would that be a<br> + problem? Mainly I am thinking about dependencies. The Cowboy<br> + Makefile assumes that Ranch is in its deps folder. If Cowboy<br> + is a part of a bigger application, and most often it will be<br> + in such a role rather than a standalone application, then<br> + all dependencies should be kept in one place. In that case<br> + it would be the main project's deps folder, not Cowboy's<br> + deps folder. Can the compilation process be split into<br> + compiling Cowboy dependencies separately from Cowboy itself?<br><br> + <br><br> + something like:<br><br> + <br><br> + all: compile-deps compile-cowboy<br><br> + <br><br> + Then if Cowboy is a dependency itself it may be just<br> + compiled without the dependency (as it will be compiled when<br> + the main project is compiled).<br><br> + <br><br> + _______________________________________________<br><br> + Extend mailing list<br><br> + <a moz-do-not-send="true"<br> + href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> + <a moz-do-not-send="true"<br> + href="http://lists.ninenines.eu:81/listinfo/extend"<br> + target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br><br> + </blockquote><br> + </div><br> + <br><br> + </div><br> + </blockquote><br> + <br><br> + </body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130210/1b9560c2/attachment.html b/archives/extend/attachments/20130210/1b9560c2/attachment.html new file mode 100644 index 00000000..3050d08f --- /dev/null +++ b/archives/extend/attachments/20130210/1b9560c2/attachment.html @@ -0,0 +1,6 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div> I'm playing around with a middleware and request/responsehooks. A couple of questions that have surfaced:</div><div>* Say I map a module to "/my/path[...]" and then curl "/my/path/even/more/stuff". Is there a way to retrieve the "rest" of the matched path, i.e. like cowboy_req:path_info/1 but just the rest, not the total path. The result I want is: [<<"even">>, <<"more">>, <<"stuff">>].</div><div>* I've been trying to use a responsehook to ensure that a default content-type is set if none is specified. Been trying with cowboy_req:reply, coboy_req:set_resp_headers, etc. It doesn't seem to work that well. What's the preferred way?<br><div apple-content-edited="true"><br> +<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Regards,</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Bip Thelin</div></span></div></span></div></span><br> +</div><br> +<br></div></body></html> +</tt> diff --git a/archives/extend/attachments/20130212/09008370/attachment.html b/archives/extend/attachments/20130212/09008370/attachment.html new file mode 100644 index 00000000..c0fae195 --- /dev/null +++ b/archives/extend/attachments/20130212/09008370/attachment.html @@ -0,0 +1,48 @@ +<tt> +<div dir="ltr">Congrats!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 9:36 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello there!<br><br> +<br><br> +Cowboy 0.8 has been released. Cowboy is a small, fast and modular HTTP, REST and Websocket server.<br><br> +<br><br> +� <a href="https://github.com/extend/cowboy/" target="_blank">https://github.com/extend/<u></u>cowboy/</a><br><br> +<br><br> +The number of contributors who helped make this release considerably increased. Cowboy is available thanks to the code contributions from 50 users, double from the last release where 25 contributed.<br><br> +<br><br> +The number of users has also greatly increased. Cowboy is being used in ad bidding, set-top boxes, live TV events, content streaming services, and many more exciting areas.<br><br> +<br><br> +This new version has many highlights. You can take a look at the changelog for detailed information about the many changes.<br><br> +<br><br> +� <a href="https://github.com/extend/cowboy/blob/master/CHANGELOG.md" target="_blank">https://github.com/extend/<u></u>cowboy/blob/master/CHANGELOG.<u></u>md</a><br><br> +<br><br> +Cowboy scalability has been greatly improved in this version. This has been observed many times in production, including in the AdGear Tracker project (<a href="http://ferd.ca/rtb-where-erlang-blooms.html" target="_blank">http://ferd.ca/rtb-where-<u></u>erlang-blooms.html</a>) where updated nodes were able to handle 2 times more requests compared to older nodes. This improvement cannot be observed in "hello world" types of benchmarks. An article will soon be published to explain the reasons for this.<br><br> +<br> +<br><br> +Cowboy now features a brand new user guide. It is still a work in progress, so please open a ticket on Github if something is missing or incorrect.<br><br> +<br><br> +� <a href="http://ninenines.eu/docs/en/cowboy/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/guide/introduction</a><br><br> +<br><br> +Remaining work before 1.0 include REST improvements and SPDY support. The rest of the API should now be very close to stable.<br><br> +<br><br> +I am looking for a good writer who would like to co-author a Cowboy book. The book will be accessible to people who don't know Erlang but will also contain everything there is to know about Cowboy, making it suitable for both beginners and experts. Contact me if you are interested.<br><br> +<br> +<br><br> +I now take donations in addition to commercial support options, to allow individual users to help the project stay alive and kicking.<br><br> +<br><br> +� <a href="http://ninenines.eu/support" target="_blank">http://ninenines.eu/support</a><br><br> +<br><br> +Hope you enjoy it. As always, please send me as much feedback as possible to help me improve things even more, preferrably through Github tickets if it's related to code or documentation.<br><br> +<br><br> +Thanks for reading.<span class="HOEnZb"><font color="#888888"><br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130212/dc0291b4/attachment.html b/archives/extend/attachments/20130212/dc0291b4/attachment.html new file mode 100644 index 00000000..7bdbf15a --- /dev/null +++ b/archives/extend/attachments/20130212/dc0291b4/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr">Great, Loic.<br><br>As I've told already, it would be great to listen to your experience about issues that you meet on high loads: smooth scaling, predictionable behaviour of server, etc.<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130213/41b12a6d/attachment.html b/archives/extend/attachments/20130213/41b12a6d/attachment.html new file mode 100644 index 00000000..aa578a68 --- /dev/null +++ b/archives/extend/attachments/20130213/41b12a6d/attachment.html @@ -0,0 +1,50 @@ +<tt> +<p>Great news! </p><br> +<p>Congrats! </p><br> +<div class="gmail_quote">On Feb 12, 2013 11:36 AM, "Lo�c Hoguin" <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello there!<br><br> +<br><br> +Cowboy 0.8 has been released. Cowboy is a small, fast and modular HTTP, REST and Websocket server.<br><br> +<br><br> +� <a href="https://github.com/extend/cowboy/" target="_blank">https://github.com/extend/<u></u>cowboy/</a><br><br> +<br><br> +The number of contributors who helped make this release considerably increased. Cowboy is available thanks to the code contributions from 50 users, double from the last release where 25 contributed.<br><br> +<br><br> +The number of users has also greatly increased. Cowboy is being used in ad bidding, set-top boxes, live TV events, content streaming services, and many more exciting areas.<br><br> +<br><br> +This new version has many highlights. You can take a look at the changelog for detailed information about the many changes.<br><br> +<br><br> +� <a href="https://github.com/extend/cowboy/blob/master/CHANGELOG.md" target="_blank">https://github.com/extend/<u></u>cowboy/blob/master/CHANGELOG.<u></u>md</a><br><br> +<br><br> +Cowboy scalability has been greatly improved in this version. This has been observed many times in production, including in the AdGear Tracker project (<a href="http://ferd.ca/rtb-where-erlang-blooms.html" target="_blank">http://ferd.ca/rtb-where-<u></u>erlang-blooms.html</a>) where updated nodes were able to handle 2 times more requests compared to older nodes. This improvement cannot be observed in "hello world" types of benchmarks. An article will soon be published to explain the reasons for this.<br><br> +<br> +<br><br> +Cowboy now features a brand new user guide. It is still a work in progress, so please open a ticket on Github if something is missing or incorrect.<br><br> +<br><br> +� <a href="http://ninenines.eu/docs/en/cowboy/HEAD/guide/introduction" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/guide/introduction</a><br><br> +<br><br> +Remaining work before 1.0 include REST improvements and SPDY support. The rest of the API should now be very close to stable.<br><br> +<br><br> +I am looking for a good writer who would like to co-author a Cowboy book. The book will be accessible to people who don't know Erlang but will also contain everything there is to know about Cowboy, making it suitable for both beginners and experts. Contact me if you are interested.<br><br> +<br> +<br><br> +I now take donations in addition to commercial support options, to allow individual users to help the project stay alive and kicking.<br><br> +<br><br> +� <a href="http://ninenines.eu/support" target="_blank">http://ninenines.eu/support</a><br><br> +<br><br> +Hope you enjoy it. As always, please send me as much feedback as possible to help me improve things even more, preferrably through Github tickets if it's related to code or documentation.<br><br> +<br><br> +Thanks for reading.<br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</blockquote></div><br> + +</tt> diff --git a/archives/extend/attachments/20130213/a992c0b6/attachment.html b/archives/extend/attachments/20130213/a992c0b6/attachment.html new file mode 100644 index 00000000..efa8eb31 --- /dev/null +++ b/archives/extend/attachments/20130213/a992c0b6/attachment.html @@ -0,0 +1,25 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><br> +<div><br><br> +</div><br> +<div> In 6.1, and still in 8.0, there is some logic that surprised me, and I wanted to see if it was intentional, or if I'm missing something.</div><br> +<div><br><br> +</div><br> +<div> If I set up a POST such that it's a create, I get back a 303, rather than a 201, on successful create. This came as a bit of a surprise; I know from Webmachine, if it's a new resource being created, a POST will return a 201 (N11 to P11 in Webmachine's<br> + v3 diagram). </div><br> +<div><br><br> +</div><br> +<div> Is this intentional? The logic seems to be post_is_create/2 -> create_path/2 -> put_resource/3 -> choose_content_type/5 -> next/3 -> respond(_, _, 303). It may be that this is a better response, rather than a 201 with the location header, but it came<br> + as a surprise given web machine's behavior.</div><br> +<div><br><br> +</div><br> +<div> For background, I'm attempting to migrate some web machine code to Cowboy, which is serving a RESTful API to a Javascript client. The client is making CORS calls. Receiving a 303 and a Location header seemed to mean that the call was redirected before<br> + the client side code ever saw it (not sure what the browser was doing; I was expecting another request, but I wasn't quite lucid enough to check for that last night when working on it); a 201 allows me to examine the location. </div><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130221/fc119c69/attachment.html b/archives/extend/attachments/20130221/fc119c69/attachment.html new file mode 100644 index 00000000..0a29dbf0 --- /dev/null +++ b/archives/extend/attachments/20130221/fc119c69/attachment.html @@ -0,0 +1,14 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><br> +<div><br><br> +</div><br> +<div> I have a case where I am creating a resource through a POST. There are a number of places where the create can fail in a known manner, and we need to alert the user to the specifics of why. Is there a way to throw an arbitrary 500, with message, from<br> + within the REST handler? I can obviously just erlang:error(whatever), but the message content is ignored, and there is no way to pass back an updated response when doing that.</div><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130317/2ee0bc92/attachment.html b/archives/extend/attachments/20130317/2ee0bc92/attachment.html new file mode 100644 index 00000000..916afb32 --- /dev/null +++ b/archives/extend/attachments/20130317/2ee0bc92/attachment.html @@ -0,0 +1,54 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><br> +<div> Cowboy aims to use binaries, not strings, and unless there's a change in the head branch I don't have, the returned tuple has only two values, the value and the request. So it should look like something like - </div><br> +<div><br><br> +</div><br> +<div> {Value, Req2} = cowboy_req:header(<<"user-agent">>, Req)</div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<span id="OLK_SRC_BODY_SECTION"><br> +<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><br> +<span style="font-weight:bold">From: </span>������ �������� <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Date: </span>Sunday, March 17, 2013 9:22 AM<br><br> +<span style="font-weight:bold">To: </span>"<a href="mailto:[email protected]">[email protected]</a>" <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Subject: </span>[99s-extend] cowboy header<br><br> +</div><br> +<div><br><br> +</div><br> +<div><br> +<div><br> +<div>Hello tell me how I can get for example http header "user-agent"?</div><br> +<div>I do so:</div><br> +<div> </div><br> +<div>handle(Req, State) -></div><br> +<div> </div><br> +<div>{ok, FwdIP, Req5} = cowboy_req:header("user-agent, Req)</div><br> +<div> </div><br> +<div>but in this place I get the error</div><br> +<div> </div><br> +<div> </div><br> +<div> </div><br> +<div>--</div><br> +<div>Vjacheslav Kozlov</div><br> +<div>Engineer of AEMS</div><br> +<div>Ltd. "EER-Novomichurinsk"</div><br> +<div>--</div><br> +<div><a href="http://www.ter-energo.ru">http://www.ter-energo.ru</a></div><br> +<div>+79109095144 09:00-18:00 (GMT+04:00)</div><br> +</div><br> +</div><br> +</span><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130317/2f20f449/attachment.html b/archives/extend/attachments/20130317/2f20f449/attachment.html new file mode 100644 index 00000000..4ad610e9 --- /dev/null +++ b/archives/extend/attachments/20130317/2f20f449/attachment.html @@ -0,0 +1,5 @@ +<tt> +<div>Hello tell me how I can get for example http header "user-agent"?</div><div>I do so:</div><div>�</div><div>handle(Req, State) -></div><div>�</div><div>{ok, FwdIP, Req5} = cowboy_req:header("user-agent, Req)</div><div>�</div><div>but in this place I get the error</div><div>�</div><div>�</div><div>�</div><div>--</div><div>Vjacheslav Kozlov</div><div>Engineer of AEMS</div><div>Ltd. "EER-Novomichurinsk"</div><div>--</div><div>http://www.ter-energo.ru</div><div>+79109095144 09:00-18:00 (GMT+04:00)</div><br> +<br> + +</tt> diff --git a/archives/extend/attachments/20130413/f1b70800/attachment.html b/archives/extend/attachments/20130413/f1b70800/attachment.html new file mode 100644 index 00000000..26903184 --- /dev/null +++ b/archives/extend/attachments/20130413/f1b70800/attachment.html @@ -0,0 +1,13 @@ +<tt> +<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 11, 2013 at 8:37 PM, Brown, Kevin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><br> +Cowfolk,<br><br> +<br><br> +I am doing something like this to create an #http_req suitable for unit<br><br> +testing my resource callbacks:<br></blockquote><br><br></div><div class="gmail_quote">I use the library meck(<a href="https://github.com/eproxus/meck">https://github.com/eproxus/meck</a>) to test stuff doing something like this:<br><br> +<br>some_test() -><br>� meck:expect(cowboy_req, binding, 2, {<<"app_key">>, req} )<br>� ?assertEqual({ok, req, empty},<br>� � ������������ websocket_handler:websocket_init(transport, req, opts)),<br><br> +� ?assert(meck:validate(cowboy_req)).<br><br></div><div class="gmail_quote">I use simple atoms as input and mock the cowboy_req functions to return atoms that would represent the correct or the wrong answer. <br><br></div><br> +<div class="gmail_quote">The real implementation or how cowboy represent stuff is not important here, just the output pattern like {Binding, Req}.<br><br></div><div class="gmail_quote">That's it<br clear="all"></div><br><br> +-- <br><br>Eduardo<br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130415/03f35a62/attachment.html b/archives/extend/attachments/20130415/03f35a62/attachment.html new file mode 100644 index 00000000..e39c9a22 --- /dev/null +++ b/archives/extend/attachments/20130415/03f35a62/attachment.html @@ -0,0 +1,8 @@ +<tt> +<div dir="ltr">Hello group,<div><br></div><div style>I am trying to put together a CSRF middleware�<a href="https://github.com/rambocoder/stable/commit/b26980d292ac42aadfe9921a961436e28cdbb693">https://github.com/rambocoder/stable/commit/b26980d292ac42aadfe9921a961436e28cdbb693</a>�and if the body of the request contains "_csrf" token, I check to make sure it matches the csrf token in the session.</div><br> +<div style><br></div><div style>Currently I am doing it in middleware using cowboy_req:body_qs/1 however when in the handler I need to read another body parameter, such as in the rest_pastebin example:</div><div style><br><br> +</div><div style><div><span class="" style="white-space:pre"> </span>{ok, BodyQs, Req3} = cowboy_req:body_qs(Req),</div><div><span class="" style="white-space:pre"> </span>Paste = proplists:get_value(<<"paste">>, BodyQs),<br><br> +</div><div><br></div><div>cowboy_req:body_qs/1 returns [] due to the body of the request being already read�{body_state,done}<br></div><div><br></div><div style>Is it pointless to have the type of CSRF middleware that I am writing and just do the CSRF in the handler's callback, where I can deal with all the body_qs at once?</div><br> +<div style><br></div><div style>Thank you,</div><div style><br></div><div style>rambocoder</div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130415/59aaeef2/attachment.html b/archives/extend/attachments/20130415/59aaeef2/attachment.html new file mode 100644 index 00000000..f25d30e9 --- /dev/null +++ b/archives/extend/attachments/20130415/59aaeef2/attachment.html @@ -0,0 +1,56 @@ +<tt> +<div dir="ltr">Loic,<div><br></div><div style>After giving the CSRF middleware some thought and reading <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Disclosure_of_Token_in_URL">https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Disclosure_of_Token_in_URL</a> I came to conclusion that it is best to just not create the middleware and instead deal with CSRF on as needed basis. </div><br> +<div style><br></div><div style>I know that node's Connect middleware <a href="http://www.senchalabs.org/connect/csrf.html#defaultValue">http://www.senchalabs.org/connect/csrf.html#defaultValue</a> for example allows for the csrf token to be passed as a query string parameter, however, the OWASP article made me think that it is not the most secure approach.</div><br> +<div style><br></div><div style>For example, AngularJS <a href="http://docs.angularjs.org/api/ng.$http">http://docs.angularjs.org/api/ng.$http</a> has a section on how their AJAX component behaves to do CSRF out of the box, and they are talking about the server sending a cookie <span style="color:rgb(51,51,51);font-family:monospace;font-size:12.800000190734863px;line-height:18px">XSRF-TOKEN </span>that is not HttpOnly. That makes me realize that csrf is a process more than just slapping some middleware into the pipeline.</div><br> +<div style><br></div><div style>Btw, I noticed that when the result of the middleware execute function is:</div><div style>{error, StatusCode, Req}<br></div><div style>if I set the reply on the request via cowboy_req:reply before returning the {error.. , the status code of that reply will be used.</div><br> +<div style><br></div><div style>Such as:</div><div style><div>{ok, Req3} = cowboy_req:reply(403, [], "Invalid CSRF Token.", Req2),<span class="" style="white-space:pre"> </span></div><div>{error, 500, Req3}; % 500 is ignored, 403 is returned</div><br> +<div><br></div><div style>Is that by design?</div><div style><br></div><div style>Sincerely,</div><div style><br></div><div style>rambocoder</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><br> +On Mon, Apr 15, 2013 at 4:47 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Why not just put the token in the URL instead? if it's CSRF then it's probably used only once and only for POST and the like, so not cached or anything.<div><div class="h5"><br><br> +<br><br> +On 04/15/2013 10:45 PM, rambocoder wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hello group,<br><br> +<br><br> +I am trying to put together a CSRF middleware<br><br> +<a href="https://github.com/rambocoder/stable/commit/b26980d292ac42aadfe9921a961436e28cdbb693" target="_blank">https://github.com/rambocoder/<u></u>stable/commit/<u></u>b26980d292ac42aadfe9921a961436<u></u>e28cdbb693</a> and<br><br> +<br> +if the body of the request contains "_csrf" token, I check to make sure<br><br> +it matches the csrf token in the session.<br><br> +<br><br> +Currently I am doing it in middleware using cowboy_req:body_qs/1 however<br><br> +when in the handler I need to read another body parameter, such as in<br><br> +the rest_pastebin example:<br><br> +<br><br> +{ok, BodyQs, Req3} = cowboy_req:body_qs(Req),<br><br> +Paste = proplists:get_value(<<"paste"><u></u>>, BodyQs),<br><br> +<br><br> +cowboy_req:body_qs/1 returns [] due to the body of the request being<br><br> +already read {body_state,done}<br><br> +<br><br> +Is it pointless to have the type of CSRF middleware that I am writing<br><br> +and just do the CSRF in the handler's callback, where I can deal with<br><br> +all the body_qs at once?<br><br> +<br><br> +Thank you,<br><br> +<br><br> +rambocoder<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130419/383515dd/attachment.html b/archives/extend/attachments/20130419/383515dd/attachment.html new file mode 100644 index 00000000..05571216 --- /dev/null +++ b/archives/extend/attachments/20130419/383515dd/attachment.html @@ -0,0 +1,213 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><br> +<div> When querying to the VM from a browser, is Chrome complaining that it's a cross domain request in the console? Or something else? </div><br> +<div><br><br> +</div><br> +<div> Is the OPTIONS request firing and failing, or is it the POST that is failing (in the network tab)? </div><br> +<div><br><br> +</div><br> +<div> If it's working in a cross origin context for you locally across different domains (I.e., the browser is sending the CORS headers on the request, and you're seeing the right headers on the response, and the browser is handling them properly, such that<br> + you can retrieve the response from your Javascript), then it seems unlikely to be a CORS issue, but maybe a config or proxy or code issue in your handler. </div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<span id="OLK_SRC_BODY_SECTION"><br> +<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><br> +<span style="font-weight:bold">From: </span>Lee Sylvester <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Date: </span>Friday, April 19, 2013 10:47 AM<br><br> +<span style="font-weight:bold">To: </span>"<a href="mailto:[email protected]">[email protected]</a>" <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Subject: </span>[99s-extend] Cowboy CORS<br><br> +</div><br> +<div><br><br> +</div><br> +<div><br> +<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br> +<div>Hi guys,</div><br> +<div><br><br> +</div><br> +<div>So, I thought I had this resolved, as I managed to get it working locally, but across different local domains (<a href="http://test.localhost.com">test.localhost.com</a> and<br> +<a href="http://cowboy.localhost.com">cowboy.localhost.com</a>). However, now I've deployed my app to a VM, I simply can't get CORS working in Cowboy. Here's the OPTIONS response from Chrome's console:</div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<div><br> +<ol class="outline-disclosure" tabindex="0" style="box-sizing: border-box; font-size: 11px; list-style-type: none; -webkit-padding-start: 12px; margin: 0px; outline: none; font-family: 'Lucida Grande', sans-serif; background-color: rgb(255, 255, 255); "><br> +<li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Request URL:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +<a href="http://www.example.com/">http://www.example.com/</a></div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Request Method:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +OPTIONS</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Status Code:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +200 OK</div><br> +</li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;"><br> +Request Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view source</span><br> +<ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><br> +<li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Accept:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +*/*</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Accept-Charset:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +ISO-8859-1,utf-8;q=0.7,*;q=0.3</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Accept-Encoding:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +gzip,deflate,sdch</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Accept-Language:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +en-US,en;q=0.8</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Access-Control-Request-Headers:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +origin, method, content-type</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Access-Control-Request-Method:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +POST</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Connection:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +keep-alive</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Host:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +<a href="http://www.example.com">www.example.com</a></div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Origin:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +<a href="http://test.localhost.com:8889">http://test.localhost.com:8889</a></div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Referer:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +<a href="http://test.localhost.com:8889/">http://test.localhost.com:8889/</a></div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +User-Agent:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31</div><br> +</li></ol><br> +</li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;"><br> +Response Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view source</span><br> +<ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><br> +<li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Access-Control-Allow-Headers:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +Content-Type, X-Requested-With, Origin, Method</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Access-Control-Allow-Methods:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +GET, POST, OPTIONS</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Access-Control-Allow-Origin:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +*</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +connection:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +keep-alive</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +content-length:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +0</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +date:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +Fri, 19 Apr 2013 14:40:00 GMT</div><br> +</li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +server:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +Cowboy</div><br> +</li></ol><br> +</li></ol><br> +<div><br><br> +</div><br> +</div><br> +<div>And then this is the POST response:</div><br> +<div><br><br> +</div><br> +<div><br> +<ol class="outline-disclosure" tabindex="0" style="box-sizing: border-box; font-size: 11px; list-style-type: none; -webkit-padding-start: 12px; margin: 0px; outline: none; font-family: 'Lucida Grande', sans-serif; background-color: rgb(255, 255, 255); "><br> +<li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><br> +<div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;"><br> +Request URL:</div><br> +<div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><br> +<a href="http://www.example.com/">http://www.example.com/</a></div><br> +</li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;"><br> +Request Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view parsed</span><br> +<ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><br> +<li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<span class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">POST<br> +<a href="http://www.example.com/">http://www.example.com/</a> HTTP/1.1 Origin: <a href="http://test.localhost.com:8889"><br> +http://test.localhost.com:8889</a> Referer: <a href="http://test.localhost.com:8889/"><br> +http://test.localhost.com:8889/</a> method: POST <a href="http://www.example.com/"><br> +http://www.example.com/</a> HTTP/1.1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31 content-type: application/x-www-form-urlencoded</span></li></ol><br> +</li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;"><br> +Form Data<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view parsed</span><br> +<ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><br> +<li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><br> +<span class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">data={"Type":"auth_request","Authentication":"public","Authorization":null,"Domain":"<a href="http://www.example.com">www.example.com</a>","Application":"test_app","Ident":"lee"}</span></li></ol><br> +</li></ol><br> +<div><br><br> +</div><br> +</div><br> +<div>I am setting {<<"Access-Control-Allow-Origin">>, <<"*">>} in the headers param of cowboy_req:reply and the cowboy_req:set_resp_header, but neither seems to be working. Can anyone spot what I might be doing wrong?</div><br> +<div><br><br> +</div><br> +<div>The cowboy_req:set_resp_header is happening in the handle� So</div><br> +<div><br><br> +</div><br> +<div><br> +<div>handle(Req, State) -></div><br> +<div><span class="Apple-tab-span" style="white-space:pre"></span>Reply = case cowboy_req:method(Req) of</div><br> +<div><span class="Apple-tab-span" style="white-space:pre"></span>{<<"POST">>, Req2} -></div><br> +<div><span class="Apple-tab-span" style="white-space:pre"></span>Req3 = cowboy_req:set_resp_header(<<"Access-Control-Allow-Origin">>, <<"*">>, Req2),</div><br> +</div><br> +<div>[snip]</div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<div>Thanks,</div><br> +<div>Lee</div><br> +<div><br><br> +</div><br> +</div><br> +</div><br> +</span><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130419/bf0e8ef9/attachment.html b/archives/extend/attachments/20130419/bf0e8ef9/attachment.html new file mode 100644 index 00000000..8b3834c9 --- /dev/null +++ b/archives/extend/attachments/20130419/bf0e8ef9/attachment.html @@ -0,0 +1,8 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi guys,</div><div><br></div><div>So, I thought I had this resolved, as I managed to get it working locally, but across different local domains (<a href="http://test.localhost.com">test.localhost.com</a> and <a href="http://cowboy.localhost.com">cowboy.localhost.com</a>). However, now I've deployed my app to a VM, I simply can't get CORS working in Cowboy. Here's the OPTIONS response from Chrome's console:</div><div><br></div><div><br></div><div><ol class="outline-disclosure" tabindex="0" style="box-sizing: border-box; font-size: 11px; list-style-type: none; -webkit-padding-start: 12px; margin: 0px; outline: none; font-family: 'Lucida Grande', sans-serif; background-color: rgb(255, 255, 255); "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Request URL:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://www.example.com/">http://www.example.com/</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Request Method:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">OPTIONS</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Status Code:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">200 OK</div></li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Request Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view source</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">*/*</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept-Charset:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">ISO-8859-1,utf-8;q=0.7,*;q=0.3</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept-Encoding:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">gzip,deflate,sdch</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept-Language:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">en-US,en;q=0.8</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Request-Headers:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">origin, method, content-type</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Request-Method:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">POST</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Connection:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">keep-alive</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Host:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://www.example.com">www.example.com</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Origin:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://test.localhost.com:8889">http://test.localhost.com:8889</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Referer:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://test.localhost.com:8889/">http://test.localhost.com:8889/</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">User-Agent:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31</div></li></ol><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Response Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view source</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Allow-Headers:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Content-Type, X-Requested-With, Origin, Method</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Allow-Methods:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">GET, POST, OPTIONS</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Allow-Origin:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">*</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">connection:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">keep-alive</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">content-length:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">0</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">date:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Fri, 19 Apr 2013 14:40:00 GMT</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">server:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Cowboy</div></li></ol></ol><div><br></div></div><div>And then this is the POST response:</div><div><br></div><div><ol class="outline-disclosure" tabindex="0" style="box-sizing: border-box; font-size: 11px; list-style-type: none; -webkit-padding-start: 12px; margin: 0px; outline: none; font-family: 'Lucida Grande', sans-serif; background-color: rgb(255, 255, 255); "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Request URL:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://www.example.com/">http://www.example.com/</a></div></li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Request Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view parsed</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><span class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">POST <a href="http://www.example.com/">http://www.example.com/</a> HTTP/1.1<br> +Origin: <a href="http://test.localhost.com:8889">http://test.localhost.com:8889</a><br> +Referer: <a href="http://test.localhost.com:8889/">http://test.localhost.com:8889/</a><br> +method: POST <a href="http://www.example.com/">http://www.example.com/</a> HTTP/1.1<br> +User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31<br> +content-type: application/x-www-form-urlencoded</span></li></ol><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Form Data<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view parsed</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><span class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">data={"Type":"auth_request","Authentication":"public","Authorization":null,"Domain":"<a href="http://www.example.com">www.example.com</a>","Application":"test_app","Ident":"lee"}</span></li></ol></ol><div><br></div></div><div>I am setting {<<"Access-Control-Allow-Origin">>, <<"*">>} in the headers param of cowboy_req:reply and the cowboy_req:set_resp_header, but neither seems to be working. Can anyone spot what I might be doing wrong?</div><div><br></div><div>The cowboy_req:set_resp_header is happening in the handle� So</div><div><br></div><div><div>handle(Req, State) -></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Reply = case cowboy_req:method(Req) of</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<<"POST">>, Req2} -></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Req3 = cowboy_req:set_resp_header(<<"Access-Control-Allow-Origin">>, <<"*">>, Req2),</div></div><div>[snip]</div><div><br></div><div><br></div><div>Thanks,</div><div>Lee</div><div><br></div></body></html> +</tt> diff --git a/archives/extend/attachments/20130425/35ee7614/attachment.html b/archives/extend/attachments/20130425/35ee7614/attachment.html new file mode 100644 index 00000000..0f133e02 --- /dev/null +++ b/archives/extend/attachments/20130425/35ee7614/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div>You know, the OTP's code_change so heavy, sometimes, you just want to debug, or change a little, does not want to rewrite the rel appup file.<br></div>Any help is appreciated, thanks.</div><br> + +</tt> diff --git a/archives/extend/attachments/20130426/09f3ed34/attachment.html b/archives/extend/attachments/20130426/09f3ed34/attachment.html new file mode 100644 index 00000000..0e62d4c9 --- /dev/null +++ b/archives/extend/attachments/20130426/09f3ed34/attachment.html @@ -0,0 +1,20 @@ +<tt> +<div dir="ltr"><div>Thanks very much !<br></div>Maybe we can use the code:load_file() function I had just found it .<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/25 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 04/25/2013 05:46 AM, yongboy wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You know, the OTP's code_change so heavy, sometimes, you just want to<br><br> +debug, or change a little, does not want to rewrite the rel appup file.<br><br> +Any help is appreciated, thanks.<br><br> +</blockquote><br> +<br></div></div><br> +At this time there is no code_change mechanism in Cowboy. Reloading a module works, modifying the protocol options with ranch:set_protocol_options can be used, but it doesn't change the running processes.<span class="HOEnZb"><font color="#888888"><br><br> +<br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130426/9d234e27/attachment.html b/archives/extend/attachments/20130426/9d234e27/attachment.html new file mode 100644 index 00000000..cbe576b0 --- /dev/null +++ b/archives/extend/attachments/20130426/9d234e27/attachment.html @@ -0,0 +1,12 @@ +<tt> +<div dir="ltr"><div><div>I have tested one long-hold webapp, when 512000 user connected, the app used <br></div>6801M memory, 6801M*1024K / 512000 = 13.6K/Connection.<br><br></div><div>Does anyone give me some advice on how to reduce the memory usage per one connection, thanks very much !<br>
<br> +</div><div><br></div>Here is the code snippet:<br><br>start(_Type, _Args) -><br>������� Dispatch = cowboy_router:compile([<br>����������� {'_', [{'_', htmlfile_handler, []}]}<br>������� ]),<br>������� cowboy:start_http(my_http_listener, 100,<br>
<br> +����������� [{port, 8000}, {max_connections, infinity}],<br>����������� [{env, [{dispatch, Dispatch}]}]<br>������� ),<br>������� count_server:start(),<br>������� htmlfilesimple_sup:start_link().<br><br>......<br><br>-module(htmlfile_handler).<br>
<br> +-behaviour(cowboy_loop_handler).<br>-export([init/3, info/3, terminate/3]).<br>-define(HEARBEAT_TIMEOUT, 20*1000).<br>-record(status, {count=0}).<br><br>init(_Any, Req, State) -><br>������� NowCount = count_server:welcome(),<br>
<br> +������� io:format("online user ~p :))~n", [NowCount]),<br><br>������� output_first(Req),<br>������� Req2 = cowboy_req:compact(Req),<br>������� {loop, Req2, State, hibernate}.<br><br>%% POST/Short Request<br>info(_Any, Req, State) -><br>
<br> +������� {loop, Req, State, hibernate}.<br><br>output_first(Req) -><br>������� {ok, Reply} = cowboy_req:chunked_reply(200, [{<<"Content-Type">>, <<"text/html; charset=utf-8">>},<br>
<br> +���������������������������������������������������������������� {<<"Connection">>, <<"keep-alive">>}], Req),<br>������� cowboy_req:chunk(<<"<html><body><script>var _ = function (msg) { parent.s._(msg, document); };</script>����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ">>,<br>
<br> +��������������������������������������������������������������� Reply),<br>������� cowboy_req:chunk(gen_output("1::"), Reply).<br><br>gen_output(String) -><br>������� DescList = io_lib:format("<script>_('~s');</script>", [String]),<br>
<br> +������� list_to_binary(DescList).<br><br>terminate(Reason, _Req, _State) -><br>������� NowCount = count_server:bye(),<br>������� io:format("offline user ~p :(( ~n", [NowCount]).<br><br><br><br></div>
<br> + +</tt> diff --git a/archives/extend/attachments/20130426/b1e8ae7a/attachment.html b/archives/extend/attachments/20130426/b1e8ae7a/attachment.html new file mode 100644 index 00000000..74c43a61 --- /dev/null +++ b/archives/extend/attachments/20130426/b1e8ae7a/attachment.html @@ -0,0 +1,27 @@ +<tt> +Is 13.6K/connection considered a lot? Once you start doing SSL, each connection will be about 80K, IMHO the most important factor for huge ammount of COMET users is latency, which Cowboy and Erlang do great.<div><br></div><br> +<div>-rambocoder<br><br><div class="gmail_quote">On Fri, Apr 26, 2013 at 2:11 AM, yongboy <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<div dir="ltr"><div><div>I have tested one long-hold webapp, when 512000 user connected, the app used <br></div>6801M memory, 6801M*1024K / 512000 = 13.6K/Connection.<br><br></div><div>Does anyone give me some advice on how to reduce the memory usage per one connection, thanks very much !<br><br> +<br> +</div><div><br></div>Here is the code snippet:<br><br>start(_Type, _Args) -><br>������� Dispatch = cowboy_router:compile([<br>����������� {'_', [{'_', htmlfile_handler, []}]}<br>������� ]),<br>������� cowboy:start_http(my_http_listener, 100,<br><br> +<br> +����������� [{port, 8000}, {max_connections, infinity}],<br>����������� [{env, [{dispatch, Dispatch}]}]<br>������� ),<br>������� count_server:start(),<br>������� htmlfilesimple_sup:start_link().<br><br>......<br><br>-module(htmlfile_handler).<br><br> +<br> +-behaviour(cowboy_loop_handler).<br>-export([init/3, info/3, terminate/3]).<br>-define(HEARBEAT_TIMEOUT, 20*1000).<br>-record(status, {count=0}).<br><br>init(_Any, Req, State) -><br>������� NowCount = count_server:welcome(),<br><br> +<br> +������� io:format("online user ~p :))~n", [NowCount]),<br><br>������� output_first(Req),<br>������� Req2 = cowboy_req:compact(Req),<br>������� {loop, Req2, State, hibernate}.<br><br>%% POST/Short Request<br>info(_Any, Req, State) -><br><br> +<br> +������� {loop, Req, State, hibernate}.<br><br>output_first(Req) -><br>������� {ok, Reply} = cowboy_req:chunked_reply(200, [{<<"Content-Type">>, <<"text/html; charset=utf-8">>},<br><br> +<br> +���������������������������������������������������������������� {<<"Connection">>, <<"keep-alive">>}], Req),<br>������� cowboy_req:chunk(<<"<html><body><script>var _ = function (msg) { parent.s._(msg, document); };</script>����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ">>,<br><br> +<br> +��������������������������������������������������������������� Reply),<br>������� cowboy_req:chunk(gen_output("1::"), Reply).<br><br>gen_output(String) -><br>������� DescList = io_lib:format("<script>_('~s');</script>", [String]),<br><br> +<br> +������� list_to_binary(DescList).<br><br>terminate(Reason, _Req, _State) -><br>������� NowCount = count_server:bye(),<br>������� io:format("offline user ~p :(( ~n", [NowCount]).<br><br><br><br></div><br> +<br>_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br><br> +<br></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130430/c86f8fdb/attachment.html b/archives/extend/attachments/20130430/c86f8fdb/attachment.html new file mode 100644 index 00000000..792f4a4d --- /dev/null +++ b/archives/extend/attachments/20130430/c86f8fdb/attachment.html @@ -0,0 +1,8 @@ +<tt> +<div dir="ltr">Hi,<br>I'm new to the community and am exploring cowboy for a project.<div><br></div><div>Can anyone offer guidance/links on how to use cowboy's websocket support with WAMP (<a href="http://wamp.ws/">http://wamp.ws/</a>)?</div><br> +<div>The cowboy docs mention�<a href="https://github.com/extend/bullet?source=cr">bullet</a>�as a convenient client/server lib (with an AJAX fallback) which is great, but I'd like to use WAMP's RPC and PubSub so I'm unsure how to proceed.<br clear="all"><br> +<div><br></div><div style>Any tips would be appreciated!</div><div style><br></div><div style>Thanks in advance</div>-- <br><div dir="ltr">Gregory | <a href="http://twitter.com/gdesouza" target="_blank">@gdesouza</a> | <a href="http://blog.gdesouza.me" target="_blank">http://blog.gdesouza.me</a></div><br> +<br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130512/65929751/attachment.html b/archives/extend/attachments/20130512/65929751/attachment.html new file mode 100644 index 00000000..645b5681 --- /dev/null +++ b/archives/extend/attachments/20130512/65929751/attachment.html @@ -0,0 +1,44 @@ +<tt> +<div dir="ltr">Ok, thx, I missed that one :)</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/12 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It sets a set-cookie header directly. You can retrieve all response headers by calling something like cowboy_req:get(resp_headers, Req).<div><br> +<br> +<div class="h5"><br><br> +<br><br> +On 05/12/2013 01:42 PM, Enrique Paz wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hi,<br><br> +<br><br> +I have a piece of code that receives a cowboy_req:http_req() object and<br><br> +depending on some Context sets 1 or more cookies<br><br> +using cowboy_req:set_resp_cookie/4.<br><br> +<br><br> +add_cookies(Req, Context) -> ReqWithCookiesSet<br><br> +<br><br> +I want to write a unit test for it, checking that the right cookies are<br><br> +set for the right Context. How can I do that? I miss something like<br><br> +cowboy_req:get_resp_cookie/2 or so.<br><br> +<br><br> +Thx in advance for your help.<br><br> +<br><br> +--<br><br> +Enrique<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>quique<br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20130512/dd43116e/attachment.html b/archives/extend/attachments/20130512/dd43116e/attachment.html new file mode 100644 index 00000000..8f34c4e0 --- /dev/null +++ b/archives/extend/attachments/20130512/dd43116e/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr">Hi,<div><br></div><div>I have a piece of code that receives a cowboy_req:http_req() object and depending on some Context sets 1 or more cookies using�cowboy_req:set_resp_cookie/4.�</div><div><br></div><div style><br> +<br> +add_cookies(Req, Context) -> ReqWithCookiesSet</div><div><br></div><div>I want to write a unit test for it, checking that the right cookies are set for the right Context. �How can I do that? I miss something like cowboy_req:get_resp_cookie/2 or so.�</div><br> +<br> +<div style><br></div><div style>Thx in advance for your help.</div><div><div><br></div>-- <br>Enrique<br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130517/629071b8/attachment.html b/archives/extend/attachments/20130517/629071b8/attachment.html new file mode 100644 index 00000000..5eb70a36 --- /dev/null +++ b/archives/extend/attachments/20130517/629071b8/attachment.html @@ -0,0 +1,19 @@ +<tt> +<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi all,�</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I am learning cowboy by building a small application with rest interface.�</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +I have a hello_world rest handler and I want to implement POST method that returns �</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">json as response to a client. Therefor I implemented �callbacks allowed_methods,�</div><br> +<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">content_types_accepted and hello_json. The docu says user callbacks can�</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +return {Value, Req, State} and also can return {halt, Req, State}. It is not really clear�</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">what that Value should be. So I tried {ok, Req, State} and {true, Req, State} and with</div><br> +<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">both values I have�</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div>=ERROR REPORT==== 11-May-2013::16:06:40 ===</div><div>Error in process <0.6649.0> with exit value: {function_clause,[{cowboy_req,reply,[303,....</div><br> +</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +and client gets right response. If I use {halt, Req, State} the client gets right response too</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">and there is no errors. So, Is it right way to write a POST callback and what Values can</div><br> +<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">be used for user callbacks? I write my code below.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">amike,�</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +Vitali</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br> +<div>allowed_methods(Req, State) -></div><div><span style="white-space:pre-wrap"> </span>{[<<"POST">>, <<"DELETE">>], Req, State}.</div><div><br></div><div>content_types_accepted(Req, State) -></div><br> +<div><span style="white-space:pre-wrap"> </span>{[</div><div><span style="white-space:pre-wrap"> </span>�� �{{<<"application">>, <<"x-www-form-urlencoded">>, []}, hello_json}</div><br> +<div><span style="white-space:pre-wrap"> </span>�],�Req, State}.</div><div><br></div><div>hello_json(Req, State) -></div><div><span style="white-space:pre-wrap"> </span>{ok, Req2} = cowboy_req:reply(200, [{<<"content-type">>, <<"application/json">>} ], <<"{\"rest\": \"Hello World!\"}">>, Req),</div><br> +<div><span style="white-space:pre-wrap"> </span>{halt, Req2, State}.</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130519/db7f08ab/attachment.html b/archives/extend/attachments/20130519/db7f08ab/attachment.html new file mode 100644 index 00000000..e4c7ef10 --- /dev/null +++ b/archives/extend/attachments/20130519/db7f08ab/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">I want to write a cowboy middleware that works only on non-websocket requests. How can I achieve this? Is there any way that I ask the Request if this is a websocket request?<br><br>Thank you<br clear="all"><br> +<div><br>-- <br><div dir="ltr">Eduardo<br></div><br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130520/3cc045e8/attachment.html b/archives/extend/attachments/20130520/3cc045e8/attachment.html new file mode 100644 index 00000000..bbb81bf6 --- /dev/null +++ b/archives/extend/attachments/20130520/3cc045e8/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 19, 2013 at 10:01 PM, Eduardo Gurgel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I want to write a cowboy middleware that works only on non-websocket requests. How can I achieve this? Is there any way that I ask the Request if this is a websocket request?<br><br> +<br></div></blockquote><div><br></div><div style>Thinking about my question, I see that the middleware (if it's behind the cowboy_handler) can't figure if the connection will be upgraded or not.�</div><div style><br><br> +</div><div style>Still, it would be cool if I could select which routes will be applied to my middleware.�</div><div style><br></div><div style>Am I making any sense? :)</div></div><div><br></div>-- <br><div dir="ltr">Eduardo<br><br> +</div><br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130520/5134ba32/attachment.html b/archives/extend/attachments/20130520/5134ba32/attachment.html new file mode 100644 index 00000000..93278610 --- /dev/null +++ b/archives/extend/attachments/20130520/5134ba32/attachment.html @@ -0,0 +1,29 @@ +<tt> +<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 20, 2013 at 10:25 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 05/20/2013 01:53 PM, Eduardo Gurgel wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +<br><br> +<br><br> +<br><br> +On Sun, May 19, 2013 at 10:01 PM, Eduardo Gurgel <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class="im"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> +� � I want to write a cowboy middleware that works only on non-websocket<br><br> +� � requests. How can I achieve this? Is there any way that I ask the<br><br> +� � Request if this is a websocket request?<br><br> +<br><br> +<br><br> +Thinking about my question, I see that the middleware (if it's behind<br><br> +the cowboy_handler) can't figure if the connection will be upgraded or not.<br><br> +<br><br> +Still, it would be cool if I could select which routes will be applied<br><br> +to my middleware.<br><br> +</div></blockquote><br> +<br><br> +You have the Req which can help you do things based on host or path, and you also have the environment, which contains the name of the handler that's gonna be used if you execute your middleware after cowboy_router.<span class="HOEnZb"><font color="#888888"><br><br> +<br> +<br></font></span></blockquote><div><br></div><div style>Perfect! The environment can help me :)</div><div><br></div><div><br></div><div style>Thank you, again!</div></div><div><br></div>-- <br><div dir="ltr">Eduardo<br><br> +</div><br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130605/568478c8/attachment.html b/archives/extend/attachments/20130605/568478c8/attachment.html new file mode 100644 index 00000000..d5a5f32c --- /dev/null +++ b/archives/extend/attachments/20130605/568478c8/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr">Hi,<div><br></div><div>I'm trying to implement REST handler which communicates to custom gen_servers.</div><div><br></div><div>Get gen_server from supervisor and link to current handler process:�</div><div><br> +<br></div><div><div>rest_init(Req, _Opts) -></div><div>...</div><div><div>� process_flag(trap_exit, true),</div></div><div>� {ok, Pid} = pbshare_logic_sup:start_registration(),<br></div><div>� link(Pid),</div></div><div><br> +...</div><div><br></div><div><div>make_get(Req, State) -></div></div><div>....</div><div>make error here !!!</div><div>....</div><div><br></div><div><br></div><div>And gen_server code:</div><div><div>start_link() -></div><br> +<div>� gen_server:start_link(?MODULE, [], []).</div><div><br></div><div>init(Args) -></div><div>� process_flag(trap_exit, true),<br></div><div>� {ok, []}.</div></div><div><br></div><div><div>handle_info({'EXIT', FromPid, Reason}, State) -></div><br> +<div>� lager:info("Exit Logic from ~p �Reason: ~p~n", [FromPid, Reason]),</div><div>� {noreply, State};</div></div><div><br></div><div>So I expect to receive EXIT signal from REST handler to my gen_server when error occurs in cowboy.</div><br> +<div>But I don't receive it. Am I doing something wrong?�<br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130718/79e075b8/attachment.html b/archives/extend/attachments/20130718/79e075b8/attachment.html new file mode 100644 index 00000000..a9b30f22 --- /dev/null +++ b/archives/extend/attachments/20130718/79e075b8/attachment.html @@ -0,0 +1,21 @@ +<tt> +<br> + <div><br> + <span style="font-size: 12px;">That would be perfect! Do you want me to make the change and issue a pull request?</span><br> + </div><br> + <div><div><br></div><div>-- </div><div>Dr Adrian Roe</div><div>Director<br></div><div><br></div></div><br> + <br> + <p style="color: #A0A0A8;">On Thursday, 18 July 2013 at 11:36, Loïc Hoguin wrote:</p><br> + <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><br> + <span><div><div><div>I don't think the problem is that the handler is reused, we don't reuse </div><div>them if there's an error. However we do catch errors to print them in </div><div>the logs, and then the process stops normally. If you link without </div><div>trap_exit you receive a normal exit signal which is ignored and doesn't </div><div>kill your process. I suppose we should throw an exit signal when we got </div><div>an error, after logging everything, instead of stopping normally.</div><div><br></div><div>On 07/18/2013 12:31 PM, Adrian Roe wrote:</div><blockquote type="cite"><div><div>My issue is the other way round. My handler crashes - and terminate</div><div>gets called, but the linked process is NOT stopped (unless I stop it in</div><div>terminate having stashed any processes I need to stop in the process</div><div>dictionary - this is what I'm currently doing, but yuck!)</div><div><br></div><div>. My question is whether it wouldn't be better to no re-use the handler</div><div>process that has crashed and replace it so that handler's can use the</div><div>canonical erlang way of stopping related processes rather than having to</div><div>do it by hand.</div><div><br></div><div>Obviously if the handler does not crash there's no need to kill the</div><div>process, so the current efficiency saving works in the "normal" case/</div><div><br></div><div>--</div><div>Dr Adrian Roe</div><div>Director</div><div><br></div><div>On Thursday, 18 July 2013 at 11:20, Loïc Hoguin wrote:</div><div><br></div><blockquote type="cite"><div><div>I don't know what happens but there's two things I know:</div><div><br></div><div>* Handlers don't trap_exit, so if the linked process crashes, they</div><div>crash too</div><div>* If the handler crashes, we close the connection and stop the</div><div>handler; if not this is a bug</div><div><br></div><div>After your log message the handler should stop unless there's a bug</div><div>somewhere.</div><div><br></div><div>On 07/18/2013 12:15 PM, Adrian Roe wrote:</div><blockquote type="cite"><div><div>We have been using spawn_linked workers to handle tasks that live for</div><div>the lifetime of a single HTTP request</div><div><br></div><div>Although in the cowboy guide it is clear that Cowboy can use "One</div><div>Process of Many Requests" I am surprised that this is the case even if</div><div>the handler crashes. For example, our use case is to copy a large file</div><div>to the server over HTTP where a worker process relays the file contents</div><div>to long term storage. The worker process is spawn_linked from the HTTP</div><div>handler and (for our use case) should die if the handler stops.</div><div><br></div><div>If the client stops the upload (for example by browsing away, or losing</div><div>connectivity) we correctly receive an error (see sample Lager trace</div><div>below), but what we are seeing is that spawn_linked processes are NOT</div><div>being killed.</div><div><br></div><div>Is this intended behaviour - I accept it makes sense to reuse the</div><div>processes but should this continue to be the case even if the previous</div><div>use of the process crashed? If it is intended behaviour I think the</div><div>docs should highlight this as we've been leaking processes for some time</div><div>now, but I've always seen it as erlang's job to look after related</div><div>process trees in the event of error. Our current workaround is to hold</div><div>a list of linked processes in process storage and then kill them in the</div><div>terminate handler which is ugly in the extreme!! We don't know the PIDS</div><div>of the linked processes until it is too late to return State to Cowboy</div><div>(i.e. we are already in our handle code)...</div><div><br></div><div>Kind regards</div><div><br></div><div>Adrian</div><div><br></div><div>16:09:32.347 [info] Trailer upload failed with reason</div><div>{case_clause,{error,closed}}</div><div>16:09:32.348 [error] ** Cowboy handler upload_trailer_resource</div><div>terminating in handle/2</div><div>for the reason error:{case_clause,{error,closed}}</div><div>** Handler state was {state,undefined,0,undefined,undefined,undefined}</div><div>** Request was</div><div>[{socket,#Port<0.11230>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.1987.0>},{method,<<"POST">>},{version,'HTTP/1.1'},{peer,{{84,92,32,116},64136}},{host,<<"54.225.117.108">>},{host_info,undefined},{port,8000},{path,<<"/upload_trailer">>},{path_info,undef</div><div>ined},{qs,<<"name=linux-7.4.21.zip&size=54015414">>},{qs_vals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"54.225.117.108:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"content-length">>,<<"54015414">>},{<<"origin">>,<<"<a href="http://54.225.117.108:8000">http://54.225.117.108:8000</a>">>},{<<"user-agent">>,<<"M</div><div>ozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML,</div><div>like Gecko) Chrome/28.0.1500.71</div><div>Safari/537.36">>},{<<"content-type">>,<<>>},{<<"accept">>,<<"*/*">>},{<<"referer">>,<<"<a href="http://54.225.117.108:8000">http://54.225.117.108:8000</a>/">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"acce</div><div>pt-language">>,<<"en-US,en;q=0.8">>},{<<"cookie">>,<<"__jwpusr=cbc133d7-1b49-443c-8a13-364660cc93e5;</div><div>id3as_manager=f4803c004d71dde3b64394f6e6f44faa54970e93">>}]},{p_headers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,unde</div><div>fined},{buffer,<<>>},{resp_compress,true},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]</div><div>** Stacktrace:</div><div>[{i_cowboy,stream_body,0,[{file,"src/i_cowboy.erl"},{line,76}]},{upload_trailer_resource,stream_upload_file,4,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,247}]},{upload_trailer_resource,upload_file,1,[{file,"src/endpoints/upload_trailer_resource.erl"}</div><div>,{line,237}]},{upload_trailer_resource,head_or_post,1,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,202}]},{upload_trailer_resource,sequence,2,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,106}]},{upload_trailer_resource,process_request,1,[{file,"src/endpo</div><div>ints/upload_trailer_resource.erl"},{line,212}]},{i_cowboy,do,3,[{file,"src/i_cowboy.erl"},{line,29}]},{cowboy_handler,handler_handle,4,[{file,"src/cowboy_handler.erl"},{line,119}]}]</div><div><br></div><div><br></div><div>--</div><div>Dr Adrian Roe</div><div>Director</div><div><br></div><div><br></div><div><br></div><div>_______________________________________________</div><div>Extend mailing list</div><div>[email protected] <<a href="mailto:[email protected]">mailto:[email protected]</a>></div><div><a href="http://lists.ninenines.eu:81/listinfo/extend">http://lists.ninenines.eu:81/listinfo/extend</a></div></div></blockquote><div><br></div><div><br></div><div>--</div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div></div></blockquote></div></blockquote><div><br></div><div><br></div><div>-- </div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div></div></div></span><br> + <br> + <br> + <br> + <br> + </blockquote><br> + <br> + <div><br> + <br><br> + </div><br> + +</tt> diff --git a/archives/extend/attachments/20130718/a3961a6f/attachment.html b/archives/extend/attachments/20130718/a3961a6f/attachment.html new file mode 100644 index 00000000..ed6b2dc1 --- /dev/null +++ b/archives/extend/attachments/20130718/a3961a6f/attachment.html @@ -0,0 +1,21 @@ +<tt> +<br> + <div><br> + <span style="font-size: 12px;">I suspect it's just a case of adding a throw to error_terminate in cowboy_protocol, maybe with threading the reason back (though I don't really care what's thrown), but also fear there may be unintended consequences as all I've done is skim your code briefly! If you are able to look at it then great - if not I'll muddle through. I'm travelling so it would be mid next week at the earliest anyway.</span><br> + </div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Cheers</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Adrian</span></div><br> + <div><div><br></div><div>-- </div><div>Dr Adrian Roe</div><div>Director<br></div><div><br></div></div><br> + <br> + <p style="color: #A0A0A8;">On Thursday, 18 July 2013 at 11:38, Loïc Hoguin wrote:</p><br> + <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><br> + <span><div><div><div>If you got time sure, I won't have much time until Monday. Have fun!</div><div><br></div><div>On 07/18/2013 12:37 PM, Adrian Roe wrote:</div><blockquote type="cite"><div><div>That would be perfect! Do you want me to make the change and issue a</div><div>pull request?</div><div><br></div><div>--</div><div>Dr Adrian Roe</div><div>Director</div><div><br></div><div>On Thursday, 18 July 2013 at 11:36, Loïc Hoguin wrote:</div><div><br></div><blockquote type="cite"><div><div>I don't think the problem is that the handler is reused, we don't reuse</div><div>them if there's an error. However we do catch errors to print them in</div><div>the logs, and then the process stops normally. If you link without</div><div>trap_exit you receive a normal exit signal which is ignored and doesn't</div><div>kill your process. I suppose we should throw an exit signal when we got</div><div>an error, after logging everything, instead of stopping normally.</div><div><br></div><div>On 07/18/2013 12:31 PM, Adrian Roe wrote:</div><blockquote type="cite"><div><div>My issue is the other way round. My handler crashes - and terminate</div><div>gets called, but the linked process is NOT stopped (unless I stop it in</div><div>terminate having stashed any processes I need to stop in the process</div><div>dictionary - this is what I'm currently doing, but yuck!)</div><div><br></div><div>. My question is whether it wouldn't be better to no re-use the handler</div><div>process that has crashed and replace it so that handler's can use the</div><div>canonical erlang way of stopping related processes rather than having to</div><div>do it by hand.</div><div><br></div><div>Obviously if the handler does not crash there's no need to kill the</div><div>process, so the current efficiency saving works in the "normal" case/</div><div><br></div><div>--</div><div>Dr Adrian Roe</div><div>Director</div><div><br></div><div>On Thursday, 18 July 2013 at 11:20, Loïc Hoguin wrote:</div><div><br></div><blockquote type="cite"><div><div>I don't know what happens but there's two things I know:</div><div><br></div><div>* Handlers don't trap_exit, so if the linked process crashes, they</div><div>crash too</div><div>* If the handler crashes, we close the connection and stop the</div><div>handler; if not this is a bug</div><div><br></div><div>After your log message the handler should stop unless there's a bug</div><div>somewhere.</div><div><br></div><div>On 07/18/2013 12:15 PM, Adrian Roe wrote:</div><blockquote type="cite"><div><div>We have been using spawn_linked workers to handle tasks that live for</div><div>the lifetime of a single HTTP request</div><div><br></div><div>Although in the cowboy guide it is clear that Cowboy can use "One</div><div>Process of Many Requests" I am surprised that this is the case even if</div><div>the handler crashes. For example, our use case is to copy a large file</div><div>to the server over HTTP where a worker process relays the file contents</div><div>to long term storage. The worker process is spawn_linked from the HTTP</div><div>handler and (for our use case) should die if the handler stops.</div><div><br></div><div>If the client stops the upload (for example by browsing away, or losing</div><div>connectivity) we correctly receive an error (see sample Lager trace</div><div>below), but what we are seeing is that spawn_linked processes are NOT</div><div>being killed.</div><div><br></div><div>Is this intended behaviour - I accept it makes sense to reuse the</div><div>processes but should this continue to be the case even if the previous</div><div>use of the process crashed? If it is intended behaviour I think the</div><div>docs should highlight this as we've been leaking processes for some</div><div>time</div><div>now, but I've always seen it as erlang's job to look after related</div><div>process trees in the event of error. Our current workaround is to hold</div><div>a list of linked processes in process storage and then kill them in the</div><div>terminate handler which is ugly in the extreme!! We don't know the PIDS</div><div>of the linked processes until it is too late to return State to Cowboy</div><div>(i.e. we are already in our handle code)...</div><div><br></div><div>Kind regards</div><div><br></div><div>Adrian</div><div><br></div><div>16:09:32.347 [info] Trailer upload failed with reason</div><div>{case_clause,{error,closed}}</div><div>16:09:32.348 [error] ** Cowboy handler upload_trailer_resource</div><div>terminating in handle/2</div><div>for the reason error:{case_clause,{error,closed}}</div><div>** Handler state was {state,undefined,0,undefined,undefined,undefined}</div><div>** Request was</div><div>[{socket,#Port<0.11230>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.1987.0>},{method,<<"POST">>},{version,'HTTP/1.1'},{peer,{{84,92,32,116},64136}},{host,<<"54.225.117.108">>},{host_info,undefined},{port,8000},{path,<<"/upload_trailer">>},{path_info,undef</div><div>ined},{qs,<<"name=linux-7.4.21.zip&size=54015414">>},{qs_vals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"54.225.117.108:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"content-length">>,<<"54015414">>},{<<"origin">>,<<"<a href="http://54.225.117.108:8000">http://54.225.117.108:8000</a>">>},{<<"user-agent">>,<<"M</div><div>ozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36</div><div>(KHTML,</div><div>like Gecko) Chrome/28.0.1500.71</div><div>Safari/537.36">>},{<<"content-type">>,<<>>},{<<"accept">>,<<"*/*">>},{<<"referer">>,<<"<a href="http://54.225.117.108:8000">http://54.225.117.108:8000</a>/">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"acce</div><div>pt-language">>,<<"en-US,en;q=0.8">>},{<<"cookie">>,<<"__jwpusr=cbc133d7-1b49-443c-8a13-364660cc93e5;</div><div>id3as_manager=f4803c004d71dde3b64394f6e6f44faa54970e93">>}]},{p_headers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,unde</div><div>fined},{buffer,<<>>},{resp_compress,true},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]</div><div>** Stacktrace:</div><div>[{i_cowboy,stream_body,0,[{file,"src/i_cowboy.erl"},{line,76}]},{upload_trailer_resource,stream_upload_file,4,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,247}]},{upload_trailer_resource,upload_file,1,[{file,"src/endpoints/upload_trailer_resource.erl"}</div><div>,{line,237}]},{upload_trailer_resource,head_or_post,1,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,202}]},{upload_trailer_resource,sequence,2,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,106}]},{upload_trailer_resource,process_request,1,[{file,"src/endpo</div><div>ints/upload_trailer_resource.erl"},{line,212}]},{i_cowboy,do,3,[{file,"src/i_cowboy.erl"},{line,29}]},{cowboy_handler,handler_handle,4,[{file,"src/cowboy_handler.erl"},{line,119}]}]</div><div><br></div><div><br></div><div>--</div><div>Dr Adrian Roe</div><div>Director</div><div><br></div><div><br></div><div><br></div><div>_______________________________________________</div><div>Extend mailing list</div><div>[email protected] <<a href="mailto:[email protected]">mailto:[email protected]</a>></div><div><a href="http://lists.ninenines.eu:81/listinfo/extend">http://lists.ninenines.eu:81/listinfo/extend</a></div></div></blockquote><div><br></div><div><br></div><div>--</div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div></div></blockquote></div></blockquote><div><br></div><div><br></div><div>--</div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div></div></blockquote></div></blockquote><div><br></div><div><br></div><div>-- </div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div></div></div></span><br> + <br> + <br> + <br> + <br> + </blockquote><br> + <br> + <div><br> + <br><br> + </div><br> + +</tt> diff --git a/archives/extend/attachments/20130718/c50bef17/attachment.html b/archives/extend/attachments/20130718/c50bef17/attachment.html new file mode 100644 index 00000000..cf4bec2f --- /dev/null +++ b/archives/extend/attachments/20130718/c50bef17/attachment.html @@ -0,0 +1,21 @@ +<tt> +<br> + <div><br> + <span style="font-size: 12px;">My issue is the other way round. My handler crashes - and terminate gets called, but the linked process is NOT stopped (unless I stop it in terminate having stashed any processes I need to stop in the process dictionary - this is what I'm currently doing, but yuck!)</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">. My question is whether it wouldn't be better to no re-use the handler process that has crashed and replace it so that handler's can use the canonical erlang way of stopping related processes rather than having to do it by hand. </span><br> + </div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Obviously if the handler does not crash there's no need to kill the process, so the current efficiency saving works in the "normal" case/</span></div><br> + <div><div><br></div><div>-- </div><div>Dr Adrian Roe</div><div>Director<br></div><div><br></div></div><br> + <br> + <p style="color: #A0A0A8;">On Thursday, 18 July 2013 at 11:20, Loïc Hoguin wrote:</p><br> + <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><br> + <span><div><div><div>I don't know what happens but there's two things I know:</div><div><br></div><div> * Handlers don't trap_exit, so if the linked process crashes, they </div><div>crash too</div><div> * If the handler crashes, we close the connection and stop the </div><div>handler; if not this is a bug</div><div><br></div><div>After your log message the handler should stop unless there's a bug </div><div>somewhere.</div><div><br></div><div>On 07/18/2013 12:15 PM, Adrian Roe wrote:</div><blockquote type="cite"><div><div>We have been using spawn_linked workers to handle tasks that live for</div><div>the lifetime of a single HTTP request</div><div><br></div><div>Although in the cowboy guide it is clear that Cowboy can use "One</div><div>Process of Many Requests" I am surprised that this is the case even if</div><div>the handler crashes. For example, our use case is to copy a large file</div><div>to the server over HTTP where a worker process relays the file contents</div><div>to long term storage. The worker process is spawn_linked from the HTTP</div><div>handler and (for our use case) should die if the handler stops.</div><div><br></div><div>If the client stops the upload (for example by browsing away, or losing</div><div>connectivity) we correctly receive an error (see sample Lager trace</div><div>below), but what we are seeing is that spawn_linked processes are NOT</div><div>being killed.</div><div><br></div><div>Is this intended behaviour - I accept it makes sense to reuse the</div><div>processes but should this continue to be the case even if the previous</div><div>use of the process crashed? If it is intended behaviour I think the</div><div>docs should highlight this as we've been leaking processes for some time</div><div>now, but I've always seen it as erlang's job to look after related</div><div>process trees in the event of error. Our current workaround is to hold</div><div>a list of linked processes in process storage and then kill them in the</div><div>terminate handler which is ugly in the extreme!! We don't know the PIDS</div><div>of the linked processes until it is too late to return State to Cowboy</div><div>(i.e. we are already in our handle code)...</div><div><br></div><div>Kind regards</div><div><br></div><div>Adrian</div><div><br></div><div>16:09:32.347 [info] Trailer upload failed with reason</div><div>{case_clause,{error,closed}}</div><div>16:09:32.348 [error] ** Cowboy handler upload_trailer_resource</div><div>terminating in handle/2</div><div> for the reason error:{case_clause,{error,closed}}</div><div>** Handler state was {state,undefined,0,undefined,undefined,undefined}</div><div>** Request was</div><div>[{socket,#Port<0.11230>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.1987.0>},{method,<<"POST">>},{version,'HTTP/1.1'},{peer,{{84,92,32,116},64136}},{host,<<"54.225.117.108">>},{host_info,undefined},{port,8000},{path,<<"/upload_trailer">>},{path_info,undef</div><div>ined},{qs,<<"name=linux-7.4.21.zip&size=54015414">>},{qs_vals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"54.225.117.108:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"content-length">>,<<"54015414">>},{<<"origin">>,<<"<a href="http://54.225.117.108:8000">http://54.225.117.108:8000</a>">>},{<<"user-agent">>,<<"M</div><div>ozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML,</div><div>like Gecko) Chrome/28.0.1500.71</div><div>Safari/537.36">>},{<<"content-type">>,<<>>},{<<"accept">>,<<"*/*">>},{<<"referer">>,<<"<a href="http://54.225.117.108:8000">http://54.225.117.108:8000</a>/">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"acce</div><div>pt-language">>,<<"en-US,en;q=0.8">>},{<<"cookie">>,<<"__jwpusr=cbc133d7-1b49-443c-8a13-364660cc93e5;</div><div>id3as_manager=f4803c004d71dde3b64394f6e6f44faa54970e93">>}]},{p_headers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,unde</div><div>fined},{buffer,<<>>},{resp_compress,true},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]</div><div>** Stacktrace:</div><div>[{i_cowboy,stream_body,0,[{file,"src/i_cowboy.erl"},{line,76}]},{upload_trailer_resource,stream_upload_file,4,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,247}]},{upload_trailer_resource,upload_file,1,[{file,"src/endpoints/upload_trailer_resource.erl"}</div><div>,{line,237}]},{upload_trailer_resource,head_or_post,1,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,202}]},{upload_trailer_resource,sequence,2,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,106}]},{upload_trailer_resource,process_request,1,[{file,"src/endpo</div><div>ints/upload_trailer_resource.erl"},{line,212}]},{i_cowboy,do,3,[{file,"src/i_cowboy.erl"},{line,29}]},{cowboy_handler,handler_handle,4,[{file,"src/cowboy_handler.erl"},{line,119}]}]</div><div><br></div><div><br></div><div>--</div><div>Dr Adrian Roe</div><div>Director</div><div><br></div><div><br></div><div><br></div><div>_______________________________________________</div><div>Extend mailing list</div><div><a href="mailto:[email protected]">[email protected]</a></div><div><a href="http://lists.ninenines.eu:81/listinfo/extend">http://lists.ninenines.eu:81/listinfo/extend</a></div></div></blockquote><div><br></div><div><br></div><div>-- </div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div></div></div></span><br> + <br> + <br> + <br> + <br> + </blockquote><br> + <br> + <div><br> + <br><br> + </div><br> + +</tt> diff --git a/archives/extend/attachments/20130718/d65f1aaf/attachment.html b/archives/extend/attachments/20130718/d65f1aaf/attachment.html new file mode 100644 index 00000000..d6b4ddfa --- /dev/null +++ b/archives/extend/attachments/20130718/d65f1aaf/attachment.html @@ -0,0 +1,8 @@ +<tt> +<br> + <div><br> + <div><span style="font-size: 12px;">We have been using spawn_linked workers to handle tasks that live for the lifetime of a single HTTP request</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Although in the cowboy guide it is clear that Cowboy can use "One Process of Many Requests" I am surprised that this is the case even if the handler crashes. For example, our use case is to copy a large file to the server over HTTP where a worker process relays the file contents to long term storage. The worker process is spawn_linked from the HTTP handler and (for our use case) should die if the handler stops.</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">If the client stops the upload (for example by browsing away, or losing connectivity) we correctly receive an error (see sample Lager trace below), but what we are seeing is that spawn_linked processes are NOT being killed.</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Is this intended behaviour - I accept it makes sense to reuse the processes but should this continue to be the case even if the previous use of the process crashed? If it is intended behaviour I think the docs should highlight this as we've been leaking processes for some time now, but I've always seen it as erlang's job to look after related process trees in the event of error. Our current workaround is to hold a list of linked processes in process storage and then kill them in the terminate handler which is ugly in the extreme!! We don't know the PIDS of the linked processes until it is too late to return State to Cowboy (i.e. we are already in our handle code)...</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Kind regards</span></div><div><span style="font-size: 12px;"><br></span></div><div><span style="font-size: 12px;">Adrian</span></div><div><br></div><div>16:09:32.347 [info] Trailer upload failed with reason {case_clause,{error,closed}}</div><div>16:09:32.348 [error] ** Cowboy handler upload_trailer_resource terminating in handle/2</div><div> for the reason error:{case_clause,{error,closed}}</div><div>** Handler state was {state,undefined,0,undefined,undefined,undefined}</div><div>** Request was [{socket,#Port<0.11230>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.1987.0>},{method,<<"POST">>},{version,'HTTP/1.1'},{peer,{{84,92,32,116},64136}},{host,<<"54.225.117.108">>},{host_info,undefined},{port,8000},{path,<<"/upload_trailer">>},{path_info,undef</div><div>ined},{qs,<<"name=linux-7.4.21.zip&size=54015414">>},{qs_vals,undefined},{bindings,[]},{headers,[{<<"host">>,<<"54.225.117.108:8000">>},{<<"connection">>,<<"keep-alive">>},{<<"content-length">>,<<"54015414">>},{<<"origin">>,<<"http://54.225.117.108:8000">>},{<<"user-agent">>,<<"M</div><div>ozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36">>},{<<"content-type">>,<<>>},{<<"accept">>,<<"*/*">>},{<<"referer">>,<<"http://54.225.117.108:8000/">>},{<<"accept-encoding">>,<<"gzip,deflate,sdch">>},{<<"acce</div><div>pt-language">>,<<"en-US,en;q=0.8">>},{<<"cookie">>,<<"__jwpusr=cbc133d7-1b49-443c-8a13-364660cc93e5; id3as_manager=f4803c004d71dde3b64394f6e6f44faa54970e93">>}]},{p_headers,[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{multipart,unde</div><div>fined},{buffer,<<>>},{resp_compress,true},{resp_state,waiting},{resp_headers,[]},{resp_body,<<>>},{onresponse,undefined}]</div><div>** Stacktrace: [{i_cowboy,stream_body,0,[{file,"src/i_cowboy.erl"},{line,76}]},{upload_trailer_resource,stream_upload_file,4,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,247}]},{upload_trailer_resource,upload_file,1,[{file,"src/endpoints/upload_trailer_resource.erl"}</div><div>,{line,237}]},{upload_trailer_resource,head_or_post,1,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,202}]},{upload_trailer_resource,sequence,2,[{file,"src/endpoints/upload_trailer_resource.erl"},{line,106}]},{upload_trailer_resource,process_request,1,[{file,"src/endpo</div><div>ints/upload_trailer_resource.erl"},{line,212}]},{i_cowboy,do,3,[{file,"src/i_cowboy.erl"},{line,29}]},{cowboy_handler,handler_handle,4,[{file,"src/cowboy_handler.erl"},{line,119}]}]</div><div><br></div><br> + </div><br> + <div><div><br></div><div>-- </div><div>Dr Adrian Roe</div><div>Director<br></div><div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130723/3e51c337/attachment.html b/archives/extend/attachments/20130723/3e51c337/attachment.html new file mode 100644 index 00000000..d60fe073 --- /dev/null +++ b/archives/extend/attachments/20130723/3e51c337/attachment.html @@ -0,0 +1,6 @@ +<tt> +What's the best way to skip is_authorized callback for OPTIONS methods? For all my rest handlers?<div><br></div><div>Thanks in advance for any help you are able to provide.<br clear="all"><div><br></div>-- <br><div dir="ltr"><br> +Eduardo<br></div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20130802/4f7baee0/attachment.html b/archives/extend/attachments/20130802/4f7baee0/attachment.html new file mode 100644 index 00000000..b37ab6d1 --- /dev/null +++ b/archives/extend/attachments/20130802/4f7baee0/attachment.html @@ -0,0 +1,12 @@ +<tt> +Forgot to reply to all<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Eduardo Gurgel</b> <span dir="ltr"><<a href="mailto:[email protected]">[email protected]</a>></span><br><br> +Date: Fri, Aug 2, 2013 at 4:57 PM<br>Subject: Re: [99s-extend] Mailing lists<br>To: Jeremy Ong <<a href="mailto:[email protected]">[email protected]</a>><br><br><br><br><br><div class="gmail_quote"><div class="im"><br> +On Fri, Aug 2, 2013 at 4:33 PM, Jeremy Ong <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<br> +Florent, I suggest you actually contribute something before telling<br><br> +the project maintainer how to run things and flaming people who *have*<br><br> +contributed.<br></blockquote><div><br></div></div><div>Agreed.</div><div>�</div><div>Too much pointing finger on this thread...</div></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div dir="ltr">Eduardo<br><br> +</div><br> +</font></span></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130805/9fd5783b/attachment.html b/archives/extend/attachments/20130805/9fd5783b/attachment.html new file mode 100644 index 00000000..81109940 --- /dev/null +++ b/archives/extend/attachments/20130805/9fd5783b/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">></span><span style="font-family:arial,sans-serif;font-size:13px">You can think it's not a problem, but I</span><span style="font-family:arial,sans-serif;font-size:13px">think it is. Is that a flame ?</span><span style="font-family:arial,sans-serif;font-size:13px"><br><br> +This is a flame:<br>> Haha, what a joke. It's a pity you don't understand that.<br></span><br>I for one, prefer Postgres. Not everything can be mapped to kv and that's the only thing Riak is good for. It's not fit for a general purpose database.<br><br> +To me, NoSQL is about specialization. Each db excels at one type of operation (and then there's mongo, but that's for another time), while RDBMSs offer general purpose solutions. I begin my projects with an RDBMS (usually Postgres) and when a particular piece of data is the bottleneck, I move it to the appropriate NoSQL db.</div><br> + +</tt> diff --git a/archives/extend/attachments/20130816/1c70f542/attachment.html b/archives/extend/attachments/20130816/1c70f542/attachment.html new file mode 100644 index 00000000..a3f4959d --- /dev/null +++ b/archives/extend/attachments/20130816/1c70f542/attachment.html @@ -0,0 +1,22 @@ +<tt> +<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 15, 2013 at 4:19 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":fq" style="overflow:hidden">I would like to make an official announcement of <a href="http://erlang.mk" target="_blank">erlang.mk</a> now that all the features I wanted are in.</div><br> +<br> +</blockquote></div><br>I have been using <a href="http://erlang.mk">erlang.mk</a> for a while now, and recently I converted etorrent to use it as a test of the viability in larger projects. Typical gotchas:</div><div class="gmail_extra"><br> +<br> +<br></div><div class="gmail_extra">* Projects has no Makefile. <a href="http://erlang.mk">erlang.mk</a> needs one. So add one!</div><div class="gmail_extra">* No `modules` section in the .app file. <a href="http://erlang.mk">erlang.mk</a> needs one to replace it. Not adding this makes relx behave badly.</div><br> +<br> +<div class="gmail_extra">* If you use relx, it is more strict in what it accepts.</div><div class="gmail_extra">* Relx can't yet overlay sys.config :/</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br> +Apart from that, <a href="http://erlang.mk">erlang.mk</a> is a bliss to work with. In one project I am working with:</div><br> +<div class="gmail_extra"><br></div><div class="gmail_extra">Core i5 2.4Ghz approx 2010 Macbook Pro, encrypted disk (this hurts performance like mad):</div><div class="gmail_extra"><br></div><div class="gmail_extra">Cold build:</div><br> +<br> +<div class="gmail_extra"><br></div><div class="gmail_extra">Rebar: 40 secs</div><div class="gmail_extra"><a href="http://elrang.mk">elrang.mk</a>: 42 secs</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br> +Build where each file is compiled in advance:</div><br> +<div class="gmail_extra"><br></div><div class="gmail_extra">Rebar: 20 secs</div><div class="gmail_extra"><a href="http://erlang.mk">erlang.mk</a>: 0.4 secs</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br> +<br> +For my development cycle, this is important enough to spend time rewriting projects to use <a href="http://erlang.mk">erlang.mk</a>. Also note that rebar.config and <a href="http://erlang.mk">erlang.mk</a> can co-exist, so you don't need to abandon rebar for <a href="http://erlang.mk">erlang.mk</a>, which is important.</div><br> +<br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20130816/1cd82d09/attachment.html b/archives/extend/attachments/20130816/1cd82d09/attachment.html new file mode 100644 index 00000000..3d637f54 --- /dev/null +++ b/archives/extend/attachments/20130816/1cd82d09/attachment.html @@ -0,0 +1,21 @@ +<tt> +<br> + <div><br> + Was guessing that was the answer - I'll give it a go...<br> + </div><br> + <div><div><br></div><div>-- </div><div>Steve Strong</div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a></div><div><br></div></div><br> + <br> + <p style="color: #A0A0A8;">On Friday, 16 August 2013 at 16:42, Loïc Hoguin wrote:</p><br> + <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><br> + <span><div><div><div>Well I'm sure if you create a base Makefile (without erlang.mk) that </div><div>exports DEPS_DIR and then call $(MAKE) on all folders in /apps (which </div><div>would themselves contain Makefiles that use erlang.mk), it would work </div><div>just fine. You can still keep only one erlang.mk in your repos and use </div><div>include ../../erlang.mk instead for example.</div><div><br></div><div>But know that this folder structure is a rebar thing and not standard </div><div>(just like /deps you'll say, but that one is insanely useful regardless </div><div>of the project structure otherwise).</div><div><br></div><div>On 08/16/2013 02:27 PM, Steve Strong wrote:</div><blockquote type="cite"><div><div>Looks good - I like simple! Quick question, does it support multiple</div><div>applications, for example a project laid out as:</div><div><br></div><div>/proj</div><div>/deps</div><div>/stuff</div><div><br></div><div>/apps</div><div>/app1</div><div>/app2</div><div><br></div><div>Most of our stuff is in that form, with shared dependencies between the</div><div>various apps. Rebar is quite happy with that format, but I can't see</div><div>how to persuade erlang.mk to handle that.</div><div><br></div><div>Cheers,</div><div><br></div><div>Steve</div><div><br></div><div>--</div><div>Steve Strong</div><div>Sent with Sparrow <<a href="http://www.sparrowmailapp.com/?sig">http://www.sparrowmailapp.com/?sig</a>></div><div><br></div><div>On Thursday, 15 August 2013 at 16:19, Loïc Hoguin wrote:</div><div><br></div><blockquote type="cite"><div><div>Hello friendly people,</div><div><br></div><div>I would like to make an official announcement of erlang.mk now that all</div><div>the features I wanted are in.</div><div><br></div><div>erlang.mk is a rebar replacement. It was initially created for allowing</div><div>a faster development process than rebar and for better compatibility</div><div>with Linux build tools. It should work on Linux and OSX with GNU Make</div><div>installed.</div><div><br></div><div>Projects using erlang.mk are still compatible with rebar. Dependencies</div><div>fetched by rebar are stored in the same deps/ directory, and projects</div><div>using erlang.mk can still be used as rebar dependencies, with or without</div><div>a rebar.config file.</div><div><br></div><div>erlang.mk also features a simple package index. Try `make pkg-list` to</div><div>list all packages currently available. All the packages listed are</div><div>compatible with erlang.mk with no tweaking required.</div><div><br></div><div>Makefiles written with erlang.mk are *VERY* simple, here are two examples:</div><div><br></div><div>* <a href="https://github.com/extend/farwest/blob/master/Makefile">https://github.com/extend/farwest/blob/master/Makefile</a></div><div>* <a href="https://github.com/extend/cowboy/blob/master/Makefile">https://github.com/extend/cowboy/blob/master/Makefile</a></div><div><br></div><div>I wrote about erlang.mk and relx recently on the Nine Nines blog.</div><div>erlang.mk is the perfect companion to relx.</div><div><br></div><div>* <a href="http://ninenines.eu/articles/erlang.mk-and-relx">http://ninenines.eu/articles/erlang.mk-and-relx</a></div><div><br></div><div>Here are examples of projects that are using and compatible with</div><div>erlang.mk:</div><div><br></div><div>* <a href="https://github.com/jlouis/etorrent">https://github.com/jlouis/etorrent</a></div><div>* <a href="https://github.com/extend/cowboy">https://github.com/extend/cowboy</a></div><div>* <a href="https://github.com/extend/farwest">https://github.com/extend/farwest</a></div><div><br></div><div>You can find erlang.mk at the following URL:</div><div><br></div><div>* <a href="https://github.com/extend/erlang.mk">https://github.com/extend/erlang.mk</a></div><div><br></div><div>Contributions to the package index are of course welcome! The only</div><div>requirement is that the package is to be compatible with erlang.mk</div><div>itself. Just send a PR to the erlang.mk project updating the</div><div>packages.v1.txt!</div><div><br></div><div>Enjoy!</div><div><br></div><div>--</div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div><div>_______________________________________________</div><div>erlang-questions mailing list</div><div>[email protected] <<a href="mailto:[email protected]">mailto:[email protected]</a>></div><div><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></div></div></blockquote></div></blockquote><div><br></div><div><br></div><div>-- </div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div></div></div></span><br> + <br> + <br> + <br> + <br> + </blockquote><br> + <br> + <div><br> + <br><br> + </div><br> + +</tt> diff --git a/archives/extend/attachments/20130816/4e596577/attachment.html b/archives/extend/attachments/20130816/4e596577/attachment.html new file mode 100644 index 00000000..1577f65e --- /dev/null +++ b/archives/extend/attachments/20130816/4e596577/attachment.html @@ -0,0 +1,218 @@ +<tt> +<html><br> + <head><br> + <meta content="text/html; charset=ISO-8859-1"<br> + http-equiv="Content-Type"><br> + </head><br> + <body text="#000000" bgcolor="#FFFFFF"><br> + <div class="moz-cite-prefix">Why not use Erlang for downloading?<br> + Surely if erlang.mk is a tool for Erlang then it will be very<br> + likely installed. For example this target downloads Rebar:<br><br> + <br><br> + <pre style="font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="line" id="LC5" style="padding-left: 10px;"># Erlang Rebar downloading, see:</div><div class="line" id="LC6" style="padding-left: 10px;"># <a class="moz-txt-link-freetext" href="https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/U0JJ3SeUv5Y">https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/U0JJ3SeUv5Y</a></div><div class="line" id="LC7" style="padding-left: 10px;">rb_rebar_url=<a class="moz-txt-link-freetext" href="http://cloud.github.com/downloads/basho/rebar/rebar">http://cloud.github.com/downloads/basho/rebar/rebar</a></div><div cl<br> +ass="line" id="LC8" style="padding-left: 10px;"><br> +</div><div class="line" id="LC9" style="padding-left: 10px;">./rebar:</div><div class="line" id="LC10" style="padding-left: 10px;"> $(ERL) -noshell -s inets -s ssl \</div><div class="line" id="LC11" style="padding-left: 10px;"> -eval 'httpc:request(get, {"$(rb_rebar_url)", []}, [], [{stream, "./rebar"}])' \</div><div class="line" id="LC12" style="padding-left: 10px;"> -s init stop</div><div class="line" id="LC13" style="padding-left: 10px;"> chmod +x ./rebar</div><div class="line" id="LC14" style="padding-left: 10px;"><br> +</div><div class="line" id="LC15" style="padding-left: 10px;">REBAR=$(shell (type rebar 2>/dev/null || echo ./rebar) | tail -1 | awk '{ print $$NF }')</div></pre><br> + <br><br> + It could be used to download anything, not just REBAR.<br><br> + <br><br> + - Greg<br><br> + <br><br> + <br><br> + On 16/08/2013 15:34, Loïc Hoguin wrote:<br><br> + </div><br> + <blockquote cite="mid:[email protected]" type="cite">On<br> + 08/16/2013 10:39 AM, Benoit Chesneau wrote:<br> + <br><br> + <blockquote type="cite">The big problem with erlang.mk<br> + <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> is requiring to have<br> + <br><br> + gmake and more importantly wget installed imo.<br> + <br><br> + </blockquote><br> + <br><br> + wget is only used for fetching the package index file. I'm sure if<br> + it doesn't work somewhere it'll be patched eventually.<br> + <br><br> + <br><br> + <blockquote type="cite">Which makes it quite annoying to<br> + distribute on systems that have none of<br> + <br><br> + them. It would be interrestin to have the support for curl for<br> + example.<br> + <br><br> + Also what are the makefile extensions that you really need to<br> + require gmake?<br> + <br><br> + </blockquote><br> + <br><br> + No idea. Patches are welcome for compatibility with different<br> + OS/build tools (as long as it's not "rewrite the whole file" of<br> + course, then you're better off just using gmake).<br> + <br><br> + <br><br> + <blockquote type="cite">- benoit<br> + <br><br> + <br><br> + <br><br> + On Thu, Aug 15, 2013 at 4:19 PM, Loïc Hoguin<br> + <<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a><br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><mailto:[email protected]></a>> wrote:<br> + <br><br> + <br><br> + Hello friendly people,<br> + <br><br> + <br><br> + I would like to make an official announcement of erlang.mk<br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> now that all the features I wanted<br> + are in.<br> + <br><br> + <br><br> + erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> is a rebar replacement.<br> + It was<br> + <br><br> + initially created for allowing a faster development process<br> + than<br> + <br><br> + rebar and for better compatibility with Linux build tools.<br> + It should<br> + <br><br> + work on Linux and OSX with GNU Make installed.<br> + <br><br> + <br><br> + Projects using erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> are still<br> + compatible<br> + <br><br> + with rebar. Dependencies fetched by rebar are stored in the<br> + same<br> + <br><br> + deps/ directory, and projects using erlang.mk<br> + <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> can<br> + <br><br> + still be used as rebar dependencies, with or without a<br> + rebar.config<br> + <br><br> + file.<br> + <br><br> + <br><br> + erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> also features a simple<br> + package index.<br> + <br><br> + Try `make pkg-list` to list all packages currently<br> + available. All<br> + <br><br> + the packages listed are compatible with erlang.mk<br> + <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a><br> + <br><br> + with no tweaking required.<br> + <br><br> + <br><br> + Makefiles written with erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a><br> + are *VERY*<br> + <br><br> + simple, here are two examples:<br> + <br><br> + <br><br> + * <a class="moz-txt-link-freetext" href="https://github.com/extend/__farwest/blob/master/Makefile">https://github.com/extend/__farwest/blob/master/Makefile</a><br> + <br><br> + <br> + <a class="moz-txt-link-rfc2396E" href="https://github.com/extend/farwest/blob/master/Makefile"><https://github.com/extend/farwest/blob/master/Makefile></a><br> + <br><br> + * <a class="moz-txt-link-freetext" href="https://github.com/extend/__cowboy/blob/master/Makefile">https://github.com/extend/__cowboy/blob/master/Makefile</a><br> + <br><br> + <br> + <a class="moz-txt-link-rfc2396E" href="https://github.com/extend/cowboy/blob/master/Makefile"><https://github.com/extend/cowboy/blob/master/Makefile></a><br> + <br><br> + <br><br> + I wrote about erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> and relx<br> + recently on the<br> + <br><br> + Nine Nines blog. erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> is the<br> + perfect<br> + <br><br> + companion to relx.<br> + <br><br> + <br><br> + * <a class="moz-txt-link-freetext" href="http://ninenines.eu/articles/__erlang.mk-and-relx">http://ninenines.eu/articles/__erlang.mk-and-relx</a><br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="http://ninenines.eu/articles/erlang.mk-and-relx"><http://ninenines.eu/articles/erlang.mk-and-relx></a><br> + <br><br> + <br><br> + Here are examples of projects that are using and compatible<br> + with<br> + <br><br> + erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a>:<br> + <br><br> + <br><br> + * <a class="moz-txt-link-freetext" href="https://github.com/jlouis/__etorrent">https://github.com/jlouis/__etorrent</a><br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="https://github.com/jlouis/etorrent"><https://github.com/jlouis/etorrent></a><br> + <br><br> + * <a class="moz-txt-link-freetext" href="https://github.com/extend/__cowboy">https://github.com/extend/__cowboy</a><br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="https://github.com/extend/cowboy"><https://github.com/extend/cowboy></a><br> + <br><br> + * <a class="moz-txt-link-freetext" href="https://github.com/extend/__farwest">https://github.com/extend/__farwest</a><br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="https://github.com/extend/farwest"><https://github.com/extend/farwest></a><br> + <br><br> + <br><br> + You can find erlang.mk <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> at the<br> + following URL:<br> + <br><br> + <br><br> + * <a class="moz-txt-link-freetext" href="https://github.com/extend/__erlang.mk">https://github.com/extend/__erlang.mk</a><br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="https://github.com/extend/erlang.mk"><https://github.com/extend/erlang.mk></a><br> + <br><br> + <br><br> + Contributions to the package index are of course welcome!<br> + The only<br> + <br><br> + requirement is that the package is to be compatible with<br> + erlang.mk<br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> itself. Just send a PR to the<br> + erlang.mk<br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="http://erlang.mk"><http://erlang.mk></a> project updating the<br> + packages.v1.txt!<br> + <br><br> + <br><br> + Enjoy!<br> + <br><br> + <br><br> + --<br> + <br><br> + Loïc Hoguin<br> + <br><br> + Erlang Cowboy<br> + <br><br> + Nine Nines<br> + <br><br> + <a class="moz-txt-link-freetext" href="http://ninenines.eu">http://ninenines.eu</a><br> + <br><br> + _________________________________________________<br> + <br><br> + erlang-questions mailing list<br> + <br><br> + <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a><br> + <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><mailto:[email protected]></a><br> + <br><br> + <a class="moz-txt-link-freetext" href="http://erlang.org/mailman/__listinfo/erlang-questions">http://erlang.org/mailman/__listinfo/erlang-questions</a><br> + <br><br> + <a class="moz-txt-link-rfc2396E" href="http://erlang.org/mailman/listinfo/erlang-questions"><http://erlang.org/mailman/listinfo/erlang-questions></a><br> + <br><br> + <br><br> + <br><br> + </blockquote><br> + <br><br> + <br><br> + </blockquote><br> + <br><br> + </body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130816/8f4a69b4/attachment.html b/archives/extend/attachments/20130816/8f4a69b4/attachment.html new file mode 100644 index 00000000..e776ff95 --- /dev/null +++ b/archives/extend/attachments/20130816/8f4a69b4/attachment.html @@ -0,0 +1,77 @@ +<tt> +<div dir="ltr"><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">I believe</span></div><span class="" style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre"><span style="font-weight:normal">curl -L</span><span style="font-weight:normal"> </span><span class="">$(</span><span style="font-weight:normal">PKG_FILE_URL</span><span class="">)</span></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre"> ></span><span class="" style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;font-weight:bold;line-height:18px;white-space:pre">$(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">PKG_FILE</span><span class="" style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;font-weight:bold;line-height:18px;white-space:pre">)<br><br> +<br> +</span><div>is kinda drop-in replacement for</div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">wget -O </span><span class="" style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">$(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">PKG_FILE</span><span class="" style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">)</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre"> </span><span class="" style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">$(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">PKG_FILE_URL</span><span class="" style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre">)</span><br><br> +<br> +</div><div>used in <a href="http://erlang.mk">erlang.mk</a>.</div><div><br></div><div>Should be tested</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 16, 2013 at 12:39 PM, Benoit Chesneau <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The big problem with <a href="http://erlang.mk" target="_blank">erlang.mk</a> is requiring to have gmake and more importantly wget installed imo.�<div><br> +<br> +<br></div><div>Which makes it quite annoying to distribute on systems that have none of them. It would be interrestin to have the support for curl for example. Also what are the makefile extensions that you really need to require gmake?<span class="HOEnZb"><font color="#888888"><div><br> +<br> +<br> +<br></div><div>- benoit</div></font></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Thu, Aug 15, 2013 at 4:19 PM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<br> +</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello friendly people,<br><br> +<br><br> +I would like to make an official announcement of <a href="http://erlang.mk" target="_blank">erlang.mk</a> now that all the features I wanted are in.<br><br> +<br><br> +<a href="http://erlang.mk" target="_blank">erlang.mk</a> is a rebar replacement. It was initially created for allowing a faster development process than rebar and for better compatibility with Linux build tools. It should work on Linux and OSX with GNU Make installed.<br><br> +<br> +<br> +<br> +<br><br> +Projects using <a href="http://erlang.mk" target="_blank">erlang.mk</a> are still compatible with rebar. Dependencies fetched by rebar are stored in the same deps/ directory, and projects using <a href="http://erlang.mk" target="_blank">erlang.mk</a> can still be used as rebar dependencies, with or without a rebar.config file.<br><br> +<br> +<br> +<br> +<br><br> +<a href="http://erlang.mk" target="_blank">erlang.mk</a> also features a simple package index. Try `make pkg-list` to list all packages currently available. All the packages listed are compatible with <a href="http://erlang.mk" target="_blank">erlang.mk</a> with no tweaking required.<br><br> +<br> +<br> +<br> +<br><br> +Makefiles written with <a href="http://erlang.mk" target="_blank">erlang.mk</a> are *VERY* simple, here are two examples:<br><br> +<br><br> +�* �<a href="https://github.com/extend/farwest/blob/master/Makefile" target="_blank">https://github.com/extend/<u></u>farwest/blob/master/Makefile</a><br><br> +�* �<a href="https://github.com/extend/cowboy/blob/master/Makefile" target="_blank">https://github.com/extend/<u></u>cowboy/blob/master/Makefile</a><br><br> +<br><br> +I wrote about <a href="http://erlang.mk" target="_blank">erlang.mk</a> and relx recently on the Nine Nines blog. <a href="http://erlang.mk" target="_blank">erlang.mk</a> is the perfect companion to relx.<br><br> +<br><br> +�* �<a href="http://ninenines.eu/articles/erlang.mk-and-relx" target="_blank">http://ninenines.eu/articles/<u></u>erlang.mk-and-relx</a><br><br> +<br><br> +Here are examples of projects that are using and compatible with <a href="http://erlang.mk" target="_blank">erlang.mk</a>:<br><br> +<br><br> +�* �<a href="https://github.com/jlouis/etorrent" target="_blank">https://github.com/jlouis/<u></u>etorrent</a><br><br> +�* �<a href="https://github.com/extend/cowboy" target="_blank">https://github.com/extend/<u></u>cowboy</a><br><br> +�* �<a href="https://github.com/extend/farwest" target="_blank">https://github.com/extend/<u></u>farwest</a><br><br> +<br><br> +You can find <a href="http://erlang.mk" target="_blank">erlang.mk</a> at the following URL:<br><br> +<br><br> +�* �<a href="https://github.com/extend/erlang.mk" target="_blank">https://github.com/extend/<u></u>erlang.mk</a><br><br> +<br><br> +Contributions to the package index are of course welcome! The only requirement is that the package is to be compatible with <a href="http://erlang.mk" target="_blank">erlang.mk</a> itself. Just send a PR to the <a href="http://erlang.mk" target="_blank">erlang.mk</a> project updating the packages.v1.txt!<br><br> +<br> +<br> +<br> +<br><br> +Enjoy!<span><font color="#888888"><br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</font></span></blockquote></div></div></div><br></div><br> +<br>_______________________________________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br> +<br></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130816/a886396a/attachment.html b/archives/extend/attachments/20130816/a886396a/attachment.html new file mode 100644 index 00000000..276b6812 --- /dev/null +++ b/archives/extend/attachments/20130816/a886396a/attachment.html @@ -0,0 +1,21 @@ +<tt> +<br> + <div><br> + Looks good - I like simple! Quick question, does it support multiple applications, for example a project laid out as:<br> + </div><div><br></div><div>/proj</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>/deps</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>/stuff</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>/apps</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>/app1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>/app2</div><div><br></div><div>Most of our stuff is in that form, with shared dependencies between the various apps. Rebar is quite happy with that format, but I can't see how to persuade erlang.mk to handle that.</div><div><br></div><div>Cheers,</div><div><br></div><div>Steve</div><br> + <div><div><br></div><div>-- </div><div>Steve Strong</div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a></div><div><br></div></div><br> + <br> + <p style="color: #A0A0A8;">On Thursday, 15 August 2013 at 16:19, Loïc Hoguin wrote:</p><br> + <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><br> + <span><div><div><div>Hello friendly people,</div><div><br></div><div>I would like to make an official announcement of erlang.mk now that all </div><div>the features I wanted are in.</div><div><br></div><div>erlang.mk is a rebar replacement. It was initially created for allowing </div><div>a faster development process than rebar and for better compatibility </div><div>with Linux build tools. It should work on Linux and OSX with GNU Make </div><div>installed.</div><div><br></div><div>Projects using erlang.mk are still compatible with rebar. Dependencies </div><div>fetched by rebar are stored in the same deps/ directory, and projects </div><div>using erlang.mk can still be used as rebar dependencies, with or without </div><div>a rebar.config file.</div><div><br></div><div>erlang.mk also features a simple package index. Try `make pkg-list` to </div><div>list all packages currently available. All the packages listed are </div><div>compatible with erlang.mk with no tweaking required.</div><div><br></div><div>Makefiles written with erlang.mk are *VERY* simple, here are two examples:</div><div><br></div><div> * <a href="https://github.com/extend/farwest/blob/master/Makefile">https://github.com/extend/farwest/blob/master/Makefile</a></div><div> * <a href="https://github.com/extend/cowboy/blob/master/Makefile">https://github.com/extend/cowboy/blob/master/Makefile</a></div><div><br></div><div>I wrote about erlang.mk and relx recently on the Nine Nines blog. </div><div>erlang.mk is the perfect companion to relx.</div><div><br></div><div> * <a href="http://ninenines.eu/articles/erlang.mk-and-relx">http://ninenines.eu/articles/erlang.mk-and-relx</a></div><div><br></div><div>Here are examples of projects that are using and compatible with erlang.mk:</div><div><br></div><div> * <a href="https://github.com/jlouis/etorrent">https://github.com/jlouis/etorrent</a></div><div> * <a href="https://github.com/extend/cowboy">https://github.com/extend/cowboy</a></div><div> * <a href="https://github.com/extend/farwest">https://github.com/extend/farwest</a></div><div><br></div><div>You can find erlang.mk at the following URL:</div><div><br></div><div> * <a href="https://github.com/extend/erlang.mk">https://github.com/extend/erlang.mk</a></div><div><br></div><div>Contributions to the package index are of course welcome! The only </div><div>requirement is that the package is to be compatible with erlang.mk </div><div>itself. Just send a PR to the erlang.mk project updating the </div><div>packages.v1.txt!</div><div><br></div><div>Enjoy!</div><div><br></div><div>-- </div><div>Loïc Hoguin</div><div>Erlang Cowboy</div><div>Nine Nines</div><div><a href="http://ninenines.eu">http://ninenines.eu</a></div><div>_______________________________________________</div><div>erlang-questions mailing list</div><div><a href="mailto:[email protected]">[email protected]</a></div><div><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></div></div></div></span><br> + <br> + <br> + <br> + <br> + </blockquote><br> + <br> + <div><br> + <br><br> + </div><br> + +</tt> diff --git a/archives/extend/attachments/20130816/ff4591a1/attachment.html b/archives/extend/attachments/20130816/ff4591a1/attachment.html new file mode 100644 index 00000000..d4518dcb --- /dev/null +++ b/archives/extend/attachments/20130816/ff4591a1/attachment.html @@ -0,0 +1,52 @@ +<tt> +<div dir="ltr">The big problem with <a href="http://erlang.mk">erlang.mk</a> is requiring to have gmake and more importantly wget installed imo.�<div><br></div><div>Which makes it quite annoying to distribute on systems that have none of them. It would be interrestin to have the support for curl for example. Also what are the makefile extensions that you really need to require gmake?<div><br> +<br></div><div>- benoit</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 15, 2013 at 4:19 PM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello friendly people,<br><br> +<br><br> +I would like to make an official announcement of <a href="http://erlang.mk" target="_blank">erlang.mk</a> now that all the features I wanted are in.<br><br> +<br><br> +<a href="http://erlang.mk" target="_blank">erlang.mk</a> is a rebar replacement. It was initially created for allowing a faster development process than rebar and for better compatibility with Linux build tools. It should work on Linux and OSX with GNU Make installed.<br><br> +<br> +<br><br> +Projects using <a href="http://erlang.mk" target="_blank">erlang.mk</a> are still compatible with rebar. Dependencies fetched by rebar are stored in the same deps/ directory, and projects using <a href="http://erlang.mk" target="_blank">erlang.mk</a> can still be used as rebar dependencies, with or without a rebar.config file.<br><br> +<br> +<br><br> +<a href="http://erlang.mk" target="_blank">erlang.mk</a> also features a simple package index. Try `make pkg-list` to list all packages currently available. All the packages listed are compatible with <a href="http://erlang.mk" target="_blank">erlang.mk</a> with no tweaking required.<br><br> +<br> +<br><br> +Makefiles written with <a href="http://erlang.mk" target="_blank">erlang.mk</a> are *VERY* simple, here are two examples:<br><br> +<br><br> +�* �<a href="https://github.com/extend/farwest/blob/master/Makefile" target="_blank">https://github.com/extend/<u></u>farwest/blob/master/Makefile</a><br><br> +�* �<a href="https://github.com/extend/cowboy/blob/master/Makefile" target="_blank">https://github.com/extend/<u></u>cowboy/blob/master/Makefile</a><br><br> +<br><br> +I wrote about <a href="http://erlang.mk" target="_blank">erlang.mk</a> and relx recently on the Nine Nines blog. <a href="http://erlang.mk" target="_blank">erlang.mk</a> is the perfect companion to relx.<br><br> +<br><br> +�* �<a href="http://ninenines.eu/articles/erlang.mk-and-relx" target="_blank">http://ninenines.eu/articles/<u></u>erlang.mk-and-relx</a><br><br> +<br><br> +Here are examples of projects that are using and compatible with <a href="http://erlang.mk" target="_blank">erlang.mk</a>:<br><br> +<br><br> +�* �<a href="https://github.com/jlouis/etorrent" target="_blank">https://github.com/jlouis/<u></u>etorrent</a><br><br> +�* �<a href="https://github.com/extend/cowboy" target="_blank">https://github.com/extend/<u></u>cowboy</a><br><br> +�* �<a href="https://github.com/extend/farwest" target="_blank">https://github.com/extend/<u></u>farwest</a><br><br> +<br><br> +You can find <a href="http://erlang.mk" target="_blank">erlang.mk</a> at the following URL:<br><br> +<br><br> +�* �<a href="https://github.com/extend/erlang.mk" target="_blank">https://github.com/extend/<u></u>erlang.mk</a><br><br> +<br><br> +Contributions to the package index are of course welcome! The only requirement is that the package is to be compatible with <a href="http://erlang.mk" target="_blank">erlang.mk</a> itself. Just send a PR to the <a href="http://erlang.mk" target="_blank">erlang.mk</a> project updating the packages.v1.txt!<br><br> +<br> +<br><br> +Enjoy!<span class="HOEnZb"><font color="#888888"><br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130820/b203ebe2/attachment.html b/archives/extend/attachments/20130820/b203ebe2/attachment.html new file mode 100644 index 00000000..43c2369f --- /dev/null +++ b/archives/extend/attachments/20130820/b203ebe2/attachment.html @@ -0,0 +1,32 @@ +<tt> +<div dir="ltr">This is exactly the sort of thing gen_event is for. I would make each server process register a handler at startup using gen_event:add_sup_handler() and then have the handle_event callback simply relay the event to the server processes. Yes, gproc can do this, but why incur its extra features and overhead?<div class="gmail_extra"><br> +<br><br><div class="gmail_quote">On Sat, Aug 17, 2013 at 3:10 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<div class="im">On 08/17/2013 10:00 AM, Bin Wang wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi,<br><br> +<br><br> +I'm new to ranch. In my application, I need to send some message to<br><br> +all connections. So I'd like to know can I get all connections from<br><br> +ranch, so I could use Transport:send to send them, or I must manage<br><br> +all the created connections by myself? Or is there any other better<br><br> +way?<br><br> +</blockquote><br> +<br></div><br> +The best way to do that is on your end, using gproc properties. When the connection is accepted, register the process with the property and use the property to send messages to all processes. You don't need to unregister when the connection ends, gproc does that automatically.<br><br> +<br> +<br><br> +The hackish way to do that would be to call supervisor:which_children on the ranch_conns_sup supervisor of your listener, but that will slow down the accepting of new connections, so don't do this if you need high accept rates.<span class="HOEnZb"><font color="#888888"><br><br> +<br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a></font></span><div class="HOEnZb"><div class="h5"><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</div></div></blockquote></div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130915/c9a5340e/attachment.html b/archives/extend/attachments/20130915/c9a5340e/attachment.html new file mode 100644 index 00000000..da26eac3 --- /dev/null +++ b/archives/extend/attachments/20130915/c9a5340e/attachment.html @@ -0,0 +1,10 @@ +<tt> +<div dir="ltr">Hi,<div><br></div><div>I've started work on a project using Clojure, but I was wondering whether (and secretly hoping that) Erlang would be a better fit, so I've been load testing a few web server frameworks. I'm particularly interested in how the server can handle a large number of concurrent WebSocket connections, and the test I've been running is similar to Eric Moritz's [1].</div><br> +<div><br></div><div>I've setup a simple Cowboy 'echo' server running on an EC2 instance (m1.medium, as in Eric's test) which could comfortably handle 10k concurrent WebSocket requests (as in Eric's results), while echoing about 200 messages/second. The CPU usage of the VM at this point is about 99%, but the server continues to handle up to 40k concurrent connections with a consistent average response time (<30ms). Pushing the test beyond this number results in a spike in response times and lots of connection timeouts.</div><br> +<div><br></div><div>40k connections seems pretty good, but when comparing this to the same test against a couple of Clojure/JVM-based frameworks (specifically Aleph/Netty and http-kit) I find I can get higher numbers of concurrent connections with slightly better average response times (100k connections, <10ms response time) using much less CPU (~20%). In fact, memory seems to be the limiting factor.</div><br> +<div><br></div><div>So I have two questions:</div><div><br></div><div>1) Should I be concerned about the CPU usage in the Erlang/Cowboy test? I have limited experience with Erlang so far, but 100% CPU feels like a bad thing.</div><br> +<div><br></div><div>2) Is there any way to increase the performance of the cowboy server? Are there any Erlang VM parameters I can change? The fact that the Clojure/JVM tests (on the same machine) have managed to get to 100k connections suggests that the limitation isn't being imposed by the operating system (I've applied changes various changes to sysctl and ulimit).</div><br> +<div><br></div><div>(Perhaps an echo server isn't the best way to compare HTTP servers, but it feels like a good starting point.)</div><div><br></div><div>Thanks for any help.</div><div><br></div><div>[1]�<a href="https://github.com/ericmoritz/wsdemo/blob/results-v1/results.md">https://github.com/ericmoritz/wsdemo/blob/results-v1/results.md</a> - the GitHub repo actually contains code for an Aleph server, but results from this aren't included in the summary here.<br clear="all"><br> +<div><br></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130916/dedbf486/attachment.html b/archives/extend/attachments/20130916/dedbf486/attachment.html new file mode 100644 index 00000000..74676d52 --- /dev/null +++ b/archives/extend/attachments/20130916/dedbf486/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hello,<div><br></div><div>this is somewhat similar to what someone else has asked: <a href="http://lists.ninenines.eu:81/archives/extend/2013-August/000224.html">http://lists.ninenines.eu:81/archives/extend/2013-August/000224.html</a></div><br> +<div><br></div><div>I am new to cowboy, I have a process that runs alongside a cowboy server and this process needs to periodically send text to all http clients connected to the cowboy server. My goal is to have a streaming connection for each http client so that I could stream text to them from my process. how is this done?</div><br> +<div><br></div><div>Thanks!</div><div>Konstantin</div><div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130916/f55d10f5/attachment.html b/archives/extend/attachments/20130916/f55d10f5/attachment.html new file mode 100644 index 00000000..f2a6ab12 --- /dev/null +++ b/archives/extend/attachments/20130916/f55d10f5/attachment.html @@ -0,0 +1,29 @@ +<tt> +<div dir="ltr">thanks. Suppose my external process is registered and has a name, so I can discover it by name from my cowboy request handler. when my cowboy handler is invoked, can I just send the handler's process ID to the external process? the question is then how does the external process know that the http client has disconnected so that it can stop sending data to it.</div><br> +<div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/16 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<div class="HOEnZb"><div class="h5">On 09/16/2013 03:50 PM, akonsu wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello,<br><br> +<br><br> +this is somewhat similar to what someone else has asked:<br><br> +<a href="http://lists.ninenines.eu:81/archives/extend/2013-August/000224.html" target="_blank">http://lists.ninenines.eu:81/<u></u>archives/extend/2013-August/<u></u>000224.html</a><br><br> +<br><br> +I am new to cowboy, I have a process that runs alongside a cowboy server<br><br> +and this process needs to periodically send text to all http clients<br><br> +connected to the cowboy server. My goal is to have a streaming<br><br> +connection for each http client so that I could stream text to them from<br><br> +my process. how is this done?<br><br> +</blockquote><br> +<br></div></div><br> +Same answer really. You need some kind of process registry, like gproc properties for example, that will store all Pids and allow you to send a message to all of them.<br><br> +<br><br> +On init, register the process, and then handle the incoming message when it arrives.<span class="HOEnZb"><font color="#888888"><br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130919/0a4bcb6c/attachment.html b/archives/extend/attachments/20130919/0a4bcb6c/attachment.html new file mode 100644 index 00000000..74916ad3 --- /dev/null +++ b/archives/extend/attachments/20130919/0a4bcb6c/attachment.html @@ -0,0 +1,42 @@ +<tt> +<div dir="ltr">my http handler receives messages carrying json parts obtained from a twitter stream by a separate process. the twitter stream is the stream of all public tweets, (they call it "firehose") so there are a lot.</div><br> +<div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/19 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +How much is a lot of messages?<br><br> +<br><br> +Hibernating is a bit more expensive on the CPU but better for saving memory. It's generally fine to use except when you have a really busy system. Do note that it also means your responses will be slightly slower (though that is generally not noticeable).<div><br> +<div class="h5"><br><br> +<br><br> +On 09/19/2013 06:30 AM, akonsu wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hello,<br><br> +<br><br> +from the documentation:<br><br> +<br><br> +info(Info, Req, State) -> {ok, Req, State} | {loop, Req, State}| {loop,<br><br> +Req, State, hibernate}<br><br> +<br><br> +<br><br> +in case my handler receives a lot of messages, and they come very often,<br><br> +does a response of the latter form {loop, Req, State, hibernate} save<br><br> +anything? Can hibernating in this case actually hinder performance?<br><br> +<br><br> +thanks<br><br> +Konstantin<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130919/9614ef5e/attachment.html b/archives/extend/attachments/20130919/9614ef5e/attachment.html new file mode 100644 index 00000000..15f752b8 --- /dev/null +++ b/archives/extend/attachments/20130919/9614ef5e/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hello,<div><br></div><div>from the documentation:</div><div><br></div><div>info(Info, Req, State) -> {ok, Req, State} | {loop, Req, State}<span class="" style="white-space:pre"> </span>| {loop, Req, State, hibernate}<br><br> +</div><div><br></div><div><br></div><div>in case my handler receives a lot of messages, and they come very often, does a response of the latter form {loop, Req, State, hibernate} save anything? Can hibernating in this case actually hinder performance?</div><br> +<div><br></div><div>thanks</div><div>Konstantin</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130920/32352505/attachment.html b/archives/extend/attachments/20130920/32352505/attachment.html new file mode 100644 index 00000000..d2c317ee --- /dev/null +++ b/archives/extend/attachments/20130920/32352505/attachment.html @@ -0,0 +1,49 @@ +<tt> +<div dir="ltr">thanks!<div><br></div><div>how to implement timeout callback manually? if I had receive then I would just use timeout clause there, but with the handler I do not know...<br><div><br></div><div>I have doubts about validity of my question on the erlang list. I later realised that there is no problem receiving messages in my handler from my upstream process, I can do it fast enough and shove everything to the response. my real problem is to determine if the http client is reading fast enough from the response...</div><br> +</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/20 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Loop handlers close after a while regardless of what you send, it only checks what the client sends. The best way for you would be to disable that timeout and handle it manually.<br><br> +<br><br> +As for the second question, I'm still reading the thread on erlang-questions but I've seen some good ideas about timestamps so far.<div><div class="h5"><br><br> +<br><br> +On 09/20/2013 08:47 PM, akonsu wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hi,<br><br> +<br><br> +I am using loop handler and I stream from it:<br><br> +<br><br> +info({stream, Part}, Req, S) -><br><br> + ok = cowboy_req:chunk(Part, Req),<br><br> + {loop, Req, S, hibernate};<br><br> +<br><br> +I have two questions:<br><br> +<br><br> +1. on timeouts cowboy sends 204 No Content. In my case it is not the<br><br> +right response because I may have already sent some data. Is there a way<br><br> +to send a custom response?<br><br> +<br><br> +2. how to check if the client is too slow and is not reading the<br><br> +response stream fast enough? If this happens, then I need to disconnect.<br><br> +<br><br> +I can live without 1. but I need to figure out 2. Please help.<br><br> +<br><br> +thank you!<br><br> +Konstantin<br><br> +<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130920/4c005881/attachment.html b/archives/extend/attachments/20130920/4c005881/attachment.html new file mode 100644 index 00000000..ea5cc3a0 --- /dev/null +++ b/archives/extend/attachments/20130920/4c005881/attachment.html @@ -0,0 +1,85 @@ +<tt> +<div dir="ltr">Understand about chunks being synchronous. that helps me tremendously to understand how it works.<div><br></div><div>would you give me a sketchy example of how to use send_after in a loop handler? (sorry I am new to erlang)</div><br> +<div><br></div><div>Konstantin</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/20 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">chunk only returns when the client has received the chunk, so the timestamps solution should work.<br><br> +<br><br> +As for the timeout, you can simply use erlang:send_after or something like usual and the message will arrive in info/3.<div class="im"><br><br> +<br><br> +On 09/20/2013 08:54 PM, akonsu wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +thanks!<br><br> +<br><br> +how to implement timeout callback manually? if I had receive then I<br><br> +would just use timeout clause there, but with the handler I do not know...<br><br> +<br><br> +I have doubts about validity of my question on the erlang list. I later<br><br> +realised that there is no problem receiving messages in my handler from<br><br> +my upstream process, I can do it fast enough and shove everything to the<br><br> +response. my real problem is to determine if the http client is reading<br><br> +fast enough from the response...<br><br> +<br><br> +<br></div><br> +2013/9/20 Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>><div class="im"><br><br> +<br><br> + Loop handlers close after a while regardless of what you send, it<br><br> + only checks what the client sends. The best way for you would be to<br><br> + disable that timeout and handle it manually.<br><br> +<br><br> + As for the second question, I'm still reading the thread on<br><br> + erlang-questions but I've seen some good ideas about timestamps so far.<br><br> +<br><br> +<br><br> + On 09/20/2013 08:47 PM, akonsu wrote:<br><br> +<br><br> + Hi,<br><br> +<br><br> + I am using loop handler and I stream from it:<br><br> +<br><br> + info({stream, Part}, Req, S) -><br><br> + ok = cowboy_req:chunk(Part, Req),<br><br> + {loop, Req, S, hibernate};<br><br> +<br><br> + I have two questions:<br><br> +<br><br> + 1. on timeouts cowboy sends 204 No Content. In my case it is not the<br><br> + right response because I may have already sent some data. Is<br><br> + there a way<br><br> + to send a custom response?<br><br> +<br><br> + 2. how to check if the client is too slow and is not reading the<br><br> + response stream fast enough? If this happens, then I need to<br><br> + disconnect.<br><br> +<br><br> + I can live without 1. but I need to figure out 2. Please help.<br><br> +<br><br> + thank you!<br><br> + Konstantin<br><br> +<br><br> +<br><br> +<br></div><br> + ______________________________<u></u>___________________<br><br> + Extend mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">Extend@lists.<u></u>ninenines.eu</a>><br><br> + <a href="http://lists.ninenines.eu:81/__listinfo/extend" target="_blank">http://lists.ninenines.eu:81/_<u></u>_listinfo/extend</a><div class="im"><br><br> + <<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a>><br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + Loďc Hoguin<br><br> + Erlang Cowboy<br><br> + Nine Nines<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +</div></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loïc Hoguin</font></span><div class="HOEnZb"><div class="h5"><br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130920/6e3fa036/attachment.html b/archives/extend/attachments/20130920/6e3fa036/attachment.html new file mode 100644 index 00000000..0864dc86 --- /dev/null +++ b/archives/extend/attachments/20130920/6e3fa036/attachment.html @@ -0,0 +1,7 @@ +<tt> +<div dir="ltr">Hi,<div><br></div><div>I am using loop handler and I stream from it:<div><div><br></div><div>info({stream, Part}, Req, S) -></div><div> ok = cowboy_req:chunk(Part, Req),</div><div> {loop, Req, S, hibernate};</div><br> +</div><div><br></div><div>I have two questions:</div><div><br></div><div>1. on timeouts cowboy sends 204 No Content. In my case it is not the right response because I may have already sent some data. Is there a way to send a custom response?</div><br> +<div><br></div><div>2. how to check if the client is too slow and is not reading the response stream fast enough? If this happens, then I need to disconnect.</div><div><br></div><div>I can live without 1. but I need to figure out 2. Please help.</div><br> +<div><br></div><div>thank you!</div><div>Konstantin</div><div><br></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130922/6e925e9d/attachment.html b/archives/extend/attachments/20130922/6e925e9d/attachment.html new file mode 100644 index 00000000..1c14246d --- /dev/null +++ b/archives/extend/attachments/20130922/6e925e9d/attachment.html @@ -0,0 +1,12 @@ +<tt> +<div dir="ltr"><div><div><div><div><div><div><div><div>hi<br></div>Just starting out so I'm trying to run cowboy's helloworld<br></div>in cowboy/examples/hello_world, running make fails with:<br><br>===> Provider (rlx_prv_discover) failed with: {error,<br>
<br> +����������������������������������������������������� {rlx_app_discovery,<br>������������������������������������������������������ [{missing_beam_file,<br>�������������������������������������������������������� hipe,<br>
<br> +�������������������������������������������������������� <<"/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam">>},<br>������������������������������������������������������� {missing_beam_file,<br>�������������������������������������������������������� hipe,<br>
<br> +�������������������������������������������������������� <<"/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam">>}]}}<br><br></div>there is no hipe.beam in /usr/local/lib/erlang/lib/hipe-3.10.1/ebin/, it is in /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam.<br>
<br> +</div>I've tried passing the correct dir to relx using --lib-dir but I still get the same error.<br><br></div>Any ideas what's going wrong?<br><br></div>erl: Erlang R16B02 (erts-5.10.3)<br></div>relx: 0.0.0+build.275.refca03701<br>
<br> +</div>rebar: rebar 2.1.0-pre R16B02 20130922_191744 git 2.1.0-pre-46-g78fa8fc<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 22 September 2013 21:55, Matthew Hegarty <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br>
<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>hi<br></div>Just starting out so I've got latest versions of apps.<br></div>in cowboy/examples/hello_world, running make fails with:<br>
<br> +<br><br><br></div>
<br> +</blockquote></div><br></div>
<br> + +</tt> diff --git a/archives/extend/attachments/20130922/77e355ff/attachment.html b/archives/extend/attachments/20130922/77e355ff/attachment.html new file mode 100644 index 00000000..c252d5d7 --- /dev/null +++ b/archives/extend/attachments/20130922/77e355ff/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div>hi<br></div>Just starting out so I've got latest versions of apps.<br></div>in cowboy/examples/hello_world, running make fails with:<br><br><br><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130926/28d38e59/attachment.html b/archives/extend/attachments/20130926/28d38e59/attachment.html new file mode 100644 index 00000000..aca6420f --- /dev/null +++ b/archives/extend/attachments/20130926/28d38e59/attachment.html @@ -0,0 +1,186 @@ +<tt> +<!DOCTYPE html><br> +<html><br> +<head><br> +<title></title><br> +</head><br> +<body><div>Did you enable hipe when you compiled? Does /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam exist?<br></div><br> +<div> </div><br> +<div id="sig19305637"><div class="signature">-- <br></div><br> +<div class="signature"> Tristan Sloughter<br></div><br> +<div class="signature"> [email protected]<br></div><br> +<div class="signature"> </div><br> +</div><br> +<div> </div><br> +<div> </div><br> +<div>On Thu, Sep 26, 2013, at 12:03 PM, Matthew Hegarty wrote:<br></div><br> +<blockquote type="cite"><div dir="ltr">hi<br></div><br> +<div dir="ltr">I compiled Erlang from source (downloaded from <a href="http://erlang.org">erlang.org</a>)<br></div><br> +<div><div> </div><br> +<div> </div><br> +<div><div>On 25 September 2013 17:25, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div><br> +<div> </div><br> +<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I ran into the same thing. I assume you installed Erlang from the Erlang<br></div><br> +<div><br> +Solutions repo?<br></div><br> +<div> </div><br> +<div><br> +Install erlang-hipe package. Or remove<br></div><br> +<div><br> +/usr/local/lib/erlang/lib/hipe-3.10.2.1 entirely.<br></div><br> +<div> </div><br> +<div><br> +Their packages install a broken hipe app, missing lots of beams, for<br></div><br> +<div><br> +some reason. But if you install the hipe package it'll install what is<br></div><br> +<div><br> +missing. I told them about this but I haven't heard back.<br></div><br> +<div> </div><br> +<div><br> +--<br></div><br> +<div><br> + Tristan Sloughter<br></div><br> +<div><br> + <a href="mailto:[email protected]">[email protected]</a><br></div><br> +<div> </div><br> +<div><div> </div><br> +<div><br> +On Wed, Sep 25, 2013, at 08:09 AM, Lo�c Hoguin wrote:<br></div><br> +<div><br> +> Why does it look for hipe at all to begin with?<br></div><br> +<div><br> +><br></div><br> +<div><br> +> I'll ping tristan about it.<br></div><br> +<div><br> +><br></div><br> +<div><br> +> On 09/22/2013 10:59 PM, Matthew Hegarty wrote:<br></div><br> +<div><br> +> > hi<br></div><br> +<div><br> +> > Just starting out so I'm trying to run cowboy's helloworld<br></div><br> +<div><br> +> > in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > ===> Provider (rlx_prv_discover) failed with: {error,<br></div><br> +<div><br> +> > {rlx_app_discovery,<br></div><br> +<div><br> +> > [{missing_beam_file,<br></div><br> +<div><br> +> > hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam">>},<br></div><br> +<div><br> +> > {missing_beam_file,<br></div><br> +<div><br> +> > hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam">>}]}}<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > there is no hipe.beam in /usr/local/lib/erlang/lib/hipe-3.10.1/ebin/, it<br></div><br> +<div><br> +> > is in /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam.<br></div><br> +<div><br> +> > I've tried passing the correct dir to relx using --lib-dir but I still<br></div><br> +<div><br> +> > get the same error.<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > Any ideas what's going wrong?<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > erl: Erlang R16B02 (erts-5.10.3)<br></div><br> +<div><br> +> > relx: 0.0.0+build.275.refca03701<br></div><br> +<div><br> +> > rebar: rebar 2.1.0-pre R16B02 20130922_191744 git 2.1.0-pre-46-g78fa8fc<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > On 22 September 2013 21:55, Matthew Hegarty <<a href="mailto:[email protected]">[email protected]</a><br></div><br> +<div><br> +> > <mailto:<a href="mailto:[email protected]">[email protected]</a>>> wrote:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > hi<br></div><br> +<div><br> +> > Just starting out so I've got latest versions of apps.<br></div><br> +<div><br> +> > in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > _______________________________________________<br></div><br> +<div><br> +> > Extend mailing list<br></div><br> +<div><br> +> > <a href="mailto:[email protected]">[email protected]</a><br></div><br> +<div><br> +> > <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +><br></div><br> +<div><br> +><br></div><br> +<div><br> +> --<br> +<br></div><br> +</div><br> +<div>> Lo�c Hoguin<br></div><br> +<div> </div><br> +<div>> Erlang Cowboy<br></div><br> +<div><br> +> Nine Nines<br></div><br> +<div><br> +> <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br> +<br></div><br> +<div><div>> _______________________________________________<br></div><br> +<div><br> +> Extend mailing list<br></div><br> +<div><br> +> <a href="mailto:[email protected]">[email protected]</a><br></div><br> +<div><br> +> <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div> </div><br> +<div> </div><br> +<div><br> +--<br> +<br></div><br> +</div><br> +<div><span><span style="color:rgb(136, 136, 136)" class="colour"> Tristan Sloughter</span></span><br></div><br> +<div><span><span style="color:rgb(136, 136, 136)" class="colour"><br> + <a href="mailto:[email protected]">[email protected]</a><br><br> +</span></span></div><br> +</blockquote></div><br> +<div> </div><br> +</div><br> +</blockquote></body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130926/3a77fe04/attachment.html b/archives/extend/attachments/20130926/3a77fe04/attachment.html new file mode 100644 index 00000000..05e6ddc9 --- /dev/null +++ b/archives/extend/attachments/20130926/3a77fe04/attachment.html @@ -0,0 +1,189 @@ +<tt> +<div dir="ltr"><div><div><div><div>yes it exists.� I believe hipe is enabled by default when I compile.<br></div><br></div>however there is no<br><br>�/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam<br>�/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam<br><br> +<br></div>which is what relx is apparently looking for.<br></div>Do you know where does relx get these paths from?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 September 2013 20:04, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><br> +<br> +<br> +<br> +<br> +<div><div>Did you enable hipe when you compiled? Does /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam exist?<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><br> +<div>�</div><br> +<div><div>-- <br></div><br> +<div> Tristan Sloughter<br></div><br> +<div> <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div>�</div><br> +</div></font></span><div><div class="h5"><br> +<div>�</div><br> +<div>�</div><br> +<div>On Thu, Sep 26, 2013, at 12:03 PM, Matthew Hegarty wrote:<br></div><br> +<blockquote type="cite"><div dir="ltr">hi<br></div><br> +<div dir="ltr">I compiled Erlang from source (downloaded from <a href="http://erlang.org" target="_blank">erlang.org</a>)<br></div><br> +<div><div>�</div><br> +<div>�</div><br> +<div><div>On 25 September 2013 17:25, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div><br> +<div>�</div><br> +<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I ran into the same thing. I assume you installed Erlang from the Erlang<br></div><br> +<div><br> +Solutions repo?<br></div><br> +<div>�</div><br> +<div><br> +Install erlang-hipe package. Or remove<br></div><br> +<div><br> +/usr/local/lib/erlang/lib/hipe-3.10.2.1 entirely.<br></div><br> +<div>�</div><br> +<div><br> +Their packages install a broken hipe app, missing lots of beams, for<br></div><br> +<div><br> +some reason. But if you install the hipe package it'll install what is<br></div><br> +<div><br> +missing. I told them about this but I haven't heard back.<br></div><br> +<div>�</div><br> +<div><br> +--<br></div><br> +<div><br> +� Tristan Sloughter<br></div><br> +<div><br> +� <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div>�</div><br> +<div><div>�</div><br> +<div><br> +On Wed, Sep 25, 2013, at 08:09 AM, Lo�c Hoguin wrote:<br></div><br> +<div><br> +> Why does it look for hipe at all to begin with?<br></div><br> +<div><br> +><br></div><br> +<div><br> +> I'll ping tristan about it.<br></div><br> +<div><br> +><br></div><br> +<div><br> +> On 09/22/2013 10:59 PM, Matthew Hegarty wrote:<br></div><br> +<div><br> +> > hi<br></div><br> +<div><br> +> > Just starting out so I'm trying to run cowboy's helloworld<br></div><br> +<div><br> +> > in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > ===> Provider (rlx_prv_discover) failed with: {error,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � �{rlx_app_discovery,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � [{missing_beam_file,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam">>},<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � �{missing_beam_file,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam">>}]}}<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > there is no hipe.beam in /usr/local/lib/erlang/lib/hipe-3.10.1/ebin/, it<br></div><br> +<div><br> +> > is in /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam.<br></div><br> +<div><br> +> > I've tried passing the correct dir to relx using --lib-dir but I still<br></div><br> +<div><br> +> > get the same error.<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > Any ideas what's going wrong?<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > erl: Erlang R16B02 (erts-5.10.3)<br></div><br> +<div><br> +> > relx: 0.0.0+build.275.refca03701<br></div><br> +<div><br> +> > rebar: rebar 2.1.0-pre R16B02 20130922_191744 git 2.1.0-pre-46-g78fa8fc<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > On 22 September 2013 21:55, Matthew Hegarty <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> > <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > � � hi<br></div><br> +<div><br> +> > � � Just starting out so I've got latest versions of apps.<br></div><br> +<div><br> +> > � � in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > _______________________________________________<br></div><br> +<div><br> +> > Extend mailing list<br></div><br> +<div><br> +> > <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> > <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +><br></div><br> +<div><br> +><br></div><br> +<div><br> +> --<br> +<br></div><br> +</div><br> +<div>> Lo�c Hoguin<br></div><br> +<div>�</div><br> +<div>> Erlang Cowboy<br></div><br> +<div><br> +> Nine Nines<br></div><br> +<div><br> +> <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br> +<br></div><br> +<div><div>> _______________________________________________<br></div><br> +<div><br> +> Extend mailing list<br></div><br> +<div><br> +> <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div>�</div><br> +<div>�</div><br> +<div><br> +--<br> +<br></div><br> +</div><br> +<div><span><span style="color:rgb(136,136,136)">� Tristan Sloughter</span></span><br></div><br> +<div><span><span style="color:rgb(136,136,136)"><br> +� <a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +</span></span></div><br> +</blockquote></div><br> +<div>�</div><br> +</div><br> +</blockquote></div></div></div><br> +<br> +</blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130926/d34b33e3/attachment.html b/archives/extend/attachments/20130926/d34b33e3/attachment.html new file mode 100644 index 00000000..c0201fa9 --- /dev/null +++ b/archives/extend/attachments/20130926/d34b33e3/attachment.html @@ -0,0 +1,85 @@ +<tt> +<div dir="ltr">hi<br>I compiled Erlang from source (downloaded from <a href="http://erlang.org">erlang.org</a>)<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 25 September 2013 17:25, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I ran into the same thing. I assume you installed Erlang from the Erlang<br><br> +Solutions repo?<br><br> +<br><br> +Install erlang-hipe package. Or remove<br><br> +/usr/local/lib/erlang/lib/hipe-3.10.2.1 entirely.<br><br> +<br><br> +Their packages install a broken hipe app, missing lots of beams, for<br><br> +some reason. But if you install the hipe package it'll install what is<br><br> +missing. I told them about this but I haven't heard back.<br><br> +<br><br> +--<br><br> +� Tristan Sloughter<br><br> +� <a href="mailto:[email protected]">[email protected]</a><br><br> +<div><div class="h5"><br><br> +On Wed, Sep 25, 2013, at 08:09 AM, Lo�c Hoguin wrote:<br><br> +> Why does it look for hipe at all to begin with?<br><br> +><br><br> +> I'll ping tristan about it.<br><br> +><br><br> +> On 09/22/2013 10:59 PM, Matthew Hegarty wrote:<br><br> +> > hi<br><br> +> > Just starting out so I'm trying to run cowboy's helloworld<br><br> +> > in cowboy/examples/hello_world, running make fails with:<br><br> +> ><br><br> +> > ===> Provider (rlx_prv_discover) failed with: {error,<br><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � �{rlx_app_discovery,<br><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � [{missing_beam_file,<br><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � hipe,<br><br> +> ><br><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam">>},<br><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � �{missing_beam_file,<br><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � hipe,<br><br> +> ><br><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam">>}]}}<br><br> +> ><br><br> +> > there is no hipe.beam in /usr/local/lib/erlang/lib/hipe-3.10.1/ebin/, it<br><br> +> > is in /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam.<br><br> +> > I've tried passing the correct dir to relx using --lib-dir but I still<br><br> +> > get the same error.<br><br> +> ><br><br> +> > Any ideas what's going wrong?<br><br> +> ><br><br> +> > erl: Erlang R16B02 (erts-5.10.3)<br><br> +> > relx: 0.0.0+build.275.refca03701<br><br> +> > rebar: rebar 2.1.0-pre R16B02 20130922_191744 git 2.1.0-pre-46-g78fa8fc<br><br> +> ><br><br> +> ><br><br> +> > On 22 September 2013 21:55, Matthew Hegarty <<a href="mailto:[email protected]">[email protected]</a><br><br> +> > <mailto:<a href="mailto:[email protected]">[email protected]</a>>> wrote:<br><br> +> ><br><br> +> > � � hi<br><br> +> > � � Just starting out so I've got latest versions of apps.<br><br> +> > � � in cowboy/examples/hello_world, running make fails with:<br><br> +> ><br><br> +> ><br><br> +> ><br><br> +> ><br><br> +> ><br><br> +> ><br><br> +> > _______________________________________________<br><br> +> > Extend mailing list<br><br> +> > <a href="mailto:[email protected]">[email protected]</a><br><br> +> > <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br><br> +> ><br><br> +><br><br> +><br><br> +> --<br><br> +</div></div>> Lo�c Hoguin<br><br> +<div class="im HOEnZb">> Erlang Cowboy<br><br> +> Nine Nines<br><br> +> <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div><div class="HOEnZb"><div class="h5">> _______________________________________________<br><br> +> Extend mailing list<br><br> +> <a href="mailto:[email protected]">[email protected]</a><br><br> +> <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br><br> +<br><br> +<br><br> +--<br><br> +</div></div><span class="HOEnZb"><font color="#888888">� Tristan Sloughter<br><br> +� <a href="mailto:[email protected]">[email protected]</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20130928/41b322fd/attachment.html b/archives/extend/attachments/20130928/41b322fd/attachment.html new file mode 100644 index 00000000..d36eb019 --- /dev/null +++ b/archives/extend/attachments/20130928/41b322fd/attachment.html @@ -0,0 +1,253 @@ +<tt> +<!DOCTYPE html><br> +<html><br> +<head><br> +<title></title><br> +</head><br> +<body><div>Yea, since I doubt the OTP team (or anyone) will fix the fact that it installs a broken hipe we've decided to just warn on broken apps during the discovery phase. So it'll only fail if the broken app is also suppose to be part of the release.<br></div><br> +<div> </div><br> +<div>Finishing up the relx patch right now.<br></div><br> +<div> </div><br> +<div id="sig19305637"><div class="signature">-- <br></div><br> +<div class="signature"> Tristan Sloughter<br></div><br> +<div class="signature"> [email protected]<br></div><br> +<div class="signature"> </div><br> +</div><br> +<div> </div><br> +<div> </div><br> +<div>On Sat, Sep 28, 2013, at 01:41 PM, Matthew Hegarty wrote:<br></div><br> +<blockquote type="cite"><div dir="ltr"><div><div><div>Got it to work. I apparently had a few versions of hipe in my Erlang lib dir:<br></div><br> +<div> </div><br> +<div>$ /usr/local/lib/erlang/lib $ ll -ld hipe*<br></div><br> +<div>drwxr-xr-x 9 root root 4096 Feb 11 2013 hipe-3.10/<br></div><br> +<div>drwxr-xr-x 9 root root 4096 Mar 1 2013 hipe-3.10.1/<br></div><br> +<div><br> +drwxr-xr-x 10 root root 4096 Jul 2 11:31 hipe-3.10.2/<br></div><br> +<div>drwxr-xr-x 10 root root 4096 Sep 21 17:36 hipe-3.10.2.1/<br></div><br> +<div> </div><br> +<div>They must have come from previous erlang installations (compilation from source). The solution was to remove the older versions and leave only the latest one. Maybe relx should be able to handle this?<br></div><br> +<div> </div><br> +</div><br> +<div>thanks for the responses<br></div><br> +</div><br> +<div> </div><br> +<div>Matt<br></div><br> +</div><br> +<div><div> </div><br> +<div> </div><br> +<div><div>On 26 September 2013 21:36, Matthew Hegarty <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div><br> +<div> </div><br> +<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>yes it exists. I believe hipe is enabled by default when I compile.<br></div><br> +<div> </div><br> +</div><br> +<div><br> +however there is no<br></div><br> +<div> </div><br> +<div> /usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam<br></div><br> +<div> /usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam<br></div><br> +<div> </div><br> +</div><br> +<div>which is what relx is apparently looking for.<br></div><br> +</div><br> +<div>Do you know where does relx get these paths from?<br></div><br> +</div><br> +<div><div><div><div> </div><br> +<div> </div><br> +<div><div>On 26 September 2013 20:04, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div><br> +<div> </div><br> +<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><br> +<br> +<br> +<br> +<br> +<div><div>Did you enable hipe when you compiled? Does /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam exist?<span><span style="color:rgb(136, 136, 136)" class="colour"></span></span><br></div><br> +<span><span style="color:rgb(136, 136, 136)" class="colour"><div> </div><br> +<div><div>-- <br></div><br> +<div> Tristan Sloughter<br></div><br> +<div> <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div> </div><br> +</div><br> +</span></span><div><div><div> </div><br> +<div> </div><br> +<div>On Thu, Sep 26, 2013, at 12:03 PM, Matthew Hegarty wrote:<br></div><br> +<blockquote type="cite"><div dir="ltr">hi<br></div><br> +<div dir="ltr">I compiled Erlang from source (downloaded from <a href="http://erlang.org" target="_blank">erlang.org</a>)<br></div><br> +<div><div> </div><br> +<div> </div><br> +<div><div>On 25 September 2013 17:25, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div><br> +<div> </div><br> +<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I ran into the same thing. I assume you installed Erlang from the Erlang<br></div><br> +<div><br> +Solutions repo?<br></div><br> +<div> </div><br> +<div><br> +Install erlang-hipe package. Or remove<br></div><br> +<div><br> +/usr/local/lib/erlang/lib/hipe-3.10.2.1 entirely.<br></div><br> +<div> </div><br> +<div><br> +Their packages install a broken hipe app, missing lots of beams, for<br></div><br> +<div><br> +some reason. But if you install the hipe package it'll install what is<br></div><br> +<div><br> +missing. I told them about this but I haven't heard back.<br></div><br> +<div> </div><br> +<div><br> +--<br></div><br> +<div><br> + Tristan Sloughter<br></div><br> +<div><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div> </div><br> +<div><div> </div><br> +<div><br> +On Wed, Sep 25, 2013, at 08:09 AM, Lo�c Hoguin wrote:<br></div><br> +<div><br> +> Why does it look for hipe at all to begin with?<br></div><br> +<div><br> +><br></div><br> +<div><br> +> I'll ping tristan about it.<br></div><br> +<div><br> +><br></div><br> +<div><br> +> On 09/22/2013 10:59 PM, Matthew Hegarty wrote:<br></div><br> +<div><br> +> > hi<br></div><br> +<div><br> +> > Just starting out so I'm trying to run cowboy's helloworld<br></div><br> +<div><br> +> > in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > ===> Provider (rlx_prv_discover) failed with: {error,<br></div><br> +<div><br> +> > {rlx_app_discovery,<br></div><br> +<div><br> +> > [{missing_beam_file,<br></div><br> +<div><br> +> > hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam">>},<br></div><br> +<div><br> +> > {missing_beam_file,<br></div><br> +<div><br> +> > hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam">>}]}}<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > there is no hipe.beam in /usr/local/lib/erlang/lib/hipe-3.10.1/ebin/, it<br></div><br> +<div><br> +> > is in /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam.<br></div><br> +<div><br> +> > I've tried passing the correct dir to relx using --lib-dir but I still<br></div><br> +<div><br> +> > get the same error.<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > Any ideas what's going wrong?<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > erl: Erlang R16B02 (erts-5.10.3)<br></div><br> +<div><br> +> > relx: 0.0.0+build.275.refca03701<br></div><br> +<div><br> +> > rebar: rebar 2.1.0-pre R16B02 20130922_191744 git 2.1.0-pre-46-g78fa8fc<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > On 22 September 2013 21:55, Matthew Hegarty <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> > <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > hi<br></div><br> +<div><br> +> > Just starting out so I've got latest versions of apps.<br></div><br> +<div><br> +> > in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > _______________________________________________<br></div><br> +<div><br> +> > Extend mailing list<br></div><br> +<div><br> +> > <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> > <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +><br></div><br> +<div><br> +><br></div><br> +<div><br> +> --<br> +<br></div><br> +</div><br> +<div>> Lo�c Hoguin<br></div><br> +<div> </div><br> +<div>> Erlang Cowboy<br></div><br> +<div><br> +> Nine Nines<br></div><br> +<div><br> +> <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br> +<br></div><br> +<div><div>> _______________________________________________<br></div><br> +<div><br> +> Extend mailing list<br></div><br> +<div><br> +> <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div> </div><br> +<div> </div><br> +<div><br> +--<br> +<br></div><br> +</div><br> +<div><span><span style="color:rgb(136, 136, 136)" class="colour"> Tristan Sloughter</span></span><br></div><br> +<div><span><span style="color:rgb(136, 136, 136)" class="colour"><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a><br> +</span></span><br></div><br> +</blockquote></div><br> +<div> </div><br> +</div><br> +</blockquote></div><br> +</div><br> +</div><br> +</blockquote></div><br> +<div> </div><br> +</div><br> +</div><br> +</div><br> +</blockquote></div><br> +<div> </div><br> +</div><br> +</blockquote></body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20130928/b1333ac2/attachment.html b/archives/extend/attachments/20130928/b1333ac2/attachment.html new file mode 100644 index 00000000..46e22802 --- /dev/null +++ b/archives/extend/attachments/20130928/b1333ac2/attachment.html @@ -0,0 +1,195 @@ +<tt> +<div dir="ltr"><div><div><div>Got it to work.� I apparently had a few versions of hipe in my Erlang lib dir:<br><br>$ /usr/local/lib/erlang/lib $ ll -ld hipe*<br>drwxr-xr-x� 9 root root 4096 Feb 11� 2013 hipe-3.10/<br>drwxr-xr-x� 9 root root 4096 Mar� 1� 2013 hipe-3.10.1/<br><br> +drwxr-xr-x 10 root root 4096 Jul� 2 11:31 hipe-3.10.2/<br>drwxr-xr-x 10 root root 4096 Sep 21 17:36 hipe-3.10.2.1/<br><br></div>They must have come from previous erlang installations (compilation from source).� The solution was to remove the older versions and leave only the latest one.� Maybe relx should be able to handle this?<br><br> +<br></div>thanks for the responses<br></div><br>Matt<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 September 2013 21:36, Matthew Hegarty <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>yes it exists.� I believe hipe is enabled by default when I compile.<br></div><br></div><br> +however there is no<br><br>�/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam<br>�/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam<br><br> +<br></div>which is what relx is apparently looking for.<br></div>Do you know where does relx get these paths from?<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 September 2013 20:04, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><br> +<br> +<br> +<br> +<br> +<div><div>Did you enable hipe when you compiled? Does /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam exist?<span><font color="#888888"><br></font></span></div><span><font color="#888888"><br> +<div>�</div><br> +<div><div>-- <br></div><br> +<div> Tristan Sloughter<br></div><br> +<div> <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div>�</div><br> +</div></font></span><div><div><br> +<div>�</div><br> +<div>�</div><br> +<div>On Thu, Sep 26, 2013, at 12:03 PM, Matthew Hegarty wrote:<br></div><br> +<blockquote type="cite"><div dir="ltr">hi<br></div><br> +<div dir="ltr">I compiled Erlang from source (downloaded from <a href="http://erlang.org" target="_blank">erlang.org</a>)<br></div><br> +<div><div>�</div><br> +<div>�</div><br> +<div><div>On 25 September 2013 17:25, Tristan Sloughter <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div><br> +<div>�</div><br> +<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I ran into the same thing. I assume you installed Erlang from the Erlang<br></div><br> +<div><br> +Solutions repo?<br></div><br> +<div>�</div><br> +<div><br> +Install erlang-hipe package. Or remove<br></div><br> +<div><br> +/usr/local/lib/erlang/lib/hipe-3.10.2.1 entirely.<br></div><br> +<div>�</div><br> +<div><br> +Their packages install a broken hipe app, missing lots of beams, for<br></div><br> +<div><br> +some reason. But if you install the hipe package it'll install what is<br></div><br> +<div><br> +missing. I told them about this but I haven't heard back.<br></div><br> +<div>�</div><br> +<div><br> +--<br></div><br> +<div><br> +� Tristan Sloughter<br></div><br> +<div><br> +� <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div>�</div><br> +<div><div>�</div><br> +<div><br> +On Wed, Sep 25, 2013, at 08:09 AM, Lo�c Hoguin wrote:<br></div><br> +<div><br> +> Why does it look for hipe at all to begin with?<br></div><br> +<div><br> +><br></div><br> +<div><br> +> I'll ping tristan about it.<br></div><br> +<div><br> +><br></div><br> +<div><br> +> On 09/22/2013 10:59 PM, Matthew Hegarty wrote:<br></div><br> +<div><br> +> > hi<br></div><br> +<div><br> +> > Just starting out so I'm trying to run cowboy's helloworld<br></div><br> +<div><br> +> > in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > ===> Provider (rlx_prv_discover) failed with: {error,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � �{rlx_app_discovery,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � [{missing_beam_file,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10/ebin/hipe.beam">>},<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � �{missing_beam_file,<br></div><br> +<div><br> +> > � � � � � � � � � � � � � � � � � � � � � � � � � � � � � hipe,<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > <<"/usr/local/lib/erlang/lib/hipe-3.10.1/ebin/hipe.beam">>}]}}<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > there is no hipe.beam in /usr/local/lib/erlang/lib/hipe-3.10.1/ebin/, it<br></div><br> +<div><br> +> > is in /usr/local/lib/erlang/lib/hipe-3.10.2.1/ebin/hipe.beam.<br></div><br> +<div><br> +> > I've tried passing the correct dir to relx using --lib-dir but I still<br></div><br> +<div><br> +> > get the same error.<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > Any ideas what's going wrong?<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > erl: Erlang R16B02 (erts-5.10.3)<br></div><br> +<div><br> +> > relx: 0.0.0+build.275.refca03701<br></div><br> +<div><br> +> > rebar: rebar 2.1.0-pre R16B02 20130922_191744 git 2.1.0-pre-46-g78fa8fc<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > On 22 September 2013 21:55, Matthew Hegarty <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> > <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > � � hi<br></div><br> +<div><br> +> > � � Just starting out so I've got latest versions of apps.<br></div><br> +<div><br> +> > � � in cowboy/examples/hello_world, running make fails with:<br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +> > _______________________________________________<br></div><br> +<div><br> +> > Extend mailing list<br></div><br> +<div><br> +> > <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> > <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div><br> +> ><br></div><br> +<div><br> +><br></div><br> +<div><br> +><br></div><br> +<div><br> +> --<br> +<br></div><br> +</div><br> +<div>> Lo�c Hoguin<br></div><br> +<div>�</div><br> +<div>> Erlang Cowboy<br></div><br> +<div><br> +> Nine Nines<br></div><br> +<div><br> +> <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br> +<br></div><br> +<div><div>> _______________________________________________<br></div><br> +<div><br> +> Extend mailing list<br></div><br> +<div><br> +> <a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><br> +<div><br> +> <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br></div><br> +<div>�</div><br> +<div>�</div><br> +<div><br> +--<br> +<br></div><br> +</div><br> +<div><span><span style="color:rgb(136,136,136)">� Tristan Sloughter</span></span><br></div><br> +<div><span><span style="color:rgb(136,136,136)"><br> +� <a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +</span></span></div><br> +</blockquote></div><br> +<div>�</div><br> +</div><br> +</blockquote></div></div></div><br> +<br> +</blockquote></div><br></div><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131002/4463e3fa/attachment.html b/archives/extend/attachments/20131002/4463e3fa/attachment.html new file mode 100644 index 00000000..c1ef7545 --- /dev/null +++ b/archives/extend/attachments/20131002/4463e3fa/attachment.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr">Hi there,<div><br></div><div>How do I use the websocket infrastructure of cowboy to implement RPC?</div><div>It seems like I can talk to the client using websocket_info, but the response comes in on websocket_handle, all asynchronously.</div><br> +<div><br></div><div>Kind regards,</div><div>Marcel</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131007/863e7358/attachment.html b/archives/extend/attachments/20131007/863e7358/attachment.html new file mode 100644 index 00000000..cada84a3 --- /dev/null +++ b/archives/extend/attachments/20131007/863e7358/attachment.html @@ -0,0 +1,75 @@ +<tt> +<div dir="ltr">Thanks Loïc. I am actually running R16B on a macbook OS X 10.8. (I'm wondering if the Od could have any effect?)<div><br></div><div>Best,</div><div><br></div><div>Ryan</div></div><div class="gmail_extra"><br> +<br><br><div class="gmail_quote">On Mon, Oct 7, 2013 at 10:13 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +I'm guessing you run an older Erlang which had that issue. Either upgrade Erlang or add asn1 to the list of apps to include in the release (and open a ticket for it please so it can be made to work with older versions).<div><br> +<div class="h5"><br><br> +<br><br> +On 10/08/2013 05:55 AM, Ryan Brown wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +I was trying to compile and run the ssl_hello_world example in the<br><br> +cowboy project and am getting the following error at start-up:<br><br> +<br><br> +<br><br> + =INFO REPORT==== 7-Oct-2013::21:38:01 ===<br><br> +<br><br> +<br><br> + application: ssl_hello_world<br><br> +<br><br> +<br><br> + exited: {bad_return,<br><br> +<br><br> +<br><br> + {{ssl_hello_world_app,start,[<u></u>normal,[]]},<br><br> +<br><br> +<br><br> + {'EXIT',<br><br> +<br><br> +<br><br> + {{badmatch,<br><br> +<br><br> +<br><br> + {error,<br><br> +<br><br> +<br><br> + {{shutdown,<br><br> +<br><br> +<br><br> + {failed_to_start_child,ranch_<u></u>acceptors_sup,<br><br> +<br><br> +<br><br> + {{case_clause,<br><br> +<br><br> +<br><br> + {error,{"no such file or directory","asn1.app"}}},<br><br> +<br><br> +<br><br> +<br><br> + [{ranch,require,1,[{file,"src/<u></u>ranch.erl"},{line,207}]},<br><br> +<br><br> +<br><br> +I can start asn1 from the erl console so I am not sure what I am<br><br> +missing. Any help is greatly appreciated.<br><br> +<br><br> +Best regards.<br><br> +<br><br> +--<br><br> +-rb<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>-rb<br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20131007/fdef2170/attachment.html b/archives/extend/attachments/20131007/fdef2170/attachment.html new file mode 100644 index 00000000..36217c63 --- /dev/null +++ b/archives/extend/attachments/20131007/fdef2170/attachment.html @@ -0,0 +1,15 @@ +<tt> +<div dir="ltr">I was trying to compile and run the ssl_hello_world example in the cowboy project and am getting the following error at start-up:<div><br></div><div><h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">=INFO REPORT==== 7-Oct-2013::21:38:01 ===</font></h1><br> +<h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � application: ssl_hello_world</font></h1><h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � exited: {bad_return,</font></h1><br> +<h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � �{{ssl_hello_world_app,start,[normal,[]]},</font></h1><h1 class="" style="margin:0px"><br> +<font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � {'EXIT',</font></h1><h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � �{{badmatch,</font></h1><br> +<h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � � �{error,</font></h1><h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � � � {{shutdown,</font></h1><br> +<h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � � � � {failed_to_start_child,ranch_acceptors_sup,</font></h1><h1 class="" style="margin:0px"><br> +<font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � � � � �{{case_clause,</font></h1><h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � � � � � �{error,{"no such file or directory","asn1.app"}}},</font></h1><br> +<h1 class="" style="margin:0px"><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">� � � � � � � � � � � [{ranch,require,1,[{file,"src/ranch.erl"},{line,207}]},</font></h1><br> +<div><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal"><br></font></div><div><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">I can start asn1 from the erl console so I am not sure what I am missing. Any help is greatly appreciated.</font></div><br> +<div><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal"><br></font></div><div><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal">Best regards.</font></div><br> +<div><font color="#000000" face="Gill Sans, Tahoma, Verdana, sans-serif" size="3" style="font-weight:normal"><br></font></div>-- <br>-rb<br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131008/8752fdd7/attachment.html b/archives/extend/attachments/20131008/8752fdd7/attachment.html new file mode 100644 index 00000000..3077367f --- /dev/null +++ b/archives/extend/attachments/20131008/8752fdd7/attachment.html @@ -0,0 +1,82 @@ +<tt> +<div dir="ltr">Just to complete the loop. As would be expected, adding asn1 to the app.src applications fixes the issue.<div><br></div><div>Thank you,</div><div><br></div><div>Ryan</div></div><div class="gmail_extra"><br><br><br> +<div class="gmail_quote">On Mon, Oct 7, 2013 at 10:24 PM, Ryan Brown <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<div dir="ltr">Thanks Loïc. I am actually running R16B on a macbook OS X 10.8. (I'm wondering if the Od could have any effect?)<div><br></div><div>Best,</div><div><br></div><div>Ryan</div></div><div class="gmail_extra"><br> +<div><div class="h5"><br> +<br><br><div class="gmail_quote">On Mon, Oct 7, 2013 at 10:13 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<br> +I'm guessing you run an older Erlang which had that issue. Either upgrade Erlang or add asn1 to the list of apps to include in the release (and open a ticket for it please so it can be made to work with older versions).<div><br> +<br> +<div><br><br> +<br><br> +On 10/08/2013 05:55 AM, Ryan Brown wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br> +I was trying to compile and run the ssl_hello_world example in the<br><br> +cowboy project and am getting the following error at start-up:<br><br> +<br><br> +<br><br> + =INFO REPORT==== 7-Oct-2013::21:38:01 ===<br><br> +<br><br> +<br><br> + application: ssl_hello_world<br><br> +<br><br> +<br><br> + exited: {bad_return,<br><br> +<br><br> +<br><br> + {{ssl_hello_world_app,start,[<u></u>normal,[]]},<br><br> +<br><br> +<br><br> + {'EXIT',<br><br> +<br><br> +<br><br> + {{badmatch,<br><br> +<br><br> +<br><br> + {error,<br><br> +<br><br> +<br><br> + {{shutdown,<br><br> +<br><br> +<br><br> + {failed_to_start_child,ranch_<u></u>acceptors_sup,<br><br> +<br><br> +<br><br> + {{case_clause,<br><br> +<br><br> +<br><br> + {error,{"no such file or directory","asn1.app"}}},<br><br> +<br><br> +<br><br> +<br><br> + [{ranch,require,1,[{file,"src/<u></u>ranch.erl"},{line,207}]},<br><br> +<br><br> +<br><br> +I can start asn1 from the erl console so I am not sure what I am<br><br> +missing. Any help is greatly appreciated.<br><br> +<br><br> +Best regards.<br><br> +<br><br> +--<br><br> +-rb<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span><font color="#888888"><br> +</font></span></blockquote><span><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>-rb<br> +</font></span></div><br> +</blockquote></div><br><br clear="all"><div><br></div>-- <br>-rb<br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20131009/7c03cefc/attachment.html b/archives/extend/attachments/20131009/7c03cefc/attachment.html new file mode 100644 index 00000000..6870f939 --- /dev/null +++ b/archives/extend/attachments/20131009/7c03cefc/attachment.html @@ -0,0 +1,67 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Essentially, the REST service endpoint would be on <a href="http://widgets.net">widgets.net</a> while the clients website, in this case <a href="http://things.com">things.com</a>, has a JavaScript that makes an AJAX call to <a href="http://widgets.net">widgets.net</a>. The account on <a href="http://widgets.net">widgets.net</a> for <a href="http://things.com">things.com</a> will have the <a href="http://things.com">things.com</a> domain registered to its account, so that <a href="http://widgets.net">widgets.net</a> can check to see if the request is coming from an expected domain.<div><br></div><div>Thanks,</div><div>Lee</div><div><br></div><div><br><div><div>On 9 Oct 2013, at 16:51, Nathan Michaels <<a href="mailto:[email protected]">[email protected]</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Is the client making the request to your service on <a href="http://widgets.net/">widgets.net</a> because <a href="http://things.com/">things.com</a> sent them there, or is <a href="http://things.com/">things.com</a> making the request directly on behalf of the client? The first is what Lo�c is talking about. The second is the source IP of the request, which you can definitely get.</div><br> +<br> +<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 9, 2013 at 11:32 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<br> +In short: you can't.<br><br> +<br><br> +Browsers may send origin/referer/.. headers depending on the type of request, but you can't rely on them to be real or even just there.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 10/09/2013 05:30 PM, Lee Sylvester wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Thank you. I couldn't work out if that's the host being called from or the host name in the request. For example, a store called <a href="http://things.com/" target="_blank">things.com</a> makes a request to my service on <a href="http://widgets.net/" target="_blank">widgets.net</a>. I need to see that the request is made FROM <a href="http://things.com/" target="_blank">things.com</a> for validation purposes. Is it correct that host will provide this?<br><br> +<br> +<br> +<br><br> +Thanks,<br><br> +Lee<br><br> +<br><br> +Sent from my iPhone<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +On Oct 9, 2013, at 2:31 PM, Lo�c Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br><br> +cowboy_req:host/1?<br><br> +<br><br> +Please use the nice manual we have now.<br><br> +<br><br> + <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_req" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_req</a><br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +On 10/09/2013 03:27 PM, Lee Sylvester wrote:<br><br> +Hi,<br><br> +<br><br> +When receiving a Cowboy request, is there a way to find out which hostname the user made the request from? I'm using CORS in my REST and Bullet app, where each call can be made through a given account. However, I'd like to be able to lock requests for each account to a designated hostname to protect that users account usage.<br><br> +<br> +<br> +<br><br> +Thanks,<br><br> +Lee<br><br> +<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</blockquote><br> +<br><br> +<br><br> +--<br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu/" target="_blank">http://ninenines.eu</a><br><br> +</blockquote></blockquote><br> +<br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu/" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</div></div></blockquote></div><br></div><br> +_______________________________________________<br>Extend mailing list<br><a href="mailto:[email protected]">[email protected]</a><br>http://lists.ninenines.eu:81/listinfo/extend<br></blockquote></div><br></div></body></html> +</tt> diff --git a/archives/extend/attachments/20131009/cc05d6f5/attachment.html b/archives/extend/attachments/20131009/cc05d6f5/attachment.html new file mode 100644 index 00000000..40290673 --- /dev/null +++ b/archives/extend/attachments/20131009/cc05d6f5/attachment.html @@ -0,0 +1,67 @@ +<tt> +<div dir="ltr">Is the client making the request to your service on <a href="http://widgets.net">widgets.net</a> because <a href="http://things.com">things.com</a> sent them there, or is <a href="http://things.com">things.com</a> making the request directly on behalf of the client? The first is what Loïc is talking about. The second is the source IP of the request, which you can definitely get.</div><br> +<br> +<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 9, 2013 at 11:32 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<br> +In short: you can't.<br><br> +<br><br> +Browsers may send origin/referer/.. headers depending on the type of request, but you can't rely on them to be real or even just there.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 10/09/2013 05:30 PM, Lee Sylvester wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Thank you. I couldn't work out if that's the host being called from or the host name in the request. For example, a store called <a href="http://things.com" target="_blank">things.com</a> makes a request to my service on <a href="http://widgets.net" target="_blank">widgets.net</a>. I need to see that the request is made FROM <a href="http://things.com" target="_blank">things.com</a> for validation purposes. Is it correct that host will provide this?<br><br> +<br> +<br> +<br><br> +Thanks,<br><br> +Lee<br><br> +<br><br> +Sent from my iPhone<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +On Oct 9, 2013, at 2:31 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br><br> +cowboy_req:host/1?<br><br> +<br><br> +Please use the nice manual we have now.<br><br> +<br><br> + <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_req" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_req</a><br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +On 10/09/2013 03:27 PM, Lee Sylvester wrote:<br><br> +Hi,<br><br> +<br><br> +When receiving a Cowboy request, is there a way to find out which hostname the user made the request from? I'm using CORS in my REST and Bullet app, where each call can be made through a given account. However, I'd like to be able to lock requests for each account to a designated hostname to protect that users account usage.<br><br> +<br> +<br> +<br><br> +Thanks,<br><br> +Lee<br><br> +<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</blockquote><br> +<br><br> +<br><br> +--<br><br> +Loïc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</blockquote></blockquote><br> +<br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131015/203060cc/attachment.html b/archives/extend/attachments/20131015/203060cc/attachment.html new file mode 100644 index 00000000..93be1f66 --- /dev/null +++ b/archives/extend/attachments/20131015/203060cc/attachment.html @@ -0,0 +1,78 @@ +<tt> +<div dir="ltr">thanks for your help. suppose that I want to stream live audio. I do not know how long my audio program will be, and as I stream it, if I have a timeout, the server will just disconnect the user that listens to the audio in the browser. and the browser won't reconnect. Would you suggest the "right" way to implement something like that? Would infinite timeout suffice? or is it a bad practice? another type of handler maybe?</div><br> +<div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/15 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Yep. And it will also disconnect if the client sends too much. It has to disconnect and reconnect eventually, there's no way around it.<div class="im"><br><br> +<br><br> +On 10/16/2013 05:03 AM, akonsu wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +so it will disconnect if the client only listens and sends nothing to<br><br> +the socket, correct?<br><br> +<br><br> +<br></div><br> +2013/10/15 Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>><div class="im"><br><br> +<br><br> + The socket connected to the client.<br><br> +<br><br> + TCP isn't perfect, there is no way to be 100% sure the client is<br><br> + still connected, hence the timeout. If the client is still up you<br><br> + should make it reconnect.<br><br> +<br><br> +<br><br> + On 10/16/2013 04:55 AM, akonsu wrote:<br><br> +<br><br> + Hello,<br><br> +<br><br> + the documentation for `init` at<br></div><br> + <a href="http://ninenines.eu/docs/en/__cowboy/HEAD/manual/cowboy___loop_handler" target="_blank">http://ninenines.eu/docs/en/__<u></u>cowboy/HEAD/manual/cowboy___<u></u>loop_handler</a><div class="im"><br><br> + <<a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_loop_handler" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_<u></u>loop_handler</a>><br><br> + says:<br><br> +<br><br> + The receive loop will run for a duration of up to Timeout<br><br> + milliseconds<br><br> + after it last received data from the socket, at which point it<br><br> + will stop<br><br> + and send a 204 No Content reply.<br><br> +<br><br> + What socket does it refer to? I had an impression that the loop<br><br> + handles<br><br> + erlang messages. Do these messages come through a socket (sorry<br><br> + about a<br><br> + trivial question, but I am new to erlang), and this is the<br><br> + socket that<br><br> + the docs talk about?<br><br> +<br><br> + The reason why I am asking is because I used to have a Timeout<br><br> + of 60000,<br><br> + and even though messages kept coming non stop, it still kept<br><br> + disconnecting after a minute, until I set Timeout to infinity.<br><br> +<br><br> + thanks<br><br> + Konstantin<br><br> +<br><br> +<br></div><br> + ______________________________<u></u>___________________<br><br> + Extend mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">Extend@lists.<u></u>ninenines.eu</a>><br><br> + <a href="http://lists.ninenines.eu:81/__listinfo/extend" target="_blank">http://lists.ninenines.eu:81/_<u></u>_listinfo/extend</a><div class="im"><br><br> + <<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a>><br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + Loďc Hoguin<br><br> + Erlang Cowboy<br><br> + Nine Nines<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +</div></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loïc Hoguin</font></span><div class="HOEnZb"><div class="h5"><br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131015/591e8649/attachment.html b/archives/extend/attachments/20131015/591e8649/attachment.html new file mode 100644 index 00000000..d06f0bbe --- /dev/null +++ b/archives/extend/attachments/20131015/591e8649/attachment.html @@ -0,0 +1,46 @@ +<tt> +<div dir="ltr">so it will disconnect if the client only listens and sends nothing to the socket, correct?</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/15 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The socket connected to the client.<br><br> +<br><br> +TCP isn't perfect, there is no way to be 100% sure the client is still connected, hence the timeout. If the client is still up you should make it reconnect.<div><div class="h5"><br><br> +<br><br> +On 10/16/2013 04:55 AM, akonsu wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hello,<br><br> +<br><br> +the documentation for `init` at<br><br> +<a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_loop_handler" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_<u></u>loop_handler</a> says:<br><br> +<br><br> +The receive loop will run for a duration of up to Timeout milliseconds<br><br> +after it last received data from the socket, at which point it will stop<br><br> +and send a 204 No Content reply.<br><br> +<br><br> +What socket does it refer to? I had an impression that the loop handles<br><br> +erlang messages. Do these messages come through a socket (sorry about a<br><br> +trivial question, but I am new to erlang), and this is the socket that<br><br> +the docs talk about?<br><br> +<br><br> +The reason why I am asking is because I used to have a Timeout of 60000,<br><br> +and even though messages kept coming non stop, it still kept<br><br> +disconnecting after a minute, until I set Timeout to infinity.<br><br> +<br><br> +thanks<br><br> +Konstantin<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +<br><br> +-- <br><br> +Loďc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131015/94506752/attachment.html b/archives/extend/attachments/20131015/94506752/attachment.html new file mode 100644 index 00000000..a847b802 --- /dev/null +++ b/archives/extend/attachments/20131015/94506752/attachment.html @@ -0,0 +1,8 @@ +<tt> +<div dir="ltr">Hello,<div><br></div><div>the documentation for `init` at <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_loop_handler">http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_loop_handler</a> says:</div><br> +<div><br></div><div>The receive loop will run for a duration of up to Timeout milliseconds after it last received data from the socket, at which point it will stop and send a 204 No Content reply.<br></div><div><br></div><br> +<div>What socket does it refer to? I had an impression that the loop handles erlang messages. Do these messages come through a socket (sorry about a trivial question, but I am new to erlang), and this is the socket that the docs talk about?</div><br> +<div><br></div><div>The reason why I am asking is because I used to have a Timeout of 60000, and even though messages kept coming non stop, it still kept disconnecting after a minute, until I set Timeout to infinity.</div><br> +<div><br></div><div>thanks</div><div>Konstantin</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131015/bac10460/attachment.html b/archives/extend/attachments/20131015/bac10460/attachment.html new file mode 100644 index 00000000..75224869 --- /dev/null +++ b/archives/extend/attachments/20131015/bac10460/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr">1. do you mean that there is no way on the server side to tell if the client has disconnected?<div><br><div>2. if I use a normal handler, I will still run into the same problem, it does not matter which handler I use, from the standpoint of deciding whether the client is still there, right?</div><br> +<div><br></div><div>I am confused as to how I can implement my streaming and not drop the connection on each client and yet make sure I do close the connections when the clients disconnect...</div><div><br></div><div><div class="gmail_extra"><br> +<br><div class="gmail_quote">2013/10/15 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Infinite is bad practice, yes. Infinite means some connections will *never* be closed, eating FDs and memory for nothing.<br><br> +<br><br> +I'm not sure why you want to receive messages, you could just use a normal handler that asks for more data, sends it, ask for more data, sends it, etc.<div class="im"><br></div></blockquote></div></div></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131016/abe38a1a/attachment.html b/archives/extend/attachments/20131016/abe38a1a/attachment.html new file mode 100644 index 00000000..9672e317 --- /dev/null +++ b/archives/extend/attachments/20131016/abe38a1a/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr">ok. the data that I need to send are coming as erlang messages to the process that runs my handler. so it sounds like if I want to use the "normal" cowboy_http_handler, then I need a receive loop inside handle(Req, State) callback, right? Basically, my response stream will potentially never end, I do not know how to handle this properly in cowboy...<br><br> +<div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/16 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +Loop handlers are designed to wait for a long time with the socket *idle* and then eventually send one response then close the socket. Things like long-polling.<br><br> +<br><br> +What you are doing is just streaming, for which you do not need a timeout because the socket isn't idle. You are just sending a large response, and normal handlers are perfectly capable of doing that.<div class="im"><br> +<br></div></blockquote></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131016/edbc349c/attachment.html b/archives/extend/attachments/20131016/edbc349c/attachment.html new file mode 100644 index 00000000..26d032bf --- /dev/null +++ b/archives/extend/attachments/20131016/edbc349c/attachment.html @@ -0,0 +1,46 @@ +<tt> +<div dir="ltr">thanks. one more question if you do not mind. you say that we need timeouts when the client does not notify us when it dies. but then you say that if the client dies then the socket write will fail. to me this sounds like a contradiction. would you please clarify?<div><br> +<br></div><div>(I assume that this is the problem that we are discussing: <a href="http://stackoverflow.com/questions/283375/detecting-tcp-client-disconnect">http://stackoverflow.com/questions/283375/detecting-tcp-client-disconnect</a>, right?)</div><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/16 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<div class="im">On 10/16/2013 05:48 AM, akonsu wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +1. do you mean that there is no way on the server side to tell if the<br><br> +client has disconnected?<br><br> +</blockquote><br> +<br></div><br> +There are ways, and Cowboy will happily detect them. There's also the problem that a side may be closed without the other side knowing about it, which is why you need timeouts.<div class="im"><br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +2. if I use a normal handler, I will still run into the same problem, it<br><br> +does not matter which handler I use, from the standpoint of deciding<br><br> +whether the client is still there, right?<br><br> +</blockquote><br> +<br></div><br> +If the client is gone, the send will fail. Normal handlers are pretty much the same except they don't have a timeout, because your code has an explicit end.<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +I am confused as to how I can implement my streaming and not drop the<br><br> +connection on each client and yet make sure I do close the connections<br><br> +when the clients disconnect...<br><br> +<br><br> +<br></div><br> +2013/10/15 Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>><div class="im"><br><br> +<br><br> + Infinite is bad practice, yes. Infinite means some connections will<br><br> + *never* be closed, eating FDs and memory for nothing.<br><br> +<br><br> + I'm not sure why you want to receive messages, you could just use a<br><br> + normal handler that asks for more data, sends it, ask for more data,<br><br> + sends it, etc.<br><br> +<br><br> +</div></blockquote><br> +<br><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131018/00d4df12/attachment.html b/archives/extend/attachments/20131018/00d4df12/attachment.html new file mode 100644 index 00000000..71bf2ae1 --- /dev/null +++ b/archives/extend/attachments/20131018/00d4df12/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hi,<div><br></div><div>I have a handler that spawns a process and links to this process. the new process does not trap exit signals.<div><br></div><div>When I open the URL that is handled by this handler in the browser, and stop the browser before the handler finishes the request, the handler is terminated and my terminate function is called with the Reason set to {error,closed} or something similar.</div><br> +<div><br></div><div>When this happens, the linked process does not get killed, so I have to call exit on it from the terminate function.</div><div><br></div><div>is this by design? I suppose when I cancel the browser request, the handler is exited with normal exit code, correct? could you point me to the source code for that part? it is perhaps in the "ranch" repo, no?</div><br> +</div><div><br></div><div>thanks in advance</div><div><br></div><div>konstantin</div><div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131029/3df30c1d/attachment.html b/archives/extend/attachments/20131029/3df30c1d/attachment.html new file mode 100644 index 00000000..fed7bc12 --- /dev/null +++ b/archives/extend/attachments/20131029/3df30c1d/attachment.html @@ -0,0 +1,10 @@ +<tt> +<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Sorry for terse but I only have a phone. Why can't you return a 404 here? Using something like cowboy:reply(404, ...</div><div><br></div><div>Ivan<br><br>--<br>festina lente<div><br></div></div><div><br>On 29 Oct 2013, at 21:25, Daniel Goertzen <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div><div><div>My situation is that I have a rest handler that may fail due to invalid url segments. Example situation:<br><br><br><span style="font-family:courier new,monospace">init(_Transport, _Req, _Opts) -><br><br> + {upgrade, protocol, cowboy_rest}.<br><br>content_types_provided(Req, State) -><br> {[{<<"application/json">>, get_json}], Req, State}.<br><br>get_json(Req0, State) -><br> {Params, Req1} = lists:mapfoldl(fun cowboy_req:binding/2, Req0, [param1, param2, param3, ....]),<br><br> +<br> case catch other_module:request(Params) of<br> {'EXIT', {badarg, _}} -><br></span></div><div><span style="font-family:courier new,monospace"> hmmm, Params were bad and I would like to return a 404 code now.<br><br> +</span></div><div><span style="font-family:courier new,monospace"> Result -><br> {jiffy:encode(Result), Req1, State}<br> end.<br></span><br><br><br></div><div>So I would like to return a 404 code when my underlying request function fails, but it appears my choices are:<br><br> +</div><div><br>- return a 200 (ok) response with data.<br></div><div>- crash and cause a 500 (Internal Server Error) response to be returned. Not exactly the sentiment I want.<br></div><div><div><br><br></div><div>Is there some other way to cause a 404 response?<br><br> +<br></div><div>I realize I could add path constraint functions, but I will be replicating logic from my underlying request function. Furthermore, the constraint functions consider parameters in isolation, so that won't work if the validity of parameters is coupled.<br><br> +</div><div><br></div><div>Thanks,<br>Dan.<br></div></div></div></div></div><br> +</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Extend mailing list</span><br><span><a href="mailto:[email protected]">[email protected]</a></span><br><span><a href="http://lists.ninenines.eu:81/listinfo/extend">http://lists.ninenines.eu:81/listinfo/extend</a></span><br></div></blockquote></body></html> +</tt> diff --git a/archives/extend/attachments/20131029/5fc5da75/attachment.html b/archives/extend/attachments/20131029/5fc5da75/attachment.html new file mode 100644 index 00000000..32f4e9de --- /dev/null +++ b/archives/extend/attachments/20131029/5fc5da75/attachment.html @@ -0,0 +1,26 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><br> +<div>Hi,</div><br> +<div><br><br> +</div><br> +<div>I'm using cowboy_rest for a part of our api to handle POST requests. Under certain conditions, I would like to redirect to a new location (based on availability of the redirect qs parameter).</div><br> +<div>I was unable to get the moved_temporarily/2 callback to work (was not invoked at al). So I just do the 302 myself, using cowboy_req:reply/4. This works, however, every time it produces an error in the emulator process:</div><br> +<div> [error] emulator Error in process <0.509.0> on node '[email protected]' with exit value: {function_clause,[{cowboy_req,reply,[204,[],<<0 bytes>>,{http_req,#Port<0.14491>,ranch_tcp,keepalive,<0.509.0>,<<4 bytes>>,'HTTP/1.1',{{10,10,10,1},62197},<<15 bytes>>,undefined,8000,<<26<br> + bytes>>,undefined,<<14 bytes>>,[{<<8 bytes>>,<<5 bytes>>}],[{method,<<5 bytes>>}],[{<<4 bytes>>,<<20 bytes>>},{<<10 bytes>>,<<10 bytes>>},{<<14 bytes>>,<<2 bytes>>},{<<6 bytes>>,<<74 bytes>>},{<<6 bytes>>,<<27 bytes>>},{<<10 bytes>>,<<120 bytes>>},{<<12 bytes>>,<<33<br> + bytes>>},{<<7 bytes>>,<<54 bytes>>},{<<15 bytes>>,<<17 bytes>>},{<<15 bytes>>,<<14 bytes>>},{<<6 bytes>>,<<245 bytes>>}],[{<<14 bytes>>,34},{<<6 bytes>>,undefined},{<<14 bytes>>,34},{<<12 bytes>>,{<<11 bytes>>,<<21 bytes>>,[]}},{<<17 bytes>>,undefined},{<<13<br> + bytes>>,...</div><br> +<div><br><br> +</div><br> +<div>Can you point me out how to (ideally) make use of moved_temporarily/2 or how I can prevent cowboy_rest from wanting to reply with 204 in this case?</div><br> +<div><br><br> +</div><br> +<div>Cheers,</div><br> +<div>Rolph</div><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20131029/a9204600/attachment.html b/archives/extend/attachments/20131029/a9204600/attachment.html new file mode 100644 index 00000000..b69fae87 --- /dev/null +++ b/archives/extend/attachments/20131029/a9204600/attachment.html @@ -0,0 +1,10 @@ +<tt> +<div dir="ltr"><div><div><div>My situation is that I have a rest handler that may fail due to invalid url segments.� Example situation:<br><br><br><span style="font-family:courier new,monospace">init(_Transport, _Req, _Opts) -><br><br> +������� {upgrade, protocol, cowboy_rest}.<br><br>content_types_provided(Req, State) -><br>��� {[{<<"application/json">>, get_json}], Req, State}.<br><br>get_json(Req0, State) -><br>��� {Params, Req1} = lists:mapfoldl(fun cowboy_req:binding/2, Req0, [param1, param2, param3, ....]),<br><br> +<br>��� case catch other_module:request(Params) of<br>��� ��� {'EXIT', {badarg, _}} -><br></span></div><div><span style="font-family:courier new,monospace">��� ��� ��� hmmm, Params were bad and I would like to return a 404 code now.<br><br> +</span></div><div><span style="font-family:courier new,monospace">�� � �� Result -><br>��� ��� ��� {jiffy:encode(Result), Req1, State}<br>��� end.<br></span><br><br><br></div><div>So I would like to return a 404 code when my underlying request function fails, but it appears my choices are:<br><br> +</div><div><br>- return a 200 (ok) response with data.<br></div><div>- crash and cause a 500 (Internal Server Error) response to be returned.� Not exactly the sentiment I want.<br></div><div><div><br><br></div><div>Is there some other way to cause a 404 response?<br><br> +<br></div><div>I realize I could add path constraint functions, but I will be replicating logic from my underlying request function.� Furthermore, the constraint functions consider parameters in isolation, so that won't work if the validity of parameters is coupled.<br><br> +</div><div><br></div><div>Thanks,<br>Dan.<br></div></div></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131030/0ab7c8ee/attachment.html b/archives/extend/attachments/20131030/0ab7c8ee/attachment.html new file mode 100644 index 00000000..79bd8234 --- /dev/null +++ b/archives/extend/attachments/20131030/0ab7c8ee/attachment.html @@ -0,0 +1,38 @@ +<tt> +<div dir="ltr"><div>Returning 'halt' caused a status code of 204.<br><br></div>Dan.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 30, 2013 at 10:27 AM, Ivan uemlianin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Instead of <<"this body ignored">> can you return the atom halt?</div><div><br><br> +</div><div>#dontevenhaveanyofmycodewithme:(</div><div><br></div><div>Ivan<br><br>--<br>festina lente<div><br></div></div><div><div class="h5"><div><br>On 30 Oct 2013, at 15:58, Daniel Goertzen <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br></div><blockquote type="cite"><div><div dir="ltr">Well, this sort of works.� I tried this in the response handler:<br><div><br>��� ��� ��� {ok, Req2} = cowboy_req:reply(404, [] , <<"this is the body that gets used">>, Req1),<br><br> +��� ��� ��� {<<"this body gets ignored">>, Req2, State};<br><br> +<br><br><br></div><div>The client receives a 404 response, but cowboy crashes:<br><br>=ERROR REPORT==== 8-Sep-2013::22:22:03 ===<br>Error in process <0.131.0> with exit value: {function_clause,[{cowboy_req,reply,[200,[],<<31 bytes>>,{http_req,#Port<0.1208>,ranch_tcp,keepalive,<0.131.0>,<<3 bytes>>,'HTTP/1.1',{{192,168,1,187},51017},<<12 bytes>>,undefined,80,<<24 bytes>>,undefined,<<0 bytes>>,undefined,[{channel_num,3}],[{<<10 bytes>>,<<11 bytes>>},{<<4 bytes>>,<<12 bytes>>},{<<6 bytes>>,<<3 bytes>>}],[{<<17 bytes>>,undefined},{<<13 bytes>>,undefined},{<<19 bytes>>,undefined},{<<8 bytes>>,undefined},{<<6 bytes>>,[... <br><br> +<br> +<br><br><br></div><div>The issue is that the REST wrapper wants to do the cowboy_req:reply(), and when we do the call we cause the wrapper's call to fail. </div><br><div>Dan.<br></div><div><br></div></div><div class="gmail_extra"><br> +<br> +<br><br><div class="gmail_quote">On Tue, Oct 29, 2013 at 4:01 PM, Ivan uemlianin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<br> +<div dir="auto"><div>Sorry for terse but I only have a phone. Why can't you return a 404 here? �Using something like cowboy:reply(404, ...</div><div><br></div><div>Ivan<br><br>--<br>festina lente<div><br></div></div><br> +<div><br> +<div><div><br>On 29 Oct 2013, at 21:25, Daniel Goertzen <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br> +<div><div><div>My situation is that I have a rest handler that may fail due to invalid url segments.� Example situation:<br><br><br><span style="font-family:courier new,monospace">init(_Transport, _Req, _Opts) -><br><br> +������� {upgrade, protocol, cowboy_rest}.<br><br>content_types_provided(Req, State) -><br>��� {[{<<"application/json">>, get_json}], Req, State}.<br><br>get_json(Req0, State) -><br>��� {Params, Req1} = lists:mapfoldl(fun cowboy_req:binding/2, Req0, [param1, param2, param3, ....]),<br><br> +<br> +<br> +<br>��� case catch other_module:request(Params) of<br>��� ��� {'EXIT', {badarg, _}} -><br></span></div><div><span style="font-family:courier new,monospace">��� ��� ��� hmmm, Params were bad and I would like to return a 404 code now.<br><br> +<br> +<br> +</span></div><div><span style="font-family:courier new,monospace">�� � �� Result -><br>��� ��� ��� {jiffy:encode(Result), Req1, State}<br>��� end.<br></span><br><br><br></div><div>So I would like to return a 404 code when my underlying request function fails, but it appears my choices are:<br><br> +<br> +<br> +</div><div><br>- return a 200 (ok) response with data.<br></div><div>- crash and cause a 500 (Internal Server Error) response to be returned.� Not exactly the sentiment I want.<br></div><div><div><br><br></div><div>Is there some other way to cause a 404 response?<br><br> +<br> +<br> +<br></div><div>I realize I could add path constraint functions, but I will be replicating logic from my underlying request function.� Furthermore, the constraint functions consider parameters in isolation, so that won't work if the validity of parameters is coupled.<br><br> +<br> +<br> +</div><div><br></div><div>Thanks,<br>Dan.<br></div></div></div></div></div><br> +</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Extend mailing list</span><br><span><a href="mailto:[email protected]" target="_blank">[email protected]</a></span><br><br> +<br> +<span><a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a></span><br></div></blockquote></div></blockquote></div><br></div><br> +</div></blockquote></div></div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131030/3ea4ac64/attachment.html b/archives/extend/attachments/20131030/3ea4ac64/attachment.html new file mode 100644 index 00000000..751be332 --- /dev/null +++ b/archives/extend/attachments/20131030/3ea4ac64/attachment.html @@ -0,0 +1,88 @@ +<tt> +<div dir="ltr"><div>That's what I was looking for, thanks!<br><br></div><div>Dan.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 30, 2013 at 10:25 AM, Tilman Holschuh <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why not let resource_exists/2 return false when your resource does not exist? You will get 404 on false. This way you separate the implementation for turning your data to json from checking if the request went to the correct resource.<br><br> +<br> +<span class="HOEnZb"><font color="#888888"><br><br> +- Tilman<br><br> +</font></span><div class="HOEnZb"><div class="h5"><br><br> +On 2013-10-30, at 7:58 AM, Daniel Goertzen wrote:<br><br> +<br><br> +> Well, this sort of works. �I tried this in the response handler:<br><br> +><br><br> +> � � � � � � {ok, Req2} = cowboy_req:reply(404, [] , <<"this is the body that gets used">>, Req1),<br><br> +> � � � � � � {<<"this body gets ignored">>, Req2, State};<br><br> +><br><br> +><br><br> +><br><br> +> The client receives a 404 response, but cowboy crashes:<br><br> +><br><br> +> =ERROR REPORT==== 8-Sep-2013::22:22:03 ===<br><br> +> Error in process <0.131.0> with exit value: {function_clause,[{cowboy_req,reply,[200,[],<<31 bytes>>,{http_req,#Port<0.1208>,ranch_tcp,keepalive,<0.131.0>,<<3 bytes>>,'HTTP/1.1',{{192,168,1,187},51017},<<12 bytes>>,undefined,80,<<24 bytes>>,undefined,<<0 bytes>>,undefined,[{channel_num,3}],[{<<10 bytes>>,<<11 bytes>>},{<<4 bytes>>,<<12 bytes>>},{<<6 bytes>>,<<3 bytes>>}],[{<<17 bytes>>,undefined},{<<13 bytes>>,undefined},{<<19 bytes>>,undefined},{<<8 bytes>>,undefined},{<<6 bytes>>,[...<br><br> +<br> +><br><br> +><br><br> +><br><br> +> The issue is that the REST wrapper wants to do the cowboy_req:reply(), and when we do the call we cause the wrapper's call to fail.<br><br> +><br><br> +> Dan.<br><br> +><br><br> +><br><br> +><br><br> +> On Tue, Oct 29, 2013 at 4:01 PM, Ivan uemlianin <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><br> +> Sorry for terse but I only have a phone. Why can't you return a 404 here? �Using something like cowboy:reply(404, ...<br><br> +><br><br> +> Ivan<br><br> +><br><br> +> --<br><br> +> festina lente<br><br> +><br><br> +><br><br> +> On 29 Oct 2013, at 21:25, Daniel Goertzen <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><br> +><br><br> +>> My situation is that I have a rest handler that may fail due to invalid url segments. �Example situation:<br><br> +>><br><br> +>><br><br> +>> init(_Transport, _Req, _Opts) -><br><br> +>> � � � � {upgrade, protocol, cowboy_rest}.<br><br> +>><br><br> +>> content_types_provided(Req, State) -><br><br> +>> � � {[{<<"application/json">>, get_json}], Req, State}.<br><br> +>><br><br> +>> get_json(Req0, State) -><br><br> +>> � � {Params, Req1} = lists:mapfoldl(fun cowboy_req:binding/2, Req0, [param1, param2, param3, ....]),<br><br> +>><br><br> +>> � � case catch other_module:request(Params) of<br><br> +>> � � � � {'EXIT', {badarg, _}} -><br><br> +>> � � � � � � hmmm, Params were bad and I would like to return a 404 code now.<br><br> +>> � � � � Result -><br><br> +>> � � � � � � {jiffy:encode(Result), Req1, State}<br><br> +>> � � end.<br><br> +>><br><br> +>><br><br> +>><br><br> +>> So I would like to return a 404 code when my underlying request function fails, but it appears my choices are:<br><br> +>><br><br> +>> - return a 200 (ok) response with data.<br><br> +>> - crash and cause a 500 (Internal Server Error) response to be returned. �Not exactly the sentiment I want.<br><br> +>><br><br> +>><br><br> +>> Is there some other way to cause a 404 response?<br><br> +>><br><br> +>> I realize I could add path constraint functions, but I will be replicating logic from my underlying request function. �Furthermore, the constraint functions consider parameters in isolation, so that won't work if the validity of parameters is coupled.<br><br> +<br> +>><br><br> +>> Thanks,<br><br> +>> Dan.<br><br> +>> _______________________________________________<br><br> +>> Extend mailing list<br><br> +>> <a href="mailto:[email protected]">[email protected]</a><br><br> +>> <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br><br> +><br><br> +> _______________________________________________<br><br> +> Extend mailing list<br><br> +> <a href="mailto:[email protected]">[email protected]</a><br><br> +> <a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a><br><br> +<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131030/460453c8/attachment.html b/archives/extend/attachments/20131030/460453c8/attachment.html new file mode 100644 index 00000000..ee5dfd0f --- /dev/null +++ b/archives/extend/attachments/20131030/460453c8/attachment.html @@ -0,0 +1,23 @@ +<tt> +<div dir="ltr">Well, this sort of works.� I tried this in the response handler:<br><div><br>��� ��� ��� {ok, Req2} = cowboy_req:reply(404, [] , <<"this is the body that gets used">>, Req1),<br>��� ��� ��� {<<"this body gets ignored">>, Req2, State};<br><br> +<br><br><br></div><div>The client receives a 404 response, but cowboy crashes:<br><br>=ERROR REPORT==== 8-Sep-2013::22:22:03 ===<br>Error in process <0.131.0> with exit value: {function_clause,[{cowboy_req,reply,[200,[],<<31 bytes>>,{http_req,#Port<0.1208>,ranch_tcp,keepalive,<0.131.0>,<<3 bytes>>,'HTTP/1.1',{{192,168,1,187},51017},<<12 bytes>>,undefined,80,<<24 bytes>>,undefined,<<0 bytes>>,undefined,[{channel_num,3}],[{<<10 bytes>>,<<11 bytes>>},{<<4 bytes>>,<<12 bytes>>},{<<6 bytes>>,<<3 bytes>>}],[{<<17 bytes>>,undefined},{<<13 bytes>>,undefined},{<<19 bytes>>,undefined},{<<8 bytes>>,undefined},{<<6 bytes>>,[... <br><br> +<br><br><br></div><div>The issue is that the REST wrapper wants to do the cowboy_req:reply(), and when we do the call we cause the wrapper's call to fail. </div><br><div>Dan.<br></div><div><br></div></div><div class="gmail_extra"><br> +<br><br><div class="gmail_quote">On Tue, Oct 29, 2013 at 4:01 PM, Ivan uemlianin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<div dir="auto"><div>Sorry for terse but I only have a phone. Why can't you return a 404 here? �Using something like cowboy:reply(404, ...</div><div><br></div><div>Ivan<br><br>--<br>festina lente<div><br></div></div><div><br> +<div class="h5"><div><br>On 29 Oct 2013, at 21:25, Daniel Goertzen <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br> +<div><div><div>My situation is that I have a rest handler that may fail due to invalid url segments.� Example situation:<br><br><br><span style="font-family:courier new,monospace">init(_Transport, _Req, _Opts) -><br><br> +������� {upgrade, protocol, cowboy_rest}.<br><br>content_types_provided(Req, State) -><br>��� {[{<<"application/json">>, get_json}], Req, State}.<br><br>get_json(Req0, State) -><br>��� {Params, Req1} = lists:mapfoldl(fun cowboy_req:binding/2, Req0, [param1, param2, param3, ....]),<br><br> +<br> +<br>��� case catch other_module:request(Params) of<br>��� ��� {'EXIT', {badarg, _}} -><br></span></div><div><span style="font-family:courier new,monospace">��� ��� ��� hmmm, Params were bad and I would like to return a 404 code now.<br><br> +<br> +</span></div><div><span style="font-family:courier new,monospace">�� � �� Result -><br>��� ��� ��� {jiffy:encode(Result), Req1, State}<br>��� end.<br></span><br><br><br></div><div>So I would like to return a 404 code when my underlying request function fails, but it appears my choices are:<br><br> +<br> +</div><div><br>- return a 200 (ok) response with data.<br></div><div>- crash and cause a 500 (Internal Server Error) response to be returned.� Not exactly the sentiment I want.<br></div><div><div><br><br></div><div>Is there some other way to cause a 404 response?<br><br> +<br> +<br></div><div>I realize I could add path constraint functions, but I will be replicating logic from my underlying request function.� Furthermore, the constraint functions consider parameters in isolation, so that won't work if the validity of parameters is coupled.<br><br> +<br> +</div><div><br></div><div>Thanks,<br>Dan.<br></div></div></div></div></div><br> +</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Extend mailing list</span><br><span><a href="mailto:[email protected]" target="_blank">[email protected]</a></span><br><br> +<span><a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a></span><br></div></blockquote></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20131030/6e8ec2f0/attachment.html b/archives/extend/attachments/20131030/6e8ec2f0/attachment.html new file mode 100644 index 00000000..e7d1542c --- /dev/null +++ b/archives/extend/attachments/20131030/6e8ec2f0/attachment.html @@ -0,0 +1,23 @@ +<tt> +<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Instead of <<"this body ignored">> can you return the atom halt?</div><div><br></div><div>#dontevenhaveanyofmycodewithme:(</div><div><br></div><div>Ivan<br><br>--<br>festina lente<div><br></div></div><div><br>On 30 Oct 2013, at 15:58, Daniel Goertzen <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Well, this sort of works. I tried this in the response handler:<br><div><br> {ok, Req2} = cowboy_req:reply(404, [] , <<"this is the body that gets used">>, Req1),<br> {<<"this body gets ignored">>, Req2, State};<br><br> +<br><br><br></div><div>The client receives a 404 response, but cowboy crashes:<br><br>=ERROR REPORT==== 8-Sep-2013::22:22:03 ===<br>Error in process <0.131.0> with exit value: {function_clause,[{cowboy_req,reply,[200,[],<<31 bytes>>,{http_req,#Port<0.1208>,ranch_tcp,keepalive,<0.131.0>,<<3 bytes>>,'HTTP/1.1',{{192,168,1,187},51017},<<12 bytes>>,undefined,80,<<24 bytes>>,undefined,<<0 bytes>>,undefined,[{channel_num,3}],[{<<10 bytes>>,<<11 bytes>>},{<<4 bytes>>,<<12 bytes>>},{<<6 bytes>>,<<3 bytes>>}],[{<<17 bytes>>,undefined},{<<13 bytes>>,undefined},{<<19 bytes>>,undefined},{<<8 bytes>>,undefined},{<<6 bytes>>,[... <br><br> +<br><br><br></div><div>The issue is that the REST wrapper wants to do the cowboy_req:reply(), and when we do the call we cause the wrapper's call to fail. </div><br><div>Dan.<br></div><div><br></div></div><div class="gmail_extra"><br> +<br><br><div class="gmail_quote">On Tue, Oct 29, 2013 at 4:01 PM, Ivan uemlianin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<div dir="auto"><div>Sorry for terse but I only have a phone. Why can't you return a 404 here? Using something like cowboy:reply(404, ...</div><div><br></div><div>Ivan<br><br>--<br>festina lente<div><br></div></div><div><br> +<div class="h5"><div><br>On 29 Oct 2013, at 21:25, Daniel Goertzen <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br> +<div><div><div>My situation is that I have a rest handler that may fail due to invalid url segments. Example situation:<br><br><br><span style="font-family:courier new,monospace">init(_Transport, _Req, _Opts) -><br><br> + {upgrade, protocol, cowboy_rest}.<br><br>content_types_provided(Req, State) -><br> {[{<<"application/json">>, get_json}], Req, State}.<br><br>get_json(Req0, State) -><br> {Params, Req1} = lists:mapfoldl(fun cowboy_req:binding/2, Req0, [param1, param2, param3, ....]),<br><br> +<br> +<br> case catch other_module:request(Params) of<br> {'EXIT', {badarg, _}} -><br></span></div><div><span style="font-family:courier new,monospace"> hmmm, Params were bad and I would like to return a 404 code now.<br><br> +<br> +</span></div><div><span style="font-family:courier new,monospace"> Result -><br> {jiffy:encode(Result), Req1, State}<br> end.<br></span><br><br><br></div><div>So I would like to return a 404 code when my underlying request function fails, but it appears my choices are:<br><br> +<br> +</div><div><br>- return a 200 (ok) response with data.<br></div><div>- crash and cause a 500 (Internal Server Error) response to be returned. Not exactly the sentiment I want.<br></div><div><div><br><br></div><div>Is there some other way to cause a 404 response?<br><br> +<br> +<br></div><div>I realize I could add path constraint functions, but I will be replicating logic from my underlying request function. Furthermore, the constraint functions consider parameters in isolation, so that won't work if the validity of parameters is coupled.<br><br> +<br> +</div><div><br></div><div>Thanks,<br>Dan.<br></div></div></div></div></div><br> +</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Extend mailing list</span><br><span><a href="mailto:[email protected]" target="_blank">[email protected]</a></span><br><br> +<span><a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/listinfo/extend</a></span><br></div></blockquote></div></blockquote></div><br></div><br> +</div></blockquote></body></html> +</tt> diff --git a/archives/extend/attachments/20131115/79d7b0ce/attachment.html b/archives/extend/attachments/20131115/79d7b0ce/attachment.html new file mode 100644 index 00000000..77e3d85d --- /dev/null +++ b/archives/extend/attachments/20131115/79d7b0ce/attachment.html @@ -0,0 +1,45 @@ +<tt> +<p>Very excited to hear of this. Cowboy is very good to use.</p><br> +<div class="gmail_quote">On Nov 15, 2013 12:23 AM, "Lo�c Hoguin" <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello shiny people,<br><br> +<br><br> +Cowboy 0.9.0 has been released. Ranch 0.9.0 has been released too! So let's start with that.<br><br> +<br><br> +Ranch 0.9.0 is just stability improvements, better error reporting and a couple new SSL options.<br><br> +<br><br> +Cowboy 0.9.0 is using it of course, and also has official SPDY support (documented and everything!), a revamped cowboy_static (built-in mimetypes support, and also documented), tons of additions to the guide, tons of user patches and other changes you can find here:<br><br> +<br> +<br><br> +� * �<a href="https://github.com/extend/cowboy/blob/master/CHANGELOG.md" target="_blank">https://github.com/extend/<u></u>cowboy/blob/master/CHANGELOG.<u></u>md</a><br><br> +<br><br> +Which reminds me, I want to thank all 70 awesome contributors (myself included) that make the Cowboy project so fun to work on! So, thank you!<br><br> +<br><br> +When upgrading, please be aware that:<br><br> +<br><br> +� * �A dependency has been added, cowlib<br><br> +� * �Various undocumented functions have been moved to cowlib<br><br> +� * �The options for cowboy_static changed a lot, so read the guide<br><br> +� * �You need to set ERL_LIBS or equivalent for cowboy_static to find your private directory now<br><br> +<br><br> +You can find the updated guide on <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a> BUT do note that I'm migrating the site so if you do not see "Contribute to this site" in the bottom left next to "Contact", then you are on the old version and should probably head to github for your documentation needs, or use the files in your clone directly. I also have improvements left to make to the site to make navigating documentation easier, so stay tuned!<br><br> +<br> +<br><br> +Speaking of the guide, now all the examples, but also the getting started chapter of the guide, are releases. I am hopeful that this will make more people use releases by default instead of an awful start.sh script.<br><br> +<br><br> +For details on what's coming up next, see the ROADMAP. Next step (0.10) is finishing the request body work, fixing some timeout issues and adding proper multipart support for both requests and responses. This will be the last significant step before 1.0. I have hopes that all this will be ready around the time R17 is released.<br><br> +<br> +<br><br> +So yeah, enjoy! And as always please forward any feedback, especially related to the user guide as this is my main focus now.<br><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +Erlang Cowboy<br><br> +Nine Nines<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</blockquote></div><br> + +</tt> diff --git a/archives/extend/attachments/20131117/41119d53/attachment.html b/archives/extend/attachments/20131117/41119d53/attachment.html new file mode 100644 index 00000000..c7dbde9a --- /dev/null +++ b/archives/extend/attachments/20131117/41119d53/attachment.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr">Hello,<div><br></div><div>if I call cowboy_req:chunk on the same Req from several processes that run simultaneously, I am guaranteed that the chunks that these processes write to the socket will not interleave with each other?</div><br> +<div><br></div><div>thanks</div><div>Konstantin</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131120/6c3ab980/attachment.html b/archives/extend/attachments/20131120/6c3ab980/attachment.html new file mode 100644 index 00000000..5c0ee54e --- /dev/null +++ b/archives/extend/attachments/20131120/6c3ab980/attachment.html @@ -0,0 +1,34 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><br> +<div>Cowfolk ,</div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<div>Just upgraded to cowboy 0.9.0 from 0.8.7. Seeing this cowboy_clock error on all REST requests. Anyone seen it? Investigating now.</div><br> +<div><br><br> +</div><br> +<div>{badarg,[{ets,lookup_element,[cowboy_clock,rfc1123,2],[]}</div><br> +<div><br><br> +</div><br> +<div><br><br> +</div><br> +<div><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;">=ERROR REPORT==== 20-Nov-2013::16:24:59 ===</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;">Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.326.0> exit with reason: {badarg,[{ets,lookup_element,[cowboy_clock,rfc1123,2],[]},{cowboy_clock,rfc1123,0,[{file,"src/cowboy_clock.erl"},{line,62}]},{cowboy_req,reply_no_compress,8,[{file,"src/cowboy_req.erl"},{line,1056}]},{cowboy_req,reply,4,[{file,"src/cowboy_req.erl"},{line,1009}]},{cowboy_rest,respond,3,[{file,"src/cowboy_rest.erl"},{line,996}]},{cowboy_rest,set_resp_body,2,[{file,"src/cowboy_rest.erl"},{line,876}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,529}]}]}</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;">-kb</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +</div><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20131120/7808a87a/attachment.html b/archives/extend/attachments/20131120/7808a87a/attachment.html new file mode 100644 index 00000000..434e143b --- /dev/null +++ b/archives/extend/attachments/20131120/7808a87a/attachment.html @@ -0,0 +1,8 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +</head><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20131120/792230f4/attachment.html b/archives/extend/attachments/20131120/792230f4/attachment.html new file mode 100644 index 00000000..bc151557 --- /dev/null +++ b/archives/extend/attachments/20131120/792230f4/attachment.html @@ -0,0 +1,41 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><br> +<div>Because I wasn�t starting cow_lib. Don�t ask. </div><br> +<div><br><br> +</div><br> +<span id="OLK_SRC_BODY_SECTION"><br> +<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><br> +<span style="font-weight:bold">From: </span><Brown>, Kevin <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Date: </span>Wednesday, November 20, 2013 at 5:11 PM<br><br> +<span style="font-weight:bold">To: </span>"<a href="mailto:[email protected]">[email protected]</a>" <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Subject: </span>Re: cowboy 0.9.0: badarg ets:lookup_element cowboy_clock<br><br> +</div><br> +<div><br><br> +</div><br> +<div><br> +<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br> +<div><span style="font-size: 15px;">cowboy_clock not started. Not sure why that is, but.. </span></div><br> +<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><br> +<br><br> +</div><br> +<span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><br> +<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><br> +<span style="font-weight:bold">From: </span><Brown>, Kevin <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Date: </span>Wednesday, November 20, 2013 at 4:29 PM<br><br> +<span style="font-weight:bold">To: </span>"<a href="mailto:[email protected]">[email protected]</a>" <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Subject: </span>cowboy 0.9.0: badarg ets:lookup_element cowboy_clock<br><br> +</div><br> +<div><br><br> +</div><br> +<br class="Apple-interchange-newline"><br> +</span></div><br> +</div><br> +</span><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20131120/82981048/attachment.html b/archives/extend/attachments/20131120/82981048/attachment.html new file mode 100644 index 00000000..b1765579 --- /dev/null +++ b/archives/extend/attachments/20131120/82981048/attachment.html @@ -0,0 +1,25 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br> +<div><span style="font-size: 15px;">cowboy_clock not started. Not sure why that is, but.. </span></div><br> +<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><br> +<br><br> +</div><br> +<span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><br> +<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><br> +<span style="font-weight:bold">From: </span><Brown>, Kevin <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Date: </span>Wednesday, November 20, 2013 at 4:29 PM<br><br> +<span style="font-weight:bold">To: </span>"<a href="mailto:[email protected]">[email protected]</a>" <<a href="mailto:[email protected]">[email protected]</a>><br><br> +<span style="font-weight:bold">Subject: </span>cowboy 0.9.0: badarg ets:lookup_element cowboy_clock<br><br> +</div><br> +<div><br><br> +</div><br> +<br class="Apple-interchange-newline"><br> +</span><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20131121/7d69dbf7/attachment.html b/archives/extend/attachments/20131121/7d69dbf7/attachment.html new file mode 100644 index 00000000..5d9299b6 --- /dev/null +++ b/archives/extend/attachments/20131121/7d69dbf7/attachment.html @@ -0,0 +1,3 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hello,<div><br></div><div>For a Cowboy-based project I�m trying to use stable (<a href="https://github.com/dvv/stable">dvv/stable</a>, written by Vladimir Dronnikov). I keep running into problems. I contacted Vladimir and he stated that the current version of stable was compatible with Cowboy 0.8 and that he didn�t have the time to keep up with new cowboy releases. Is any of the list members using stable in a cowboy based project?</div><div><br></div><div>Kind regards,</div><div><br></div><div>Jan Willem Luiten</div></body></html> +</tt> diff --git a/archives/extend/attachments/20131122/11ccc1ef/attachment.html b/archives/extend/attachments/20131122/11ccc1ef/attachment.html new file mode 100644 index 00000000..ab98742d --- /dev/null +++ b/archives/extend/attachments/20131122/11ccc1ef/attachment.html @@ -0,0 +1,13 @@ +<tt> +<font face="arial" size="2"><p style="margin:0;padding:0;">Hello,</p><br> +<p style="margin:0;padding:0;"> </p><br> +<p style="margin:0;padding:0;">Does erlang.mk replace rebar?</p><br> +<p style="margin:0;padding:0;"> </p><br> +<p style="margin:0;padding:0;">Thanks,</p><br> +<p style="margin:0;padding:0;"> </p><br> +<p style="margin:0;padding:0;">LRP</p><br> +<p style="margin:0;padding:0;"> </p><br> +<!--WM_COMPOSE_SIGNATURE_START--><br> +<p style="margin:0;padding:0;">*********************************************<br />My books:<br /><br />THE GOSPEL OF ASHES<br />http://thegospelofashes.com<br /><br />Strength is not enough. Do they have the courage <br />and the cunning? Can they survive long enough to <br />save the lives of millions? <br /><br />FREEIN' PANCHO<br />http://freeinpancho.com<br /><br />A community of misfits help a troubled boy find his way <br /><br />AYA TAKEO<br />http://ayatakeo.com<br /><br />Star-crossed love, war and power in an alternative <br />universe<br /><br />Available through Amazon or by request from your <br />favorite bookstore<br /><br /><br />**********************************************</p><br> +<!--WM_COMPOSE_SIGNATURE_END--></font> +</tt> diff --git a/archives/extend/attachments/20131127/11da2202/attachment.html b/archives/extend/attachments/20131127/11da2202/attachment.html new file mode 100644 index 00000000..dad266a1 --- /dev/null +++ b/archives/extend/attachments/20131127/11da2202/attachment.html @@ -0,0 +1,8 @@ +<tt> +<div dir="ltr">Hi;<div><br></div><div>A post on this can be found <a href="http://dc0d.tumblr.com/post/68278862491/toddling-cowboy-carful-a-windows-on-your-way">here</a> (code on <a href="https://github.com/dc0d/lucky_luke">GitHub</a>).</div><br> +<div><br></div><div><div class="gmail_default"><span style="font-family:verdana,sans-serif"></span><font face="verdana, sans-serif">Are these things this way for a reason? (Because otherwise we I can not get samples to run.)</font></div><br> +<div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">1 - I have to add 'cowboy' to application list in myapp.app.src.</font></div><br> +<div class="gmail_default"><font face="verdana, sans-serif">2 - I have to add '{http_port, 9000}' to 'env' in myapp.app.src (where in the code should I add it?).</font></div><div class="gmail_default"><font face="verdana, sans-serif">3 - I have to explicitly make sure 'cowlib' is started (ok = application:start(cowlib) and I did not see this anywhere but whitout this, it won't work).</font></div><br> +<div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">Thanks;</font></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131127/20905d98/attachment.html b/archives/extend/attachments/20131127/20905d98/attachment.html new file mode 100644 index 00000000..42cb7326 --- /dev/null +++ b/archives/extend/attachments/20131127/20905d98/attachment.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr">Hello,<div><br></div><div>I am seeing an error report in my logs:<div><br></div><div><div>=ERROR REPORT==== 27-Nov-2013::00:22:33 ===</div><div>Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.4803.9> exit with reason: {error,closed}</div><br> +</div><div><br></div><div>looks like this is not worth investigating. can someone please comment on this error?</div></div><div><br></div><div>thanks</div><div>Konstantin</div><div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131212/2697fbaa/attachment.html b/archives/extend/attachments/20131212/2697fbaa/attachment.html new file mode 100644 index 00000000..235b9b9b --- /dev/null +++ b/archives/extend/attachments/20131212/2697fbaa/attachment.html @@ -0,0 +1,13 @@ +<tt> +<div dir="ltr"><div>Hi,</div><div>�</div><div>I am using cowboy for our financial webservice platform.� We use token based authentication, but I want to give certain ip adresses full access without authentication.� I tried :</div><br> +<div>�</div><div><font face="Consolas"><font size="3">{{</font><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:rgb(0,102,204)!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">IP</code></font><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">, </code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:rgb(0,102,204)!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">Port</code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">}, </code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:rgb(0,102,204)!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">Req2</code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">} = </code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:rgb(255,20,147)!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">cowboy_req:peer</code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">(</code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:rgb(0,102,204)!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">Req</code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">).</code></div><br> +<div><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important"></code>�</div><br> +<div><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">but IP is always {127,0,0,1} - even on production (where request</code></div><br> +<div><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">are comming from different networks)</code></div><br> +<div><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important"></code>�</div><br> +<div><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">So my question is basically, Is there any way for me to see </code></div><br> +<div><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">frow which </code><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important">IP adresses the request is comming ?</code></div><br> +<div><code style="margin:0px!important;padding:0px!important;outline:0px!important;border-radius:0px!important;border:0px currentColor!important;width:auto!important;text-align:left;color:black!important;text-transform:none;line-height:15.39px;text-indent:0px;letter-spacing:normal;overflow:visible!important;font-family:Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace!important;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;word-spacing:0px;vertical-align:baseline!important;float:none!important;white-space:pre-wrap;min-height:inherit!important;background-image:none!important"></code>�</div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20131215/7c20ac97/attachment.html b/archives/extend/attachments/20131215/7c20ac97/attachment.html new file mode 100644 index 00000000..c5889031 --- /dev/null +++ b/archives/extend/attachments/20131215/7c20ac97/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">I have recently started using <a href="http://erlang.mk">erlang.mk</a> on MacOS X and OpenBSD, and have discovered that the sed escape \s on line 109 for inserting the module list in *.app does not work as intended on these OSs, because they do not use GNU sed. (\s just means the letter 's', not whitespace as in perl.) I expect all other BSD-based OSs to have the same issue.<div><br> +<br></div><div>Please consider using [[:space:]] instead. This works on both MacOS X and OpenBSD, as well as on Linux.<br clear="all"><div><br></div>-- <br>Christopher Vance<br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20131227/35c9f6e5/attachment.html b/archives/extend/attachments/20131227/35c9f6e5/attachment.html new file mode 100644 index 00000000..402339e2 --- /dev/null +++ b/archives/extend/attachments/20131227/35c9f6e5/attachment.html @@ -0,0 +1,3 @@ +<tt> +Quick guess, you may have an extra space or \r at the end of the PROJECT line in the Makefile.<br><br>Sent from my ASUS Padfone<br><br>[email protected] wrote:<br><br>>Hello,<br>><br>>*** GOAL: <br>><br>>Modify rest_pastebin in Cowboy examples.<br>><br>>*** PROCEDULE 1: <br>><br>>- Pulled Cowboy, including examples into local workstation<br>>- Copied rest_pastebin to a separate directory<br>>- Execute make<br>> Make compiles just fine<br>><br>>*** PROCEDUE 2 -- resulting in error<br>><br>>- delete the entire rest_pastebin application and recopy from the Cowboy pull<br>>- change all module names and references from rest_pastebin to tagr. Thus rest_pastebin_sup.erl becomes tagr_sup.erl<br>>- Execute make<br>> Make returns:<br>><br>>...<br>>make[1]: Leaving directory `/home/lloyd/Erl/CB/tagr/deps/cowboy'<br>> ERLC toppage_handler.erl tagr_sup.erl tagr_app.erl<br>> ERLC toppage_handler.erl tagr_sup.erl tagr_app.erl<br>> APP tagr .app.src<br>>cat: src/tagr: No such file or directory<br>>cat: .app.src: No such file or directory<br>>sed: can't read .app: No such file or directory<br>>make: *** [app] Error 2<br>><br>>Note that the filename tagr.app.src has somehow been modified to tagr .app.src<br>><br>>But here's the directory listing: <br>><br>>-rw-rw-r-- 1 lloyd lloyd 436 Dec 26 18:21 tagr_app.erl<br>>-rw-rw-r-- 1 lloyd lloyd 299 Dec 26 18:22 tagr.app.src<br>>-rw-rw-r-- 1 lloyd lloyd 382 Dec 26 18:22 tagr_sup.erl<br>>-rw-rw-r-- 1 lloyd lloyd 3568 Dec 26 18:23 toppage_handler.erl<br>><br>>I can load tagr.app.src in Vim. Using find I've searched for tagr and .app.src with negative results.<br>><br>>Further mystery. I substituted Rebar for relx. Tagr now compiles just fine.<br>><br>>*** Discussion<br>><br>>I stumbled on this problem after making fairly extensive modifications to rest_pastebin. Through much of the process it compiled just fine until it didn't. And from then on I could not get it to compile. I tried everything I could think of: careful source code review (at least 10 passes), searching for tagr .app.src, trying different names (e.g. tagger), rebooting my computer, etc., etc.<br>><br>>Eventually I reduced the problem to the absolute minimum: Change the string rest_pastebin to tagr everywhere relevant. <br>><br>>It's possible I'm missing something somewhere. But where should I look? Otherwise, is it possible that there is a subtle bug in relx?<br>><br>><br>>Many thanks,<br>><br>>Lloyd<br>><br>><br>><br>><br>><br>> <br>><br>><br>> <br>><br>><br>><br>>*********************************************<br>>My books:<br>><br>>THE GOSPEL OF ASHES<br>>http://thegospelofashes.com<br>><br>>Strength is not enough. Do they have the courage <br>>and the cunning? Can they survive long enough to <br>>save the lives of millions? <br>><br>>FREEIN' PANCHO<br>>http://freeinpancho.com<br>><br>>A community of misfits help a troubled boy find his way <br>><br>>AYA TAKEO<br>>http://ayatakeo.com<br>><br>>Star-crossed love, war and power in an alternative <br>>universe<br>><br>>Available through Amazon or by request from your <br>>favorite bookstore<br>><br>><br>>**********************************************<br>><br>>_______________________________________________<br>>Extend mailing list<br>>[email protected]<br>>https://lists.ninenines.eu/listinfo/extend<br> +</tt> diff --git a/archives/extend/attachments/20140203/088e7e6a/attachment.html b/archives/extend/attachments/20140203/088e7e6a/attachment.html new file mode 100644 index 00000000..4979bf48 --- /dev/null +++ b/archives/extend/attachments/20140203/088e7e6a/attachment.html @@ -0,0 +1,120 @@ +<tt> +<div dir="ltr">Ok,<div>it is more clear for me. </div><div><br></div><div>Last question I have is about content_types_provided function.</div><div><br></div><div>Is it safe to define it like this?</div><div><br></div><div><br> +<br> +content_types_provided(R, S) -></div><div> <span style="color:rgb(0,0,0);font-family:Helvetica;font-size:13px">ContentTypes = [{{<<"application">>, <<"json">>, '*'}, <b>undefined</b>}],</span></div><br> +<br> +<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:13px"> {ContentTypes, Req, State}.</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:13px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:13px"><br> +<br> +Callback in content_types_provided is useless for POST requests, as it won’t be called. </div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:13px">Is it safe to use <b>undefined </b>atom, to have a source code clearer?</div><br> +<br> +<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:13px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:13px"><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 7:37 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If Accept is sent and is different than text/html, yes.<br><br> +<br><br> +This is how HTTP is defined. If the client says it speaks only content-type X but you can only reply with content-type Y, you error out early and stop processing the request. On the other hand if the client doesn't say what content-type it speaks then the server can choose whichever one it wants.<div class="im"><br> +<br> +<br><br> +<br><br> +On 02/03/2014 07:26 PM, Łukasz Biedrycki wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +My application sends both headers: “Content-type” and “Accept” header<br><br> +using POST method.<br><br> +<br><br> +For POST rest handler do I have to specify both: content_types_accepted<br><br> +and content_types_provided to manage this kind of request?<br><br> +<br><br> +<br><br> +On Mon, Feb 3, 2014 at 7:23 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div><div class="h5"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + The content-type provided is relevant for any response, not just<br><br> + responses to GET requests. It defaults to text/html. If your client<br><br> + doesn't send that content-type, you have to define the callback.<br><br> +<br><br> + I notice that the documentation is incorrect about the relevant<br><br> + methods for this callback, I will open a ticket to fix it soon.<br><br> +<br><br> +<br><br> + On 02/03/2014 07:13 PM, Łukasz Biedrycki wrote:<br><br> +<br><br> + Hi,<br><br> + I have a rest handler that accepts POST and PUT requests with<br><br> + “application/json” content type.<br><br> +<br><br> + I have content_types_accepted function defined as follows:<br><br> +<br><br> + content_types_accepted(Req, State) -><br><br> +<br><br> +<br><br> + {[{‘application/json', from_json}], Req, State}.<br><br> +<br><br> +<br><br> +<br><br> + The problem I have is within a request that has two headers:<br><br> +<br><br> + *Content-type*: application/json<br><br> + *Accept*: application/json<br><br> +<br><br> + With this combination I receive *406*.<br><br> +<br><br> +<br><br> + You can repeat it with test:<br><br> +<br><br> + http_SUITE.erl:<br><br> + 1072 rest_postonly(Config) -><br><br> + 1073 Client = ?config(client, Config),<br><br> + 1074 Headers = [<br><br> + 1075 {<<"content-type">>, <<"text/plain">>},<br><br> + 1076 {<<"accept">>, <<"text/plain">>}<br><br> + 1077 ],<br></div></div><br> + 1078 {ok, Client2} = cowboy_client:request(<<"POST"<u></u>__>>,<div class="im"><br><br> + 1079 build_url("/postonly", Config), Headers, "12345",<br><br> + Client),<br></div><br> + 1080 {ok, 204, _, _} = cowboy_client:response(__<u></u>Client2).<div class="im"><br><br> +<br><br> + My solution to that was to add a content_types_provided function:<br><br> +<br><br> +<br><br> + content_types_provided(Req, State) -><br><br> +<br><br> +<br><br> + ContentTypes = [{{<<"application">>, <<"json">>, '*'}, to_json}],<br><br> +<br><br> +<br><br> + {ContentTypes, Req, State}.<br><br> +<br><br> +<br><br> +<br><br> + But it is useless as *to_json* callback registered is not called<br><br> + anyhow.<br><br> +<br><br> + Adding *content_types_provided* function is a correct solution<br><br> + in this case?<br><br> +<br><br> + Or I am missing something here?<br><br> + “Accept” header is not relevant only in case of GET requests?<br><br> +<br><br> + Thank for help,<br><br> + Łukasz Biedrycki<br><br> +<br><br> +<br></div><br> + ______________________________<u></u>___________________<br><br> + Extend mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">Extend@lists.<u></u>ninenines.eu</a>><br><br> + <a href="https://lists.ninenines.eu/__listinfo/extend" target="_blank">https://lists.ninenines.eu/__<u></u>listinfo/extend</a><div class="im"><br><br> + <<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a>><br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +</div></blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140203/104f8577/attachment.html b/archives/extend/attachments/20140203/104f8577/attachment.html new file mode 100644 index 00000000..c49806fb --- /dev/null +++ b/archives/extend/attachments/20140203/104f8577/attachment.html @@ -0,0 +1,28 @@ +<tt> +<div dir="ltr">Hi,<div>I have a rest handler that accepts POST and PUT requests with “application/json” content type. </div><div><br></div><div>I have content_types_accepted function defined as follows:</div><div><br></div><br> +<br> +<div><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(51,51,51);line-height:18px"><div class="" id="LC93" style="padding-left:10px"><span class="" style="color:rgb(153,0,0);font-weight:bold">content_types_accepted</span><span class="" style>(</span><span class="" style="color:teal">Req</span><span class="" style>,</span> <span class="" style="color:teal">State</span><span class="" style>)</span> <span class="" style="font-weight:bold">-></span></div><br> +<br> +<div class="" id="LC94" style="padding-left:10px"> <span class="" style>{[{</span><span class="" style>‘application/json'</span><span class="" style>,</span> <span class="" style>from_json</span><span class="" style>}],</span> <span class="" style="color:teal">Req</span><span class="" style>,</span> <span class="" style="color:teal">State</span><span class="" style>}.</span></div><br> +<br> +</pre></div><div><br></div><div>The problem I have is within a request that has two headers:</div><div><br></div><div><b>Content-type</b>: application/json</div><div><b>Accept</b>: application/json</div><div><br></div><div><br> +<br> +With this combination I receive <b>406</b>. </div><div><br></div><div>You can repeat it with test:</div><div><br></div><div>http_SUITE.erl:<br></div><div><div>1072 rest_postonly(Config) -></div><div>1073 Client = ?config(client, Config),</div><br> +<br> +<div>1074 Headers = [</div><div>1075 {<<"content-type">>, <<"text/plain">>},</div><div>1076 {<<"accept">>, <<"text/plain">>}</div><br> +<br> +<div>1077 ],</div><div>1078 {ok, Client2} = cowboy_client:request(<<"POST">>,</div><div>1079 build_url("/postonly", Config), Headers, "12345", Client),</div><div><br> +1080 {ok, 204, _, _} = cowboy_client:response(Client2).</div><br> +</div><div><br></div><div>My solution to that was to add a content_types_provided function:</div><div><br></div><div><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(51,51,51);line-height:18px"><br> +<br> +<div class="" id="LC108" style="padding-left:10px"><span class="" style="color:rgb(153,0,0);font-weight:bold">content_types_provided</span><span class="" style>(</span><span class="" style="color:teal">Req</span><span class="" style>,</span> <span class="" style="color:teal">State</span><span class="" style>)</span> <span class="" style="font-weight:bold">-></span></div><br> +<br> +<div class="" id="LC109" style="padding-left:10px"> <span class="" style="color:teal">ContentTypes</span> <span class="" style="font-weight:bold">=</span> <span class="" style>[{{</span><span class="" style="font-weight:bold"><<</span><span class="" style="color:rgb(221,17,68)">"application"</span><span class="" style="font-weight:bold">>></span><span class="" style>,</span> <span class="" style="font-weight:bold"><<</span><span class="" style="color:rgb(221,17,68)">"json"</span><span class="" style="font-weight:bold">>></span><span class="" style>,</span> <span class="" style>'*'</span><span class="" style>},</span> <span class="" style>to_json</span><span class="" style>}],</span></div><br> +<br> +<div class="" id="LC110" style="padding-left:10px"> <span class="" style>{</span><span class="" style="color:teal">ContentTypes</span><span class="" style>,</span> <span class="" style="color:teal">Req</span><span class="" style>,</span> <span class="" style="color:teal">State</span><span class="" style>}.</span></div><br> +<br> +</pre></div><div><br></div><div>But it is useless as <b>to_json</b> callback registered is not called anyhow.</div><div><br></div><div>Adding <b>content_types_provided</b> function is a correct solution in this case?</div><br> +<br> +<div>Or I am missing something here?</div><div>“Accept” header is not relevant only in case of GET requests?</div><div><br></div><div>Thank for help,</div><div>�ukasz Biedrycki</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140203/2982cff3/attachment.html b/archives/extend/attachments/20140203/2982cff3/attachment.html new file mode 100644 index 00000000..b011e41e --- /dev/null +++ b/archives/extend/attachments/20140203/2982cff3/attachment.html @@ -0,0 +1,82 @@ +<tt> +<div dir="ltr">My application sends both headers: “Content-type” and “Accept” header using POST method.<div><br><div>For POST rest handler do I have to specify both: content_types_accepted and content_types_provided to manage this kind of request?</div><br> +<br> +</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 7:23 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The content-type provided is relevant for any response, not just responses to GET requests. It defaults to text/html. If your client doesn't send that content-type, you have to define the callback.<br><br> +<br> +<br> +<br><br> +I notice that the documentation is incorrect about the relevant methods for this callback, I will open a ticket to fix it soon.<div class="im"><br><br> +<br><br> +On 02/03/2014 07:13 PM, Łukasz Biedrycki wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +Hi,<br><br> +I have a rest handler that accepts POST and PUT requests with<br><br> +“application/json” content type.<br><br> +<br><br> +I have content_types_accepted function defined as follows:<br><br> +<br><br> +content_types_accepted(Req, State) -><br><br> +<br><br> +<br><br> +{[{‘application/json', from_json}], Req, State}.<br><br> +<br><br> +<br><br> +<br><br> +The problem I have is within a request that has two headers:<br><br> +<br></div><br> +*Content-type*: application/json<br><br> +*Accept*: application/json<br><br> +<br><br> +With this combination I receive *406*.<div class="im"><br><br> +<br><br> +You can repeat it with test:<br><br> +<br><br> +http_SUITE.erl:<br><br> +1072 rest_postonly(Config) -><br><br> +1073 Client = ?config(client, Config),<br><br> +1074 Headers = [<br><br> +1075 {<<"content-type">>, <<"text/plain">>},<br><br> +1076 {<<"accept">>, <<"text/plain">>}<br><br> +1077 ],<br><br> +1078 {ok, Client2} = cowboy_client:request(<<"POST"<u></u>>>,<br><br> +1079 build_url("/postonly", Config), Headers, "12345", Client),<br><br> +1080 {ok, 204, _, _} = cowboy_client:response(<u></u>Client2).<br><br> +<br><br> +My solution to that was to add a content_types_provided function:<br><br> +<br><br> +<br><br> +content_types_provided(Req, State) -><br><br> +<br><br> +<br><br> +ContentTypes = [{{<<"application">>, <<"json">>, '*'}, to_json}],<br><br> +<br><br> +<br><br> +{ContentTypes, Req, State}.<br><br> +<br><br> +<br><br> +<br></div><br> +But it is useless as *to_json* callback registered is not called anyhow.<br><br> +<br><br> +Adding *content_types_provided* function is a correct solution in this case?<div class="im"><br><br> +Or I am missing something here?<br><br> +“Accept” header is not relevant only in case of GET requests?<br><br> +<br><br> +Thank for help,<br><br> +Łukasz Biedrycki<br><br> +<br><br> +<br></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140203/e84f6223/attachment.html b/archives/extend/attachments/20140203/e84f6223/attachment.html new file mode 100644 index 00000000..a936c1bd --- /dev/null +++ b/archives/extend/attachments/20140203/e84f6223/attachment.html @@ -0,0 +1,171 @@ +<tt> +<div dir="ltr">Perfect, thanks a lot!<div>Cheers,</div><div>Ł.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 3, 2014 at 8:15 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sure. It won't be called if not a GET or HEAD request so that's probably the best value you can return in your case.<div class="im"><br> +<br> +<br><br> +<br><br> +On 02/03/2014 08:08 PM, Łukasz Biedrycki wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +Ok,<br><br> +it is more clear for me.<br><br> +<br><br> +Last question I have is about content_types_provided function.<br><br> +<br><br> +Is it safe to define it like this?<br><br> +<br><br> +content_types_provided(R, S) -><br></div><br> +ContentTypes = [{{<<"application">>, <<"json">>, '*'}, *undefined*}],<div class="im"><br><br> + {ContentTypes, Req, State}.<br><br> +<br><br> +Callback in content_types_provided is useless for POST requests, as it<br><br> +won’t be called.<br></div><br> +Is it safe to use *undefined *atom, to have a source code clearer?<div class="im"><br><br> +<br><br> +<br><br> +<br><br> +<br><br> +On Mon, Feb 3, 2014 at 7:37 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class="im"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + If Accept is sent and is different than text/html, yes.<br><br> +<br><br> + This is how HTTP is defined. If the client says it speaks only<br><br> + content-type X but you can only reply with content-type Y, you error<br><br> + out early and stop processing the request. On the other hand if the<br><br> + client doesn't say what content-type it speaks then the server can<br><br> + choose whichever one it wants.<br><br> +<br><br> +<br><br> + On 02/03/2014 07:26 PM, Łukasz Biedrycki wrote:<br><br> +<br><br> + My application sends both headers: “Content-type” and “Accept”<br><br> + header<br><br> + using POST method.<br><br> +<br><br> + For POST rest handler do I have to specify both:<br><br> + content_types_accepted<br><br> + and content_types_provided to manage this kind of request?<br><br> +<br><br> +<br><br> + On Mon, Feb 3, 2014 at 7:23 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></div><div><div class="h5"><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>>> wrote:<br><br> +<br><br> + The content-type provided is relevant for any response, not<br><br> + just<br><br> + responses to GET requests. It defaults to text/html. If<br><br> + your client<br><br> + doesn't send that content-type, you have to define the<br><br> + callback.<br><br> +<br><br> + I notice that the documentation is incorrect about the relevant<br><br> + methods for this callback, I will open a ticket to fix it soon.<br><br> +<br><br> +<br><br> + On 02/03/2014 07:13 PM, Łukasz Biedrycki wrote:<br><br> +<br><br> + Hi,<br><br> + I have a rest handler that accepts POST and PUT<br><br> + requests with<br><br> + “application/json” content type.<br><br> +<br><br> + I have content_types_accepted function defined as follows:<br><br> +<br><br> + content_types_accepted(Req, State) -><br><br> +<br><br> +<br><br> + {[{‘application/json', from_json}], Req, State}.<br><br> +<br><br> +<br><br> +<br><br> + The problem I have is within a request that has two<br><br> + headers:<br><br> +<br><br> + *Content-type*: application/json<br><br> + *Accept*: application/json<br><br> +<br><br> + With this combination I receive *406*.<br><br> +<br><br> +<br><br> + You can repeat it with test:<br><br> +<br><br> + http_SUITE.erl:<br><br> + 1072 rest_postonly(Config) -><br><br> + 1073 Client = ?config(client, Config),<br><br> + 1074 Headers = [<br><br> + 1075 {<<"content-type">>, <<"text/plain">>},<br><br> + 1076 {<<"accept">>, <<"text/plain">>}<br><br> + 1077 ],<br><br> + 1078 {ok, Client2} =<br></div></div><br> + cowboy_client:request(<<"POST"<u></u>____>>,<div class="im"><br><br> +<br><br> + 1079 build_url("/postonly", Config), Headers,<br><br> + "12345",<br><br> + Client),<br><br> + 1080 {ok, 204, _, _} =<br></div><br> + cowboy_client:response(____<u></u>Client2).<div class="im"><br><br> +<br><br> +<br><br> + My solution to that was to add a content_types_provided<br><br> + function:<br><br> +<br><br> +<br><br> + content_types_provided(Req, State) -><br><br> +<br><br> +<br><br> + ContentTypes = [{{<<"application">>, <<"json">>, '*'},<br><br> + to_json}],<br><br> +<br><br> +<br><br> + {ContentTypes, Req, State}.<br><br> +<br><br> +<br><br> +<br><br> + But it is useless as *to_json* callback registered is<br><br> + not called<br><br> + anyhow.<br><br> +<br><br> + Adding *content_types_provided* function is a correct<br><br> + solution<br><br> + in this case?<br><br> +<br><br> + Or I am missing something here?<br><br> + “Accept” header is not relevant only in case of GET<br><br> + requests?<br><br> +<br><br> + Thank for help,<br><br> + Łukasz Biedrycki<br><br> +<br><br> +<br></div><br> + ______________________________<u></u>_____________________<div class="im"><br><br> + Extend mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">Extend@lists.<u></u>ninenines.eu</a>><br></div><br> + <mailto:<a href="mailto:Extend@lists." target="_blank">Extend@lists.</a>__<a href="http://ninenines.eu" target="_blank">ninenin<u></u>es.eu</a><br><br> + <mailto:<a href="mailto:[email protected]" target="_blank">Extend@lists.<u></u>ninenines.eu</a>>><br><br> + <a href="https://lists.ninenines.eu/____listinfo/extend" target="_blank">https://lists.ninenines.eu/___<u></u>_listinfo/extend</a><br><br> + <<a href="https://lists.ninenines.eu/__listinfo/extend" target="_blank">https://lists.ninenines.eu/__<u></u>listinfo/extend</a>><div class="im"><br><br> +<br><br> + <<a href="https://lists.ninenines.eu/__listinfo/extend" target="_blank">https://lists.ninenines.eu/__<u></u>listinfo/extend</a><br><br> + <<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a>>><br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +</div></blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140207/904cc7bf/attachment.html b/archives/extend/attachments/20140207/904cc7bf/attachment.html new file mode 100644 index 00000000..8f835851 --- /dev/null +++ b/archives/extend/attachments/20140207/904cc7bf/attachment.html @@ -0,0 +1,8 @@ +<tt> +<div dir="ltr">Hi,<div>in my application I would like to add some metrics per handler and per response http status code.</div><div><br></div><div>One way is to add on response callback function, but there I do not have an information about handler and handler opts.</div><br> +<br> +<div><br></div><div>Second way is to add a middleware, but then I do not have an information about response status code.</div><div><br></div><div>Frankly, I like second way more. </div><div>How do like an idea to add response status code to request record similar to: resp_headers or resp_body ?</div><br> +<br> +<div><br></div><div>Cheers,</div><div>Łukasz Biedrycki</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140210/1781c9d2/attachment.html b/archives/extend/attachments/20140210/1781c9d2/attachment.html new file mode 100644 index 00000000..571ccf79 --- /dev/null +++ b/archives/extend/attachments/20140210/1781c9d2/attachment.html @@ -0,0 +1,33 @@ +<tt> +<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I promise you, improving the code now to get rid of the warnings is worth it.</div><div><br></div><div>Ivan<br><br>--<br>festina lente<div><br></div></div><div><br>On 10 Feb 2014, at 19:22, "Anton Koval'" <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Thanks for explanation. <br>My situation: I'm developing some stuff in module. That module in some kind of "draft' state (e.g. some functions are unused), but regardless that I want to compile project in order to test some specific parts of that module. <br><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 10, 2014 at 8:48 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can just define ERLC_OPTS before you include <a href="http://erlang.mk" target="_blank">erlang.mk</a> and it'll use that instead. I'm not sure why you want to disable that though, warnings usually alert you of bugs in your code.<div class=""><br> +<br><br> +<br><br> +On 02/10/2014 07:44 PM, Anton Koval' wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +Hello,<br><br> +<br><br> +as I understand, by default `make all` performs compile with<br></div><br> +option**warnings_as_errors.**<u></u>How can I disable this option?<div class=""><br><br> +There are options described at<br><br> +<a href="https://github.com/extend/erlang.mk#options" target="_blank">https://github.com/extend/<u></u>erlang.mk#options</a> and I believe that<br></div><br> +|ERLC_OPTS should be filled with `-|warnings_as_errors`**. But it is<div class=""><br><br> +unclear for me where have I to add(put) that option?<br><br> +<br><br> +Thanks.<br><br> +<br><br> +<br></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> +</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Extend mailing list</span><br><span><a href="mailto:[email protected]">[email protected]</a></span><br><span><a href="https://lists.ninenines.eu/listinfo/extend">https://lists.ninenines.eu/listinfo/extend</a></span><br></div></blockquote></body></html> +</tt> diff --git a/archives/extend/attachments/20140210/2ae635a6/attachment.html b/archives/extend/attachments/20140210/2ae635a6/attachment.html new file mode 100644 index 00000000..2d045585 --- /dev/null +++ b/archives/extend/attachments/20140210/2ae635a6/attachment.html @@ -0,0 +1,33 @@ +<tt> +<div dir="ltr">Thanks for explanation. <br>My situation: I'm developing some stuff in module. That module in some kind of "draft' state (e.g. some functions are unused), but regardless that I want to compile project in order to test some specific parts of that module. <br><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 10, 2014 at 8:48 PM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can just define ERLC_OPTS before you include <a href="http://erlang.mk" target="_blank">erlang.mk</a> and it'll use that instead. I'm not sure why you want to disable that though, warnings usually alert you of bugs in your code.<div class=""><br> +<br><br> +<br><br> +On 02/10/2014 07:44 PM, Anton Koval' wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +Hello,<br><br> +<br><br> +as I understand, by default `make all` performs compile with<br></div><br> +option**warnings_as_errors.**<u></u>How can I disable this option?<div class=""><br><br> +There are options described at<br><br> +<a href="https://github.com/extend/erlang.mk#options" target="_blank">https://github.com/extend/<u></u>erlang.mk#options</a> and I believe that<br></div><br> +|ERLC_OPTS should be filled with `-|warnings_as_errors`**. But it is<div class=""><br><br> +unclear for me where have I to add(put) that option?<br><br> +<br><br> +Thanks.<br><br> +<br><br> +<br></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140210/a2b35e2f/attachment.html b/archives/extend/attachments/20140210/a2b35e2f/attachment.html new file mode 100644 index 00000000..363ec211 --- /dev/null +++ b/archives/extend/attachments/20140210/a2b35e2f/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hello,<br><br>as I understand, by default `make all` performs compile with option<strong><span class=""> </span></strong>warnings_as_errors.<strong><span class=""> </span></strong><span class="">How can I disable this option?<br><br> +There are options described at <a href="https://github.com/extend/erlang.mk#options">https://github.com/extend/erlang.mk#options</a> and I believe that </span><code>ERLC_OPTS should be filled with `-</code>warnings_as_errors`<strong><span class=""></span></strong>. But it is unclear for me where have I to add(put) that option?<br><br> +<br>Thanks.<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140210/b46e2bab/attachment.html b/archives/extend/attachments/20140210/b46e2bab/attachment.html new file mode 100644 index 00000000..edc309fa --- /dev/null +++ b/archives/extend/attachments/20140210/b46e2bab/attachment.html @@ -0,0 +1,15 @@ +<tt> +<div dir="ltr">Hi again,<div>another idea is to make environment (Env), which is passed between middlewares, a part of Request record, so I could have an access to it in onresponse callback.</div><div><br></div><div>Any of that makes sense?</div><br> +<br> +<div><br></div><div>Cheers,</div><div>Łukasz Biedrycki</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 7, 2014 at 5:56 PM, Łukasz Biedrycki <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div>in my application I would like to add some metrics per handler and per response http status code.</div><br> +<br> +<div><br></div><div>One way is to add on response callback function, but there I do not have an information about handler and handler opts.</div><br> +<div><br></div><div>Second way is to add a middleware, but then I do not have an information about response status code.</div><div><br></div><div>Frankly, I like second way more. </div><div>How do like an idea to add response status code to request record similar to: resp_headers or resp_body ?</div><br> +<br> +<br> +<div><br></div><div>Cheers,</div><div>Łukasz Biedrycki</div></div><br> +</blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140210/bf26d573/attachment.html b/archives/extend/attachments/20140210/bf26d573/attachment.html new file mode 100644 index 00000000..31d5ead2 --- /dev/null +++ b/archives/extend/attachments/20140210/bf26d573/attachment.html @@ -0,0 +1,60 @@ +<tt> +<div dir="ltr">Hey,<div>I didn’t know about that. </div><div>That is exactly what I need!</div><div>Thank you!</div><div><br></div><div>Cheers,</div><div>Łukasz Biedrycki</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><br> +<br> +On Mon, Feb 10, 2014 at 10:49 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +<br> +You have the meta values in Req which are passed everywhere. You can easily set and retrieve them.<div><div class="h5"><br><br> +<br><br> +On 02/10/2014 10:41 AM, Łukasz Biedrycki wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hi again,<br><br> +another idea is to make environment (Env), which is passed between<br><br> +middlewares, a part of Request record, so I could have an access to it in<br><br> +onresponse callback.<br><br> +<br><br> +Any of that makes sense?<br><br> +<br><br> +Cheers,<br><br> +Łukasz Biedrycki<br><br> +<br><br> +<br><br> +On Fri, Feb 7, 2014 at 5:56 PM, Łukasz Biedrycki <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +wrote:<br><br> +</blockquote><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi,<br><br> +in my application I would like to add some metrics per handler and per<br><br> +response http status code.<br><br> +<br><br> +One way is to add on response callback function, but there I do not have<br><br> +an information about handler and handler opts.<br><br> +<br><br> +Second way is to add a middleware, but then I do not have an information<br><br> +about response status code.<br><br> +<br><br> +Frankly, I like second way more.<br><br> +How do like an idea to add response status code to request record similar<br><br> +to: resp_headers or resp_body ?<br><br> +<br><br> +Cheers,<br><br> +Łukasz Biedrycki<br><br> +<br><br> +</blockquote><br> +<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140210/fa72e2ba/attachment.html b/archives/extend/attachments/20140210/fa72e2ba/attachment.html new file mode 100644 index 00000000..00f1bf63 --- /dev/null +++ b/archives/extend/attachments/20140210/fa72e2ba/attachment.html @@ -0,0 +1,41 @@ +<tt> +<div dir="ltr">Got it! :) <br>fixed all warnings and removed� ERLC_OPTS from Makefile.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 10, 2014 at 9:46 PM, Ivan Uemlianin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>I promise you, improving the code now to get rid of the warnings is worth it.</div><div><br></div><br> +<div>Ivan<br><br>--<br>festina lente<div><br></div></div><div><div class="h5"><div><br>On 10 Feb 2014, at 19:22, "Anton Koval'" <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br></div><blockquote type="cite"><div><div dir="ltr">Thanks for explanation. <br>My situation: I'm developing some stuff in module. That module in some kind of "draft' state (e.g. some functions are unused), but regardless that I want to compile project in order to test some specific parts of that module. <br><br> +<br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 10, 2014 at 8:48 PM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can just define ERLC_OPTS before you include <a href="http://erlang.mk" target="_blank">erlang.mk</a> and it'll use that instead. I'm not sure why you want to disable that though, warnings usually alert you of bugs in your code.<div><br> +<br> +<br><br> +<br><br> +On 02/10/2014 07:44 PM, Anton Koval' wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br> +Hello,<br><br> +<br><br> +as I understand, by default `make all` performs compile with<br></div><br> +option**warnings_as_errors.**<u></u>How can I disable this option?<div><br><br> +There are options described at<br><br> +<a href="https://github.com/extend/erlang.mk#options" target="_blank">https://github.com/extend/<u></u>erlang.mk#options</a> and I believe that<br></div><br> +|ERLC_OPTS should be filled with `-|warnings_as_errors`**. But it is<div><br><br> +unclear for me where have I to add(put) that option?<br><br> +<br><br> +Thanks.<br><br> +<br><br> +<br></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span><font color="#888888"><br> +</font></span></blockquote><span><font color="#888888"><br> +<br><br> +-- <br><br> +Lo�c Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> +</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Extend mailing list</span><br><span><a href="mailto:[email protected]" target="_blank">[email protected]</a></span><br><br> +<span><a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/listinfo/extend</a></span><br></div></blockquote></div></div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140303/52007acc/attachment.html b/archives/extend/attachments/20140303/52007acc/attachment.html new file mode 100644 index 00000000..de4f2988 --- /dev/null +++ b/archives/extend/attachments/20140303/52007acc/attachment.html @@ -0,0 +1,11 @@ +<tt> +<div dir="ltr">Hello,<br><br>I have next structure of my project:<br>.<br>├── deps<br>│ ├── cowboy<br>│ ├── cowlib<br>│ ├── erlang_iconv<br>│ ├── erlydtl<br>│ ├── mochiweb_xpath<br>│ └── ranch<br>├── ebin<br>│ ├── fetchers.beam<br>
<br> +│ ├── parsers.beam<br>│ └── wasearch_sup.beam<br>├── <a href="http://erlang.mk">erlang.mk</a><br>├── Makefile<br>├── _rel<br>│ └── ....<br>├── relx<br>├── relx.config<br>├── src<br>│ ├── fetchers.erl<br>│ ├── main_handler.erl<br>
<br> +│ ├── parsers.erl<br>│ ├── tests<br>│ │ ├── parsers_SUITE_data<br>│ │ ├── parsers_SUITE.erl<br>│ │ ├── ....<br>│ ├── wasearch_app.erl<br>│ ├── wasearch.app.src<br>│ └── wasearch_sup.erl<br>└── templates<br>
<br> + └── index.dtl<br><br>I would prefer to store tests not in `src` directory but rather in `tests` subdirectory. <br>Erlang.mk README says: You can run an individual test suite by using the special <code>test_*</code>
<br> +targets. For example if you have a common_test suite named <code>spdy</code>
<br> +and you want to run only this suite and not the others, you can
<br> +use the <code>make test_spdy</code> command.<br>And of course `make test_parsers` returns `no rule to make target` error. <br>Is there a way to run suites from custom directory with `make_<mod_name_with_suite>` command? <br>
<br> +</div>
<br> + +</tt> diff --git a/archives/extend/attachments/20140306/24422ef2/attachment.html b/archives/extend/attachments/20140306/24422ef2/attachment.html new file mode 100644 index 00000000..62741bf1 --- /dev/null +++ b/archives/extend/attachments/20140306/24422ef2/attachment.html @@ -0,0 +1,19 @@ +<tt> +<div dir="ltr">I also found the answer to my own question: custom middleware<div><br></div><div>I just created:</div><div><br></div><div><div>� �1 -module(authentication_middleware).</div><div>� �2</div><div>� �3 -behaviour(cowboy_middleware).</div><br> +<div>� �4</div><div>� �5 -export([execute/2]).</div><div>� �6</div><div>� �7 execute(Req, Env) -></div><div>� �8</div><div>� �9 � � {Path, Req1} = cowboy_req:path(Req),</div><div>� 10</div><div>� 11 � � case Path of</div><br> +<div>� 12 � � � � <<"/login.html">> -></div><div>� 13 � � � � � � {ok, Req1, Env};</div><div>� 14 � � � � <<"/do_login">> -></div><div>� 15 � � � � � � {ok, Req1, Env};</div><br> +<div>� 16 � � � � _ -></div><div>� 17 � � � � � � case id3as_security:is_request_authenticated(Req1) of</div><div>� 18 � � � � � � � � {error, eauth, Req2} -></div><div>� 19 � � � � � � � � � � {ok, Req4} = cowboy_req:reply(303, [{<<"Location">>, <<"/login.html">>}], "", Req2),</div><br> +<div>� 20 � � � � � � � � � � {halt, Req4};</div><div>� 21 � � � � � � � � {authenticated, _Id, Req2} -></div><div>� 22 � � � � � � � � � �{ok, Req2, Env}</div><div>� 23 � � � � � � end</div><div>� 24 � � end.</div></div><br> +<div><br></div><div>And put this between the cowboy_router and cowboy_handler and life is all good.</div><div><br></div><div>-Mark</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 12:47 AM, Mark Nijhof <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I want to create a module that basically sits between the incoming request and the http handler for that request to ensure a request is authenticated (using a cookie), if the request is not authenticated then I like to redirect to a specific login page (which should not be filtered).</div><br> +<br> +<div><br></div><div>Is this possible with Cowboy? Should I use the onrequest hook (not sure if I can force redirects from there) for that or is there a better way?</div><div><br></div><div>Cheers,</div><div><br></div><div><br> +<br> +-Mark<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div dir="ltr">Mark Nijhof<br><div><div>t: � <a href="https://twitter.com/MarkNijhof" target="_blank">@MarkNijhof</a><br>s: �marknijhof</div><br> +</div><div><br></div></div><br> +</font></span></div></div><br> +</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Mark Nijhof<br><div><div>t: � <a href="https://twitter.com/MarkNijhof" target="_blank">@MarkNijhof</a><br>s: �marknijhof</div></div><div><br></div><br> +</div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140306/6fa8fe3b/attachment.html b/archives/extend/attachments/20140306/6fa8fe3b/attachment.html new file mode 100644 index 00000000..2754a31d --- /dev/null +++ b/archives/extend/attachments/20140306/6fa8fe3b/attachment.html @@ -0,0 +1,67 @@ +<tt> +<div dir="ltr">Thank you for answer. <br>Is it common way (for OTP-based application) to store tests in `tests` subdirectory rather then in `src/tests/`?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 4:40 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Tests should be in ./tests, not ./src/tests.<br><br> +<br><br> +If you put them in ./tests everything you mentioned will work.<div class=""><br><br> +<br><br> +On 03/03/2014 09:49 PM, Anton Koval' wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +Hello,<br><br> +<br><br> +I have next structure of my project:<br><br> +.<br><br> +├── deps<br><br> +│ ├── cowboy<br><br> +│ ├── cowlib<br><br> +│ ├── erlang_iconv<br><br> +│ ├── erlydtl<br><br> +│ ├── mochiweb_xpath<br><br> +│ └── ranch<br><br> +├── ebin<br><br> +│ ├── fetchers.beam<br><br> +│ ├── parsers.beam<br><br> +│ └── wasearch_sup.beam<br></div><br> +├── <a href="http://erlang.mk" target="_blank">erlang.mk</a> <<a href="http://erlang.mk" target="_blank">http://erlang.mk</a>><div><div class="h5"><br><br> +├── Makefile<br><br> +├── _rel<br><br> +│ └── ....<br><br> +├── relx<br><br> +├── relx.config<br><br> +├── src<br><br> +│ ├── fetchers.erl<br><br> +│ ├── main_handler.erl<br><br> +│ ├── parsers.erl<br><br> +│ ├── tests<br><br> +│ │ ├── parsers_SUITE_data<br><br> +│ │ ├── parsers_SUITE.erl<br><br> +│ │ ├── ....<br><br> +│ ├── wasearch_app.erl<br><br> +│ ├── wasearch.app.src<br><br> +│ └── wasearch_sup.erl<br><br> +└── templates<br><br> + └── index.dtl<br><br> +<br><br> +I would prefer to store tests not in `src` directory but rather in<br><br> +`tests` subdirectory.<br><br> +Erlang.mk README says: You can run an individual test suite by using the<br><br> +special |test_*| targets. For example if you have a common_test suite<br><br> +named |spdy| and you want to run only this suite and not the others, you<br><br> +can use the |make test_spdy| command.<br><br> +And of course `make test_parsers` returns `no rule to make target` error.<br><br> +Is there a way to run suites from custom directory with<br><br> +`make_<mod_name_with_suite>` command?<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140306/a517215b/attachment.html b/archives/extend/attachments/20140306/a517215b/attachment.html new file mode 100644 index 00000000..9f53e9df --- /dev/null +++ b/archives/extend/attachments/20140306/a517215b/attachment.html @@ -0,0 +1,7 @@ +<tt> +<div dir="ltr">Hi,<div><br></div><div>I want to create a module that basically sits between the incoming request and the http handler for that request to ensure a request is authenticated (using a cookie), if the request is not authenticated then I like to redirect to a specific login page (which should not be filtered).</div><br> +<div><br></div><div>Is this possible with Cowboy? Should I use the onrequest hook (not sure if I can force redirects from there) for that or is there a better way?</div><div><br></div><div>Cheers,</div><div><br></div><div><br> +-Mark<br clear="all"><div><br></div>-- <br><div dir="ltr">Mark Nijhof<br><div><div>t: � <a href="https://twitter.com/MarkNijhof" target="_blank">@MarkNijhof</a><br>s: �marknijhof</div></div><div><br></div></div><br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140314/b2f802d3/attachment.html b/archives/extend/attachments/20140314/b2f802d3/attachment.html new file mode 100644 index 00000000..a95a7cc4 --- /dev/null +++ b/archives/extend/attachments/20140314/b2f802d3/attachment.html @@ -0,0 +1,31 @@ +<tt> +<html><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br> +</head><br> +<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;">On a dev server I had a Cowboy app suddenly start returning timeouts when calling cowboy_req:body_qs(Request), with surprising frequency, which in turn led to 500s back to the calling client. It only<br> + appeared to happen when hitting one particular resource, and was sporadic, and I was wondering if there might be some explanation related to Cowboy (as opposed to maybe really weird VM issues). For full disclosure, we would first check the body with cowboy_req:body(Request)<br> + as part of an access log, then ignore the returned cowboy_req:req() that call passed back, since we could not then stream the body off of it again. It was working fine, so I don't think it was related, but it seems more solid now after I removed it and I don't<br> + know if that's related or not.</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;">Here is an example request that dumped when the process died - </p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;">{req,[{socket,#Port<0.7113>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.1805.0>},{method,<<"POST">>},{version,'HTTP/1.1'},{peer,{{10,188,32,225},53188}},{host,<<"bps-feedschedulervip1.turner.com">>},{host_info,undefined},{port,8091},{path,<<"/encoders/Player1/record">>},{path_info,[<<"record">>]},{qs,<<"authToken=…">>},{qs_vals,[{<<"authToken">>,<<"…">>}]},{bindings,[{id,<<"Player1">>}]},{headers,[{<<"host">>,<<"bps-feedschedulervip1.turner.com:8091">>},{<<"content-type">>,<<"application/x-www-form-urlencoded;<br> + charset=UTF-8">>},{<<"origin">>,<<"http://bps-newstrondev1.turner.com">>},{<<"content-length">>,<<"48">>},{<<"connection">>,<<"keep-alive">>},{<<"accept">>,<<"application/json, text/javascript, */*; q=0.01">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel<br> + Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9">>},{<<"referer">>,<<"http://bps-newstrondev1.turner.com/newstron/record/record.html">>},{<<"accept-language">>,<<"en-us">>},{<<"accept-encoding">>,<<"gzip, deflate">>}]},{p_headers,[{<<"content-type">>,{<<"application">>,<<"x-www-form-urlencoded">>,[{<<"charset">>,<<"utf-8">>}]}},{<<"if-modified-since">>,undefined},{<<"if-none-match">>,undefined},{<<"if-unmodified-since">>,undefined},{<<"if-match">>,undefined},{<<"accept">>,[{{<<"application">>,<<"json">>,[]},1000,[]},{{<<"text">>,<<"javascript">>,[]},1000,[]},{{<<"*">>,<<"*">>,[]},10,[]}]},{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[{charset,undefined},{media_type,{<<"application">>,<<"json">>,[]}}]},{body_state,waiting},{multipart,undefined},{buffer,<<>>},{resp_compress,false},{resp_state,waiting},{resp_headers,[{<<"content-type">>,[<<"application">>,<<"/">>,<<"json">>,<<>>]},{<<"Access-Control-Allow-Origin">>,<<"*">>}]},{resp_body,<<>>},{onresponse,#Fun<access_log_responder.onresponse.4>}]}</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;"><br><br> +</p><br> +<p style="margin: 0px; font-size: 11px; font-family: Menlo;">As I said, it may be just due to VM issues or something, but I figured I'd ask in case there was any obvious issue.</p><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20140411/9e3c6c32/attachment.html b/archives/extend/attachments/20140411/9e3c6c32/attachment.html new file mode 100644 index 00000000..00111e16 --- /dev/null +++ b/archives/extend/attachments/20140411/9e3c6c32/attachment.html @@ -0,0 +1,3 @@ +<tt> +<span style="font-family: Arial;">Please report it to erlang-bugs, you'll get better help with ssl bugs there.<br><br>-- <br>Loïc Hoguin<br>http://ninenines.eu</span><span style="font-family: Arial;"><br><br>-------- Original Message --------<br>From:Samir Sow <[email protected]><br>Sent:Fri, 11 Apr 2014 23:23:10 +0200<br>To:[email protected]<br>Subject:[99s-extend] ssl<br><br></span>Hi,<br><br>Still struggling with ssl.<br>I decided to check what’s going on at the ssl module level. Did a step by step ssl connection using the erlang ssl doc.<br>Found an error erlang:size badarg, but could not understand if it’s a problem with the key/cert files or with the data sent by the client.<br><br>Any help welcomed. Thx<br><br>Samir<br><br>{ok, SSLSocket} = ssl:ssl_accept(Socket, [{cacertfile, "priv/cert/cacert.crt"}, {certfile, "priv/cert/server.crt"}, {keyfile, "priv/cert/server.key"}]).<br>** exception exit: {{badarg,<br> [{erlang,size,<br> [[22,3,1,0,176,1,0,0,172,3,3,83,72,89,48,183,175,<br> 58,145,197,219|...]],<br> []},<br> {tls_record,get_tls_records_aux,2,<br> [{file,"tls_record.erl"},{line,122}]},<br> {tls_connection,next_tls_record,2,<br> [{file,"tls_connection.erl"},{line,484}]},<br> {tls_connection,handle_info,3,<br> [{file,"tls_connection.erl"},{line,307}]},<br> {gen_fsm,handle_msg,7,<br> [{file,"gen_fsm.erl"},{line,503}]},<br> {proc_lib,init_p_do_apply,3,<br> [{file,"proc_lib.erl"},{line,239}]}]},<br> {gen_fsm,sync_send_all_state_event,<br> [<0.105.0>,{start,infinity},infinity]}}<br> in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242)<br> in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, line 1649)<br> in call from ssl_connection:handshake/2 (ssl_connection.erl, line 97)<br> in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81)<br> in call from ssl_connection:ssl_accept/7 (ssl_connection.erl, line 84)<br>_______________________________________________<br>Extend mailing list<br>[email protected]<br>https://lists.ninenines.eu/listinfo/extend<br> +</tt> diff --git a/archives/extend/attachments/20140420/bf45e4d0/attachment-0001.bin b/archives/extend/attachments/20140420/bf45e4d0/attachment-0001.bin new file mode 100644 index 00000000..67d03d72 --- /dev/null +++ b/archives/extend/attachments/20140420/bf45e4d0/attachment-0001.bin @@ -0,0 +1,59 @@ +diff --git a/examples/websocket/priv/index.html b/examples/websocket/priv/index.html +index 5bc7f15..3e233fa 100644 +--- a/examples/websocket/priv/index.html ++++ b/examples/websocket/priv/index.html +@@ -1,7 +1,7 @@ + <html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +- <title>Websocket client</title> ++ <title>Websocket client foo</title> + <script src="/static/jquery.min.js"></script> + <script type="text/javascript"> + +@@ -13,7 +13,7 @@ + $('#status').append('<p><span style="color: red;">websockets are not supported </span></p>'); + $("#navigation").hide(); + } else { +- $('#status').append('<p><span style="color: green;">websockets are supported </span></p>'); ++ $('#status').append('<p><span style="color: green;">websockets are supported ok </span></p>'); + connect(); + }; + $("#connected").hide(); +diff --git a/examples/websocket/src/ws_handler.erl b/examples/websocket/src/ws_handler.erl +index bbbf716..cc73513 100644 +--- a/examples/websocket/src/ws_handler.erl ++++ b/examples/websocket/src/ws_handler.erl +@@ -8,10 +8,12 @@ + -export([websocket_terminate/3]). + + init({tcp, http}, _Req, _Opts) -> ++ io:format("[ws_handler:init] _Req ~p _Opts ~p", [_Req, _Opts]), + {upgrade, protocol, cowboy_websocket}. + + websocket_init(_TransportName, Req, _Opts) -> +- erlang:start_timer(1000, self(), <<"Hello!">>), ++ io:format("[websocket_init:init] Req ~p _Opts ~p", [Req, _Opts]), ++ % erlang:start_timer(1000, self(), <<"Hello!">>), + {ok, Req, undefined_state}. + + websocket_handle({text, Msg}, Req, State) -> +@@ -19,11 +21,15 @@ websocket_handle({text, Msg}, Req, State) -> + websocket_handle(_Data, Req, State) -> + {ok, Req, State}. + +-websocket_info({timeout, _Ref, Msg}, Req, State) -> +- erlang:start_timer(1000, self(), <<"How' you doin'?">>), +- {reply, {text, Msg}, Req, State}; ++% websocket_info({timeout, _Ref, Msg}, Req, State) -> ++% erlang:start_timer(1000, self(), <<"How' you doin'?">>), ++% {reply, {text, Msg}, Req, State}; + websocket_info(_Info, Req, State) -> ++ io:format("[ws_handler:websocket_info] _Info ~p Req ~p State ~p", ++ [_Info, Req, State]), + {ok, Req, State}. + + websocket_terminate(_Reason, _Req, _State) -> ++ io:format("[ws_handler:websocket_terminate] _Reason ~p _Req ~p State ~p", ++ [_Reason, _Req, _State]), + ok. diff --git a/archives/extend/attachments/20140420/bf45e4d0/attachment.bin b/archives/extend/attachments/20140420/bf45e4d0/attachment.bin new file mode 100644 index 00000000..68ecb32b --- /dev/null +++ b/archives/extend/attachments/20140420/bf45e4d0/attachment.bin @@ -0,0 +1,113 @@ +diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl +index 98e25e6..3f3016a 100644 +--- a/src/cowboy_websocket.erl ++++ b/src/cowboy_websocket.erl +@@ -62,6 +62,8 @@ + | {suspend, module(), atom(), [any()]} + when Req::cowboy_req:req(), Env::cowboy_middleware:env(). + upgrade(Req, Env, Handler, HandlerOpts) -> ++ io:format("[cowboy_websocket:upgrade] Req ~p, Env ~p, Handler ~p, HandlerOpts ~p", ++ [Req, Env, Handler, HandlerOpts]), + {_, Ref} = lists:keyfind(listener, 1, Env), + ranch:remove_connection(Ref), + [Socket, Transport] = cowboy_req:get([socket, transport], Req), +@@ -78,6 +80,8 @@ upgrade(Req, Env, Handler, HandlerOpts) -> + -spec websocket_upgrade(#state{}, Req) + -> {ok, #state{}, Req} when Req::cowboy_req:req(). + websocket_upgrade(State, Req) -> ++ io:format("[cowboy_websocket:websocket_upgrade] State ~p Req ~p", ++ [State, Req]), + {ok, ConnTokens, Req2} + = cowboy_req:parse_header(<<"connection">>, Req), + true = lists:member(<<"upgrade">>, ConnTokens), +@@ -96,6 +100,7 @@ websocket_upgrade(State, Req) -> + -spec websocket_extensions(#state{}, Req) + -> {ok, #state{}, Req} when Req::cowboy_req:req(). + websocket_extensions(State, Req) -> ++ io:format("[cowboy_websocket:websocket_extensions] State ~p Req ~p", [State, Req]), + case cowboy_req:parse_header(<<"sec-websocket-extensions">>, Req) of + {ok, Extensions, Req2} when Extensions =/= undefined -> + [Compress] = cowboy_req:get([resp_compress], Req), +@@ -129,6 +134,8 @@ websocket_extensions(State, Req) -> + when Req::cowboy_req:req(). + handler_init(State=#state{env=Env, transport=Transport, + handler=Handler}, Req, HandlerOpts) -> ++ io:format("[cowboy_websocket:handler_init] State ~p, Req ~p HandlerOpts ~p", ++ [State, Req, HandlerOpts]), + try Handler:websocket_init(Transport:name(), Req, HandlerOpts) of + {ok, Req2, HandlerState} -> + websocket_handshake(State, Req2, HandlerState); +@@ -162,6 +169,8 @@ handler_init(State=#state{env=Env, transport=Transport, + websocket_handshake(State=#state{ + transport=Transport, key=Key, deflate_frame=DeflateFrame}, + Req, HandlerState) -> ++ io:format("[cowboy_websocket:websocket_handshake] State ~p Req ~p HandlerState ~p", ++ [State, Req, HandlerState]), + %% @todo Change into crypto:hash/2 for R17B+ or when supporting only R16B+. + Challenge = base64:encode(crypto:sha( + << Key/binary, "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" >>)), +@@ -188,18 +197,24 @@ websocket_handshake(State=#state{ + handler_before_loop(State=#state{ + socket=Socket, transport=Transport, hibernate=true}, + Req, HandlerState, SoFar) -> ++ io:format("[cowboy_websocket:handler_before_loop 1] State ~p Req ~p HandlerState ~p SoFar ~p", ++ [State, Req, HandlerState, SoFar]), + Transport:setopts(Socket, [{active, once}]), + {suspend, ?MODULE, handler_loop, + [State#state{hibernate=false}, Req, HandlerState, SoFar]}; + handler_before_loop(State=#state{socket=Socket, transport=Transport}, + Req, HandlerState, SoFar) -> ++ io:format("[cowboy_websocket:handler_before_loop 2] State ~p Req ~p HandlerState ~p SoFar ~p", ++ [State, Req, HandlerState, SoFar]), + Transport:setopts(Socket, [{active, once}]), + handler_loop(State, Req, HandlerState, SoFar). + + -spec handler_loop_timeout(#state{}) -> #state{}. + handler_loop_timeout(State=#state{timeout=infinity}) -> ++ io:format("[cowboy_websocket:handler_loop_timeout 1] State ~p", [State]), + State#state{timeout_ref=undefined}; + handler_loop_timeout(State=#state{timeout=Timeout, timeout_ref=PrevRef}) -> ++ io:format("[cowboy_websocket:handler_loop_timeout 2] State ~p", [State]), + _ = case PrevRef of undefined -> ignore; PrevRef -> + erlang:cancel_timer(PrevRef) end, + TRef = erlang:start_timer(Timeout, self(), ?MODULE), +@@ -211,6 +226,8 @@ handler_loop_timeout(State=#state{timeout=Timeout, timeout_ref=PrevRef}) -> + when Req::cowboy_req:req(). + handler_loop(State=#state{socket=Socket, messages={OK, Closed, Error}, + timeout_ref=TRef}, Req, HandlerState, SoFar) -> ++ io:format("[cowboy_websocket:handler_loop_timeout] State ~p Req ~p HandlerState ~p SoFar ~p", ++ [State, Req, HandlerState, SoFar]), + receive + {OK, Socket, Data} -> + State2 = handler_loop_timeout(State), +@@ -516,6 +533,9 @@ is_utf8(_) -> + websocket_payload_loop(State=#state{socket=Socket, transport=Transport, + messages={OK, Closed, Error}, timeout_ref=TRef}, + Req, HandlerState, Opcode, Len, MaskKey, Unmasked, UnmaskedLen, Rsv) -> ++ io:format("[cowboy_websocket:websocket_payload_loop] State ~p Req ~p" ++ "HandlerState ~p Opcode ~p Len ~p MaskKey ~p Unmasked ~p UnmaskedLen ~p Rsv ~p", ++ [State, Req, HandlerState, Opcode, Len, MaskKey, Unmasked, UnmaskedLen, Rsv]), + Transport:setopts(Socket, [{active, once}]), + receive + {OK, Socket, Data} -> +@@ -726,6 +746,8 @@ websocket_send_many([Frame|Tail], State) -> + when Req::cowboy_req:req(). + websocket_close(State=#state{socket=Socket, transport=Transport}, + Req, HandlerState, Reason) -> ++ io:format("[cowboy_websocket:websocket_close] State ~p Req ~p HandlerState ~p Reason ~p", ++ [State, Req, HandlerState, Reason]), + case Reason of + {normal, _} -> + Transport:send(Socket, << 1:1, 0:3, 8:4, 0:1, 2:7, 1000:16 >>); +@@ -745,8 +767,10 @@ websocket_close(State=#state{socket=Socket, transport=Transport}, + -spec handler_terminate(#state{}, Req, any(), terminate_reason()) + -> {ok, Req, cowboy_middleware:env()} + when Req::cowboy_req:req(). +-handler_terminate(#state{env=Env, handler=Handler}, ++handler_terminate(#state{env=Env, handler=Handler} = State, + Req, HandlerState, TerminateReason) -> ++ io:format("[cowboy_websocket:handler_terminate] State ~p Req ~p HandlerState ~p TerminateReason ~p", ++ [State, Req, HandlerState, TerminateReason]), + try + Handler:websocket_terminate(TerminateReason, Req, HandlerState) + catch Class:Reason -> diff --git a/archives/extend/attachments/20140520/32454f85/attachment.html b/archives/extend/attachments/20140520/32454f85/attachment.html new file mode 100644 index 00000000..9b22f44b --- /dev/null +++ b/archives/extend/attachments/20140520/32454f85/attachment.html @@ -0,0 +1,28 @@ +<tt> +<div dir="ltr"><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">Hi, Loïc.</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br> +Thanks for having taken the time to reply. In some of my questions I think I didn't explain myself correctly so I'll give it another go.<br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im"><br> +On 20 May 2014 19:46, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +Hi,<div><br><br>On 05/20/2014 06:27 PM, Paulo F. Oliveira wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +Hello.<br><br>First of all, thanks for the great work you've done with cowboy. I've<br>been using it with a fait amount of success and I'm a fairly new Erlang<br>developer. I'm mainly interested in the REST "interface" of the<br><br> +application and its way of doing RESTful things, and I like the way you<br>did it (what with all the content_types_provided, service_available,<br>etc. functions). I've tested the way the system reacted to the different<br><br> +Accept, Content-Type, etc. headers and always got very well-opinionated<br>responses (406, 415, ...).<br><br>A couple of questions remain though (I'm sorry if they've been asked<br>already but I've searched the web for answers and read the available<br><br> +docs and couldn't find them):<br><br>1. is it expected that, if I use cowboy_req:reply/2 in a GET handler<br>(coming from content_types_provided), the onresponse/4 hook be called<br>twice? I guess one is due to the reply and the other one due to the<br><br> +workflow of the request, but is there a way to prevent the second execution?<br></blockquote><br></div>If you reply from a callback you must call {halt, Req, State} to stop processing.</blockquote><div><br></div></div><div><br> +Got it!</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +2. if I want to JSON-parse ALL my requests should I a) use the<br>onrequest/1 hook or b) do this on a per-request basis? Because I'd like<br>to reply with a 400 ASAP but keep going if the JSON validates (I'm going<br><br> +to use JSON-schema for validating input); and, if possible, have the<br>JSON-parsed body stored somewhere for future manipulation.<br></blockquote><br></div>It makes little sense to do it before the accept callback you define. Not only because you will duplicate content-type checks and whatnot, but also because you don't actually win anything from doing this. If you are using JSON, then JSON processing will take infinitely more resources than the REST code.</blockquote><br> +<div><br></div></div><div>OK, I'll probably stick with a "helper" function that'll do this for me and reply in case there are validation errors.</div><div>I only found the flow diagrams for the requests today after I had sent this message, and they helped a lot.</div><br> +<div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +3. I haven't seen examples that made use of the State (from the function<br>returns). When should I use this instead of the Request metadata? I'd<br>like to be able to set a generic error state for a request (either in<br><br> +meta ou State) and that have a "standard" error response be created at a<br>later time (in a unique function, for example - e.g. onresponse/4).<br></blockquote><br></div>State is for the functions within the current module. Look at cowboy_static for an example.</blockquote><br> +<div><br></div></div><div>State allows me to, well, keep state, for a request "travelling" through functions, right, and I can change it whenever I want just before returning from a function that is executed prior to another one (the only function for which this doesn't seem to make since is the last one cowboy calls before actually replying to the client)? At the same time, so does the request meta, from what I understood from the manual. So what is the difference between one and the other and when would you recommend one or the other.</div><br> +<div class="im"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +4. is there anything like a catch-all exception handler? I'd like to<br>catch exceptions that occur anywhere so I could log them and analyze<br>them at a later moment.<br></blockquote><br></div>You can add your own error_logger handler, or use something like lager. All errors end up sending a message to error_logger.</blockquote><br> +<div><br></div></div><div>I'll do this, thanks.</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +<div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'm probably abusing the onresponse/onrequest hooks already, so your<br><br> +answers should help me clarify this.<br></blockquote><br></div>Sounds like it!<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br> +Thanks.<br><br>- Paulo<br><br><br>______________________________<u></u>_________________<br>Extend mailing list<br><a href="mailto:[email protected]" target="_blank">[email protected]</a><br><a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><font color="#888888"></font></blockquote><font color="#888888"><br>-- <br>Loïc Hoguin<br><a href="http://ninenines.eu/" target="_blank">http://ninenines.eu</a><br></font></blockquote></div></div><br></div></div><div class="gmail_extra" style="font-family:arial,sans-serif;font-size:13px"><br> +Thanks.</div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140520/699b72b3/attachment.html b/archives/extend/attachments/20140520/699b72b3/attachment.html new file mode 100644 index 00000000..4e84adbe --- /dev/null +++ b/archives/extend/attachments/20140520/699b72b3/attachment.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr">Hi.<div><br></div><div>Do you think it should be possible to generate a 202 for a POST or a PUT? Is it something that will be implemented in a future version?</div><div><br></div><div>Many thanks.</div><div><br> +<br></div><div>- Paulo</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140520/cf7632e9/attachment.html b/archives/extend/attachments/20140520/cf7632e9/attachment.html new file mode 100644 index 00000000..a759aa50 --- /dev/null +++ b/archives/extend/attachments/20140520/cf7632e9/attachment.html @@ -0,0 +1,10 @@ +<tt> +<div dir="ltr">Hello.<div><br></div><div>First of all, thanks for the great work you've done with cowboy. I've been using it with a fait amount of success and I'm a fairly new Erlang developer. I'm mainly interested in the REST "interface" of the application and its way of doing RESTful things, and I like the way you did it (what with all the content_types_provided, service_available, etc. functions). I've tested the way the system reacted to the different Accept, Content-Type, etc. headers and always got very well-opinionated responses (406, 415, ...).</div><br> +<div><br></div><div>A couple of questions remain though (I'm sorry if they've been asked already but I've searched the web for answers and read the available docs and couldn't find them):</div><div><br></div><br> +<div>1. is it expected that, if I use cowboy_req:reply/2 in a GET handler (coming from content_types_provided), the onresponse/4 hook be called twice? I guess one is due to the reply and the other one due to the workflow of the request, but is there a way to prevent the second execution?</div><br> +<div><br></div><div>2. if I want to JSON-parse ALL my requests should I a) use the onrequest/1 hook or b) do this on a per-request basis? Because I'd like to reply with a 400 ASAP but keep going if the JSON validates (I'm going to use JSON-schema for validating input); and, if possible, have the JSON-parsed body stored somewhere for future manipulation.</div><br> +<div><br></div><div>3. I haven't seen examples that made use of the State (from the function returns). When should I use this instead of the Request metadata? I'd like to be able to set a generic error state for a request (either in meta ou State) and that have a "standard" error response be created at a later time (in a unique function, for example - e.g. onresponse/4).</div><br> +<div><br></div><div>4. is there anything like a catch-all exception handler? I'd like to catch exceptions that occur anywhere so I could log them and analyze them at a later moment.</div><div><br></div><div>I'm probably abusing the onresponse/onrequest hooks already, so your answers should help me clarify this.</div><br> +<div><br></div><div>Thanks.</div><div><br></div><div>- Paulo</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140604/269377d0/attachment-0001.html b/archives/extend/attachments/20140604/269377d0/attachment-0001.html new file mode 100644 index 00000000..8ab86955 --- /dev/null +++ b/archives/extend/attachments/20140604/269377d0/attachment-0001.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr"><div><div><div><div><div>I am having very good luck with Cowboy so far, but I have some questions:<br></div><br></div><div>1. There doesn't appear to be any way to do client certificate authorization in Cowboy, although I see there is an example for doing exactly that with Ranch. I think I could modify Cowboy to do what I want, but I thought I would ask if there were other options before doing that.<br><br> +<br></div></div>2. I am also looking at http basic auth. Would creating a middleware to sit in between cowboy_router and cowboy_handler be a typical way to go about it?<br><br></div>Thanks,<br></div>Dan.<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140604/269377d0/attachment.html b/archives/extend/attachments/20140604/269377d0/attachment.html new file mode 100644 index 00000000..8ab86955 --- /dev/null +++ b/archives/extend/attachments/20140604/269377d0/attachment.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr"><div><div><div><div><div>I am having very good luck with Cowboy so far, but I have some questions:<br></div><br></div><div>1. There doesn't appear to be any way to do client certificate authorization in Cowboy, although I see there is an example for doing exactly that with Ranch. I think I could modify Cowboy to do what I want, but I thought I would ask if there were other options before doing that.<br><br> +<br></div></div>2. I am also looking at http basic auth. Would creating a middleware to sit in between cowboy_router and cowboy_handler be a typical way to go about it?<br><br></div>Thanks,<br></div>Dan.<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140604/2bce99e1/attachment-0001.html b/archives/extend/attachments/20140604/2bce99e1/attachment-0001.html new file mode 100644 index 00000000..42d23829 --- /dev/null +++ b/archives/extend/attachments/20140604/2bce99e1/attachment-0001.html @@ -0,0 +1,18 @@ +<tt> +<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +I am having very good luck with Cowboy so far, but I have some questions:<br><br> +<br><br> +1. There doesn't appear to be any way to do client certificate<br><br> +authorization in Cowboy, although I see there is an example for doing<br><br> +exactly that with Ranch. I think I could modify Cowboy to do what I<br><br> +want, but I thought I would ask if there were other options before doing<br><br> +that.<br><br> +</blockquote><br> +<br></div><br> +Same as Ranch really, you just gotta take the socket and then call the ssl functions.<div class=""><br></div></blockquote><div><br></div><div>Yes, but in cowboy there's no API to get at the socket.</div><div><br></div><br> +<div>I was thinking of adding a "onconnect" hook similar to how there are "onrequest" and "onresponse" hooks. The hook would be called in cowboy_protocol:init(), would accept Transport and Socket, and return a "user connection state" term that gets stashed in the state record. The user connection state would then be provided in the Req object to each handler. With these features one could do whatever computation they want on the socket and provide the result to all subsequent requests on that socket. I want to use it for client cert checking, but it could be used for other things such as an IP address security check.</div><br> +<div><br></div><div>Dan.<br></div><div> </div></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140604/2bce99e1/attachment.html b/archives/extend/attachments/20140604/2bce99e1/attachment.html new file mode 100644 index 00000000..42d23829 --- /dev/null +++ b/archives/extend/attachments/20140604/2bce99e1/attachment.html @@ -0,0 +1,18 @@ +<tt> +<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +I am having very good luck with Cowboy so far, but I have some questions:<br><br> +<br><br> +1. There doesn't appear to be any way to do client certificate<br><br> +authorization in Cowboy, although I see there is an example for doing<br><br> +exactly that with Ranch. I think I could modify Cowboy to do what I<br><br> +want, but I thought I would ask if there were other options before doing<br><br> +that.<br><br> +</blockquote><br> +<br></div><br> +Same as Ranch really, you just gotta take the socket and then call the ssl functions.<div class=""><br></div></blockquote><div><br></div><div>Yes, but in cowboy there's no API to get at the socket.</div><div><br></div><br> +<div>I was thinking of adding a "onconnect" hook similar to how there are "onrequest" and "onresponse" hooks. The hook would be called in cowboy_protocol:init(), would accept Transport and Socket, and return a "user connection state" term that gets stashed in the state record. The user connection state would then be provided in the Req object to each handler. With these features one could do whatever computation they want on the socket and provide the result to all subsequent requests on that socket. I want to use it for client cert checking, but it could be used for other things such as an IP address security check.</div><br> +<div><br></div><div>Dan.<br></div><div> </div></div></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140604/407d3443/attachment-0001.html b/archives/extend/attachments/20140604/407d3443/attachment-0001.html new file mode 100644 index 00000000..42e6ce15 --- /dev/null +++ b/archives/extend/attachments/20140604/407d3443/attachment-0001.html @@ -0,0 +1,16 @@ +<tt> +<div dir="ltr">Hello.<div><br></div><div>You wrote <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/">here</a> that "The only mandatory callback is init/3, needed to perform the protocol upgrade."</div><br> +<div><br></div><div>In my code I have only this function for the protocol upgrade:</div><div><br></div><div><div>init({_TransportName, _ProtocolName}, _Req, []) -></div><div> {upgrade, protocol, cowboy_rest}.</div></div><br> +<div><br></div><div>On the other hand, when compiling, I get the following warnings:</div><div><br></div><div><div>src/handler_transactions.erl:3: Warning: undefined callback function handle/2 (behaviour 'cowboy_http_handler')</div><br> +<div>src/handler_transactions.erl:3: Warning: undefined callback function terminate/3 (behaviour 'cowboy_http_handler')</div></div><div><br></div><div>Is this the expected behavior? I know I _can_ ignore the warnings, but not if I want to use Erlang compiler option warnings_as_errors, for example.</div><br> +<div><br></div><div>Many thanks.</div><div><br></div><div>- Paulo F. Oliveira</div><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140604/407d3443/attachment.html b/archives/extend/attachments/20140604/407d3443/attachment.html new file mode 100644 index 00000000..42e6ce15 --- /dev/null +++ b/archives/extend/attachments/20140604/407d3443/attachment.html @@ -0,0 +1,16 @@ +<tt> +<div dir="ltr">Hello.<div><br></div><div>You wrote <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/">here</a> that "The only mandatory callback is init/3, needed to perform the protocol upgrade."</div><br> +<div><br></div><div>In my code I have only this function for the protocol upgrade:</div><div><br></div><div><div>init({_TransportName, _ProtocolName}, _Req, []) -></div><div> {upgrade, protocol, cowboy_rest}.</div></div><br> +<div><br></div><div>On the other hand, when compiling, I get the following warnings:</div><div><br></div><div><div>src/handler_transactions.erl:3: Warning: undefined callback function handle/2 (behaviour 'cowboy_http_handler')</div><br> +<div>src/handler_transactions.erl:3: Warning: undefined callback function terminate/3 (behaviour 'cowboy_http_handler')</div></div><div><br></div><div>Is this the expected behavior? I know I _can_ ignore the warnings, but not if I want to use Erlang compiler option warnings_as_errors, for example.</div><br> +<div><br></div><div>Many thanks.</div><div><br></div><div>- Paulo F. Oliveira</div><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140605/3ba15fb3/attachment-0001.html b/archives/extend/attachments/20140605/3ba15fb3/attachment-0001.html new file mode 100644 index 00000000..632ca0cc --- /dev/null +++ b/archives/extend/attachments/20140605/3ba15fb3/attachment-0001.html @@ -0,0 +1,42 @@ +<tt> +<div dir="ltr"><div>But then I would have to check the client cert for each and every request. I should have to check the cert only once at connect time and then be able to pass the result of that check in the request to each handler.<br><br> +<br></div>Anyway I've gone ahead and implemented what I need in a generic manner and it seems to work well. I think it would be a useful addition to Cowboy. If you agree I could write some more documentation for it.<br><br> +<div><br><a href="https://github.com/goertzenator/cowboy/tree/onconnect">https://github.com/goertzenator/cowboy/tree/onconnect</a><br><br></div><div>I added a "onconnect" hook and "connection metadata" to cowboy_req. The connection metadata works like existing metadata, but is preserved from request to request on the same connection. The onconnect hook provides initial values for the connection metadata.<br><br> +<br></div><div>Dan.<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 3:04 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/05/2014 01:44 AM, Daniel Goertzen wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +<br><br> +<br><br> +<br><br> +On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<br><br> + I am having very good luck with Cowboy so far, but I have some<br><br> + questions:<br><br> +<br><br> + 1. There doesn't appear to be any way to do client certificate<br><br> + authorization in Cowboy, although I see there is an example for<br><br> + doing<br><br> + exactly that with Ranch. I think I could modify Cowboy to do what I<br><br> + want, but I thought I would ask if there were other options<br><br> + before doing<br><br> + that.<br><br> +<br><br> +<br><br> + Same as Ranch really, you just gotta take the socket and then call<br><br> + the ssl functions.<br><br> +<br><br> +<br><br> +Yes, but in cowboy there's no API to get at the socket.<br><br> +</div></blockquote><br> +<br><br> +There is the undocumented function cowboy_req:get/1 which is meant for that kind of "special" use.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140605/3ba15fb3/attachment.html b/archives/extend/attachments/20140605/3ba15fb3/attachment.html new file mode 100644 index 00000000..632ca0cc --- /dev/null +++ b/archives/extend/attachments/20140605/3ba15fb3/attachment.html @@ -0,0 +1,42 @@ +<tt> +<div dir="ltr"><div>But then I would have to check the client cert for each and every request. I should have to check the cert only once at connect time and then be able to pass the result of that check in the request to each handler.<br><br> +<br></div>Anyway I've gone ahead and implemented what I need in a generic manner and it seems to work well. I think it would be a useful addition to Cowboy. If you agree I could write some more documentation for it.<br><br> +<div><br><a href="https://github.com/goertzenator/cowboy/tree/onconnect">https://github.com/goertzenator/cowboy/tree/onconnect</a><br><br></div><div>I added a "onconnect" hook and "connection metadata" to cowboy_req. The connection metadata works like existing metadata, but is preserved from request to request on the same connection. The onconnect hook provides initial values for the connection metadata.<br><br> +<br></div><div>Dan.<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 3:04 AM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/05/2014 01:44 AM, Daniel Goertzen wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +<br><br> +<br><br> +<br><br> +On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<br><br> + I am having very good luck with Cowboy so far, but I have some<br><br> + questions:<br><br> +<br><br> + 1. There doesn't appear to be any way to do client certificate<br><br> + authorization in Cowboy, although I see there is an example for<br><br> + doing<br><br> + exactly that with Ranch. I think I could modify Cowboy to do what I<br><br> + want, but I thought I would ask if there were other options<br><br> + before doing<br><br> + that.<br><br> +<br><br> +<br><br> + Same as Ranch really, you just gotta take the socket and then call<br><br> + the ssl functions.<br><br> +<br><br> +<br><br> +Yes, but in cowboy there's no API to get at the socket.<br><br> +</div></blockquote><br> +<br><br> +There is the undocumented function cowboy_req:get/1 which is meant for that kind of "special" use.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140605/46eee3c0/attachment-0001.html b/archives/extend/attachments/20140605/46eee3c0/attachment-0001.html new file mode 100644 index 00000000..54c2e082 --- /dev/null +++ b/archives/extend/attachments/20140605/46eee3c0/attachment-0001.html @@ -0,0 +1,47 @@ +<tt> +<div dir="ltr">Got it, thanks.<div><br></div><div>This <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/">here</a> had the fine print that I hadn't read apparently: "This module cannot be described as a behaviour due to most of the callbacks it defines being optional. It has the same semantics as a behaviour otherwise.<span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">"</span></div><br> +<div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">- Paulo F. Oliveira</span></div><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 June 2014 22:46, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You shouldn't say -behavior(cowboy_http_handler) if you don't actually implement it.<br><br> +<br><br> +On 06/04/2014 11:37 PM, Paulo F. Oliveira wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello.<br><br> +<br><br> +You wrote here<br><br> +<<a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_<u></u>rest/</a>> that "The<div><div class="h5"><br><br> +only mandatory callback is init/3, needed to perform the protocol upgrade."<br><br> +<br><br> +In my code I have only this function for the protocol upgrade:<br><br> +<br><br> +init({_TransportName, _ProtocolName}, _Req, []) -><br><br> + {upgrade, protocol, cowboy_rest}.<br><br> +<br><br> +On the other hand, when compiling, I get the following warnings:<br><br> +<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +handle/2 (behaviour 'cowboy_http_handler')<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +terminate/3 (behaviour 'cowboy_http_handler')<br><br> +<br><br> +Is this the expected behavior? I know I _can_ ignore the warnings, but<br><br> +not if I want to use Erlang compiler option warnings_as_errors, for example.<br><br> +<br><br> +Many thanks.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140605/46eee3c0/attachment.html b/archives/extend/attachments/20140605/46eee3c0/attachment.html new file mode 100644 index 00000000..54c2e082 --- /dev/null +++ b/archives/extend/attachments/20140605/46eee3c0/attachment.html @@ -0,0 +1,47 @@ +<tt> +<div dir="ltr">Got it, thanks.<div><br></div><div>This <a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/">here</a> had the fine print that I hadn't read apparently: "This module cannot be described as a behaviour due to most of the callbacks it defines being optional. It has the same semantics as a behaviour otherwise.<span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">"</span></div><br> +<div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">- Paulo F. Oliveira</span></div><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 June 2014 22:46, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You shouldn't say -behavior(cowboy_http_handler) if you don't actually implement it.<br><br> +<br><br> +On 06/04/2014 11:37 PM, Paulo F. Oliveira wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello.<br><br> +<br><br> +You wrote here<br><br> +<<a href="http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/HEAD/manual/cowboy_<u></u>rest/</a>> that "The<div><div class="h5"><br><br> +only mandatory callback is init/3, needed to perform the protocol upgrade."<br><br> +<br><br> +In my code I have only this function for the protocol upgrade:<br><br> +<br><br> +init({_TransportName, _ProtocolName}, _Req, []) -><br><br> + {upgrade, protocol, cowboy_rest}.<br><br> +<br><br> +On the other hand, when compiling, I get the following warnings:<br><br> +<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +handle/2 (behaviour 'cowboy_http_handler')<br><br> +src/handler_transactions.erl:<u></u>3: Warning: undefined callback function<br><br> +terminate/3 (behaviour 'cowboy_http_handler')<br><br> +<br><br> +Is this the expected behavior? I know I _can_ ignore the warnings, but<br><br> +not if I want to use Erlang compiler option warnings_as_errors, for example.<br><br> +<br><br> +Many thanks.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140606/b992565e/attachment-0001.html b/archives/extend/attachments/20140606/b992565e/attachment-0001.html new file mode 100644 index 00000000..3efb5468 --- /dev/null +++ b/archives/extend/attachments/20140606/b992565e/attachment-0001.html @@ -0,0 +1,89 @@ +<tt> +<div dir="ltr">Okay, I see how I can wrap cowboy_protocol:init() to perhaps add cert information to env or stuff it in an ets table / gproc / process dictionary. Is this what you mean? I think that will work for me.<div><br> +<br></div><div>My immediate application is to provide a secure RESTful API for a network appliance. Think securing the Web of Things. I really do want to get in the client's face if they don't have the right certificate.<br><br> +</div><div><br></div><div>I'm late in saying this, but thank you for making Cowboy so easy to read and understand.</div><div><br></div><div>Cheers,</div><div>Dan.</div><div><br></div></div><div class="gmail_extra"><br><br> +<br><div class="gmail_quote">On Thu, Jun 5, 2014 at 4:24 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Misunderstood what you needed then.<br><br> +<br><br> +Note that the services that are completely blocked from anyone who doesn't have the right cert are virtually non-existent, it doesn't make sense to add a feature for it.<br><br> +<br><br> +You can do that kind of thing by having custom code creating the protocol process by the way. There's no need to patch Cowboy for that.<div class=""><br><br> +<br><br> +On 06/05/2014 11:01 PM, Daniel Goertzen wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +But then I would have to check the client cert for each and every<br><br> +request. I should have to check the cert only once at connect time and<br><br> +then be able to pass the result of that check in the request to each<br><br> +handler.<br><br> +<br><br> +Anyway I've gone ahead and implemented what I need in a generic manner<br><br> +and it seems to work well. I think it would be a useful addition to<br><br> +Cowboy. If you agree I could write some more documentation for it.<br><br> +<br><br> +<a href="https://github.com/goertzenator/cowboy/tree/onconnect" target="_blank">https://github.com/<u></u>goertzenator/cowboy/tree/<u></u>onconnect</a><br><br> +<br><br> +I added a "onconnect" hook and "connection metadata" to cowboy_req. The<br><br> +connection metadata works like existing metadata, but is preserved from<br><br> +request to request on the same connection. The onconnect hook provides<br><br> +initial values for the connection metadata.<br><br> +<br><br> +Dan.<br><br> +<br><br> +<br><br> +<br><br> +<br><br> +On Thu, Jun 5, 2014 at 3:04 AM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + On 06/05/2014 01:44 AM, Daniel Goertzen wrote:<br><br> +<br><br> +<br><br> +<br><br> +<br><br> + On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></div><div><div class="h5"><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>>> wrote:<br><br> +<br><br> + On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<br><br> + I am having very good luck with Cowboy so far, but I<br><br> + have some<br><br> + questions:<br><br> +<br><br> + 1. There doesn't appear to be any way to do client<br><br> + certificate<br><br> + authorization in Cowboy, although I see there is an<br><br> + example for<br><br> + doing<br><br> + exactly that with Ranch. I think I could modify Cowboy<br><br> + to do what I<br><br> + want, but I thought I would ask if there were other options<br><br> + before doing<br><br> + that.<br><br> +<br><br> +<br><br> + Same as Ranch really, you just gotta take the socket and<br><br> + then call<br><br> + the ssl functions.<br><br> +<br><br> +<br><br> + Yes, but in cowboy there's no API to get at the socket.<br><br> +<br><br> +<br><br> + There is the undocumented function cowboy_req:get/1 which is meant<br><br> + for that kind of "special" use.<br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +</div></div></blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140606/b992565e/attachment.html b/archives/extend/attachments/20140606/b992565e/attachment.html new file mode 100644 index 00000000..3efb5468 --- /dev/null +++ b/archives/extend/attachments/20140606/b992565e/attachment.html @@ -0,0 +1,89 @@ +<tt> +<div dir="ltr">Okay, I see how I can wrap cowboy_protocol:init() to perhaps add cert information to env or stuff it in an ets table / gproc / process dictionary. Is this what you mean? I think that will work for me.<div><br> +<br></div><div>My immediate application is to provide a secure RESTful API for a network appliance. Think securing the Web of Things. I really do want to get in the client's face if they don't have the right certificate.<br><br> +</div><div><br></div><div>I'm late in saying this, but thank you for making Cowboy so easy to read and understand.</div><div><br></div><div>Cheers,</div><div>Dan.</div><div><br></div></div><div class="gmail_extra"><br><br> +<br><div class="gmail_quote">On Thu, Jun 5, 2014 at 4:24 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Misunderstood what you needed then.<br><br> +<br><br> +Note that the services that are completely blocked from anyone who doesn't have the right cert are virtually non-existent, it doesn't make sense to add a feature for it.<br><br> +<br><br> +You can do that kind of thing by having custom code creating the protocol process by the way. There's no need to patch Cowboy for that.<div class=""><br><br> +<br><br> +On 06/05/2014 11:01 PM, Daniel Goertzen wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br> +But then I would have to check the client cert for each and every<br><br> +request. I should have to check the cert only once at connect time and<br><br> +then be able to pass the result of that check in the request to each<br><br> +handler.<br><br> +<br><br> +Anyway I've gone ahead and implemented what I need in a generic manner<br><br> +and it seems to work well. I think it would be a useful addition to<br><br> +Cowboy. If you agree I could write some more documentation for it.<br><br> +<br><br> +<a href="https://github.com/goertzenator/cowboy/tree/onconnect" target="_blank">https://github.com/<u></u>goertzenator/cowboy/tree/<u></u>onconnect</a><br><br> +<br><br> +I added a "onconnect" hook and "connection metadata" to cowboy_req. The<br><br> +connection metadata works like existing metadata, but is preserved from<br><br> +request to request on the same connection. The onconnect hook provides<br><br> +initial values for the connection metadata.<br><br> +<br><br> +Dan.<br><br> +<br><br> +<br><br> +<br><br> +<br><br> +On Thu, Jun 5, 2014 at 3:04 AM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + On 06/05/2014 01:44 AM, Daniel Goertzen wrote:<br><br> +<br><br> +<br><br> +<br><br> +<br><br> + On Wed, Jun 4, 2014 at 4:48 PM, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></div><div><div class="h5"><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>>> wrote:<br><br> +<br><br> + On 06/04/2014 10:08 PM, Daniel Goertzen wrote:<br><br> +<br><br> + I am having very good luck with Cowboy so far, but I<br><br> + have some<br><br> + questions:<br><br> +<br><br> + 1. There doesn't appear to be any way to do client<br><br> + certificate<br><br> + authorization in Cowboy, although I see there is an<br><br> + example for<br><br> + doing<br><br> + exactly that with Ranch. I think I could modify Cowboy<br><br> + to do what I<br><br> + want, but I thought I would ask if there were other options<br><br> + before doing<br><br> + that.<br><br> +<br><br> +<br><br> + Same as Ranch really, you just gotta take the socket and<br><br> + then call<br><br> + the ssl functions.<br><br> +<br><br> +<br><br> + Yes, but in cowboy there's no API to get at the socket.<br><br> +<br><br> +<br><br> + There is the undocumented function cowboy_req:get/1 which is meant<br><br> + for that kind of "special" use.<br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +<br><br> +<br><br> +</div></div></blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140708/35d8806d/attachment-0001.html b/archives/extend/attachments/20140708/35d8806d/attachment-0001.html new file mode 100644 index 00000000..6a259b6a --- /dev/null +++ b/archives/extend/attachments/20140708/35d8806d/attachment-0001.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hello, y'all.<div><br></div><div>I'm using HTTP Basic Auth in my API. While calling cowboy_req:parse_header(<<"authorization>>", ... with an _invalid_ Authorization header such as "Authorization: Basic Test1" I get an error 500 back and an error log message on the server.</div><br> +<div><br></div><div>1. Is this the expected behavior? [if I understand correctly, my request is going through authorization(UserPass, Type = <<"basic">>) and this has no check for the string being correctly encoded]</div><br> +<div><br></div><div>2. what would be the best way to guard against this "error"?</div><div><br></div><div>Thanks.</div><div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140708/35d8806d/attachment.html b/archives/extend/attachments/20140708/35d8806d/attachment.html new file mode 100644 index 00000000..6a259b6a --- /dev/null +++ b/archives/extend/attachments/20140708/35d8806d/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hello, y'all.<div><br></div><div>I'm using HTTP Basic Auth in my API. While calling cowboy_req:parse_header(<<"authorization>>", ... with an _invalid_ Authorization header such as "Authorization: Basic Test1" I get an error 500 back and an error log message on the server.</div><br> +<div><br></div><div>1. Is this the expected behavior? [if I understand correctly, my request is going through authorization(UserPass, Type = <<"basic">>) and this has no check for the string being correctly encoded]</div><br> +<div><br></div><div>2. what would be the best way to guard against this "error"?</div><div><br></div><div>Thanks.</div><div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140708/497ef9a1/attachment-0001.html b/archives/extend/attachments/20140708/497ef9a1/attachment-0001.html new file mode 100644 index 00000000..71417659 --- /dev/null +++ b/archives/extend/attachments/20140708/497ef9a1/attachment-0001.html @@ -0,0 +1,41 @@ +<tt> +<div dir="ltr">Great, thanks.<div><br></div><div>I saw some changes "from 422 to 400" in recent versions (PUT and POST). Thanks for the heads up. As long as they're document, no harm shall come of these changes.</div><br> +<div><br></div><div>In any case, if I see it happen very often live I'll "protect" it agains the _bad_ header :-).</div><div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><div class="gmail_extra"><br> +<br><br><div class="gmail_quote">On 8 July 2014 14:21, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Parsing of any header may crash. Some may also return an error tuple, though that behavior slowly changes and it will always crash in 2.0. So just wrap the call around a try/catch if you need to handle the error.<br><br> +<br><br> +Note that at this exact moment I'm working on returning 400 instead of 500 automatically when parsing headers end up crashing (and possibly other situations later on).<div><div class="h5"><br><br> +<br><br> +On 07/08/2014 03:17 PM, Paulo F. Oliveira wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hello, y'all.<br><br> +<br><br> +I'm using HTTP Basic Auth in my API. While calling<br><br> +cowboy_req:parse_header(<<"<u></u>authorization>>", ... with an _invalid_<br><br> +Authorization header such as "Authorization: Basic Test1" I get an error<br><br> +500 back and an error log message on the server.<br><br> +<br><br> +1. Is this the expected behavior? [if I understand correctly, my request<br><br> +is going through authorization(UserPass, Type = <<"basic">>) and this<br><br> +has no check for the string being correctly encoded]<br><br> +<br><br> +2. what would be the best way to guard against this "error"?<br><br> +<br><br> +Thanks.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140708/497ef9a1/attachment.html b/archives/extend/attachments/20140708/497ef9a1/attachment.html new file mode 100644 index 00000000..71417659 --- /dev/null +++ b/archives/extend/attachments/20140708/497ef9a1/attachment.html @@ -0,0 +1,41 @@ +<tt> +<div dir="ltr">Great, thanks.<div><br></div><div>I saw some changes "from 422 to 400" in recent versions (PUT and POST). Thanks for the heads up. As long as they're document, no harm shall come of these changes.</div><br> +<div><br></div><div>In any case, if I see it happen very often live I'll "protect" it agains the _bad_ header :-).</div><div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><div class="gmail_extra"><br> +<br><br><div class="gmail_quote">On 8 July 2014 14:21, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Parsing of any header may crash. Some may also return an error tuple, though that behavior slowly changes and it will always crash in 2.0. So just wrap the call around a try/catch if you need to handle the error.<br><br> +<br><br> +Note that at this exact moment I'm working on returning 400 instead of 500 automatically when parsing headers end up crashing (and possibly other situations later on).<div><div class="h5"><br><br> +<br><br> +On 07/08/2014 03:17 PM, Paulo F. Oliveira wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +Hello, y'all.<br><br> +<br><br> +I'm using HTTP Basic Auth in my API. While calling<br><br> +cowboy_req:parse_header(<<"<u></u>authorization>>", ... with an _invalid_<br><br> +Authorization header such as "Authorization: Basic Test1" I get an error<br><br> +500 back and an error log message on the server.<br><br> +<br><br> +1. Is this the expected behavior? [if I understand correctly, my request<br><br> +is going through authorization(UserPass, Type = <<"basic">>) and this<br><br> +has no check for the string being correctly encoded]<br><br> +<br><br> +2. what would be the best way to guard against this "error"?<br><br> +<br><br> +Thanks.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br></div></div><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/2c08b12c/attachment-0001.html b/archives/extend/attachments/20140805/2c08b12c/attachment-0001.html new file mode 100644 index 00000000..ee087007 --- /dev/null +++ b/archives/extend/attachments/20140805/2c08b12c/attachment-0001.html @@ -0,0 +1,7 @@ +<tt> +<div dir="ltr"><div>Hi.</div><div><br></div><div>The image links are broken for the REST flowcharts' guide, part of cowboy.</div><div><br></div><a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/rest_start.png">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/rest_start.png</a> (for example)<br><br> +<div>should probably be</div><div><a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_start.png">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_start.png</a></div><div>according to the hierarchy here:</div><div><br> +<a href="https://github.com/ninenines/ninenines.github.io/tree/master/docs/en/cowboy/1.0/guide">https://github.com/ninenines/ninenines.github.io/tree/master/docs/en/cowboy/1.0/guide</a><br></div><div><br></div><div>Thanks.</div><br> +<div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/2c08b12c/attachment.html b/archives/extend/attachments/20140805/2c08b12c/attachment.html new file mode 100644 index 00000000..ee087007 --- /dev/null +++ b/archives/extend/attachments/20140805/2c08b12c/attachment.html @@ -0,0 +1,7 @@ +<tt> +<div dir="ltr"><div>Hi.</div><div><br></div><div>The image links are broken for the REST flowcharts' guide, part of cowboy.</div><div><br></div><a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/rest_start.png">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/rest_start.png</a> (for example)<br><br> +<div>should probably be</div><div><a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_start.png">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_start.png</a></div><div>according to the hierarchy here:</div><div><br> +<a href="https://github.com/ninenines/ninenines.github.io/tree/master/docs/en/cowboy/1.0/guide">https://github.com/ninenines/ninenines.github.io/tree/master/docs/en/cowboy/1.0/guide</a><br></div><div><br></div><div>Thanks.</div><br> +<div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/34528764/attachment-0001.html b/archives/extend/attachments/20140805/34528764/attachment-0001.html new file mode 100644 index 00000000..2d86cc8f --- /dev/null +++ b/archives/extend/attachments/20140805/34528764/attachment-0001.html @@ -0,0 +1,80 @@ +<tt> +<div dir="ltr">Yes, it should be _that_ easy for the 400 > 422 :D, but is that the only important difference I should be aware of, then? I haven't written any real tests, for the time being, to guarantee backward compatibility for dependants...<div><br> +<br></div><div>In any case, I'm thinking about updating the dependencies in the future (I own one of them and the other one is an internal project, for the time being).</div><div><br></div><div>Thanks for the tip.</div><br> +<div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 August 2014 21:55, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can easily send 422 and return halt instead of returning false if you need to keep that, it'll just be 2 lines instead of 1. :)<br><br> +<br> +<br><br> +On 08/05/2014 10:33 PM, Paulo F. Oliveira wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi, Federico.<br><br> +<br><br> +Check this out for the "why" regarding your question:<br><br> +<a href="https://github.com/ninenines/cowboy/issues/715" target="_blank">https://github.com/ninenines/<u></u>cowboy/issues/715</a><br><br> +<br><br> +It's one of the reasons (I haven't detected others yet) stopping me from<br><br> +moving to 1.0, unfortunately (I have some projects depending on these<br><br> +status codes already), but as soon as I have some time and look at all<br><br> +the _major_ differences between 0.9.0 and 1.0 I think I'll make the<br><br> +move. For the time being, I have found no issues with the REST part of<br><br> +cowboy (the one I use).<br><br> +<br><br> +Thank you, Loïc et all for the effort and for keeping it open source.<br><br> +<br><br> +Regards.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br><br> +On 5 August 2014 15:18, Federico Carrone <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<mailto:<a href="mailto:[email protected]" target="_blank">federico.carrone@<u></u>gmail.com</a>>> wrote:<br><br> +<br><br> + Congratulations Loic. I really love cowboy.<br><br> +<br><br> + I got only one question: Why did you change the reply with 400<br><br> + instead of 422 in cowboy_rest for unprocessable entities?<br><br> +<br><br> + Regards,<br><br> + Federico.<br><br> +<br><br> +<br><br> +<br><br> + On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><u></u>> wrote:<br><br> +<br><br> + Loic, it is very cool!<br><br> +<br><br> + Thanks.<br><br> +<br><br> + ______________________________<u></u>_________________<br><br> + erlang-questions mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">erlang-questions@<u></u>erlang.org</a>><br><br> + <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +<br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + <a href="http://federicocarrone.com/" target="_blank">http://federicocarrone.com/</a><br><br> +<br><br> + ______________________________<u></u>_________________<br><br> + erlang-questions mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">erlang-questions@<u></u>erlang.org</a>><br><br> + <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +<br><br> +<br><br> +<br><br> +<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/34528764/attachment.html b/archives/extend/attachments/20140805/34528764/attachment.html new file mode 100644 index 00000000..2d86cc8f --- /dev/null +++ b/archives/extend/attachments/20140805/34528764/attachment.html @@ -0,0 +1,80 @@ +<tt> +<div dir="ltr">Yes, it should be _that_ easy for the 400 > 422 :D, but is that the only important difference I should be aware of, then? I haven't written any real tests, for the time being, to guarantee backward compatibility for dependants...<div><br> +<br></div><div>In any case, I'm thinking about updating the dependencies in the future (I own one of them and the other one is an internal project, for the time being).</div><div><br></div><div>Thanks for the tip.</div><br> +<div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 August 2014 21:55, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can easily send 422 and return halt instead of returning false if you need to keep that, it'll just be 2 lines instead of 1. :)<br><br> +<br> +<br><br> +On 08/05/2014 10:33 PM, Paulo F. Oliveira wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi, Federico.<br><br> +<br><br> +Check this out for the "why" regarding your question:<br><br> +<a href="https://github.com/ninenines/cowboy/issues/715" target="_blank">https://github.com/ninenines/<u></u>cowboy/issues/715</a><br><br> +<br><br> +It's one of the reasons (I haven't detected others yet) stopping me from<br><br> +moving to 1.0, unfortunately (I have some projects depending on these<br><br> +status codes already), but as soon as I have some time and look at all<br><br> +the _major_ differences between 0.9.0 and 1.0 I think I'll make the<br><br> +move. For the time being, I have found no issues with the REST part of<br><br> +cowboy (the one I use).<br><br> +<br><br> +Thank you, Loïc et all for the effort and for keeping it open source.<br><br> +<br><br> +Regards.<br><br> +<br><br> +- Paulo F. Oliveira<br><br> +<br><br> +<br><br> +On 5 August 2014 15:18, Federico Carrone <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<mailto:<a href="mailto:[email protected]" target="_blank">federico.carrone@<u></u>gmail.com</a>>> wrote:<br><br> +<br><br> + Congratulations Loic. I really love cowboy.<br><br> +<br><br> + I got only one question: Why did you change the reply with 400<br><br> + instead of 422 in cowboy_rest for unprocessable entities?<br><br> +<br><br> + Regards,<br><br> + Federico.<br><br> +<br><br> +<br><br> +<br><br> + On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><u></u>> wrote:<br><br> +<br><br> + Loic, it is very cool!<br><br> +<br><br> + Thanks.<br><br> +<br><br> + ______________________________<u></u>_________________<br><br> + erlang-questions mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">erlang-questions@<u></u>erlang.org</a>><br><br> + <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +<br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + <a href="http://federicocarrone.com/" target="_blank">http://federicocarrone.com/</a><br><br> +<br><br> + ______________________________<u></u>_________________<br><br> + erlang-questions mailing list<br><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">erlang-questions@<u></u>erlang.org</a>><br><br> + <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +<br><br> +<br><br> +<br><br> +<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/a3d520b7/attachment-0001.html b/archives/extend/attachments/20140805/a3d520b7/attachment-0001.html new file mode 100644 index 00000000..1f172061 --- /dev/null +++ b/archives/extend/attachments/20140805/a3d520b7/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div class="gmail_extra">Loic, it is very cool!</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks.</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/a3d520b7/attachment.html b/archives/extend/attachments/20140805/a3d520b7/attachment.html new file mode 100644 index 00000000..1f172061 --- /dev/null +++ b/archives/extend/attachments/20140805/a3d520b7/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div class="gmail_extra">Loic, it is very cool!</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks.</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/f3705f7b/attachment-0001.html b/archives/extend/attachments/20140805/f3705f7b/attachment-0001.html new file mode 100644 index 00000000..4584493e --- /dev/null +++ b/archives/extend/attachments/20140805/f3705f7b/attachment-0001.html @@ -0,0 +1,30 @@ +<tt> +<div dir="ltr">Hi, Federico.<div><br></div><div>Check this out for the "why" regarding your question: <a href="https://github.com/ninenines/cowboy/issues/715">https://github.com/ninenines/cowboy/issues/715</a></div><br> +<div><br></div><div>It's one of the reasons (I haven't detected others yet) stopping me from moving to 1.0, unfortunately (I have some projects depending on these status codes already), but as soon as I have some time and look at all the _major_ differences between 0.9.0 and 1.0 I think I'll make the move. For the time being, I have found no issues with the REST part of cowboy (the one I use).</div><br> +<div><br></div><div>Thank you, <span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap">Loïc et all for the effort and for keeping it open source.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap"><br><br> +</span></div><div><font face="arial, sans-serif"><span style="white-space:nowrap">Regards.</span></font></div><div><font face="arial, sans-serif"><span style="white-space:nowrap"><br></span></font></div><div><font face="arial, sans-serif"><span style="white-space:nowrap">- Paulo F. Oliveira</span></font></div><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 August 2014 15:18, Federico Carrone <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Congratulations Loic. I really love cowboy.<div><br></div><div>I got only one question: Why did you change the reply with 400 instead of 422 in cowboy_rest for unprocessable entities?</div><br> +<div><br></div><div><br> +<br> +Regards,</div><div>Federico.<br><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div dir="ltr"><div class="gmail_extra">Loic, it is very cool!</div><div class="gmail_extra"><br></div><br> +<div class="gmail_extra"><br> +<br> +Thanks.</div></div><br> +<br></div><div class="">_______________________________________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br> +<br></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><a href="http://federicocarrone.com/" target="_blank">http://federicocarrone.com/</a><br></div><br> +<br> +</font></span></div><br> +<br>_______________________________________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br> +<br></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/f3705f7b/attachment.html b/archives/extend/attachments/20140805/f3705f7b/attachment.html new file mode 100644 index 00000000..4584493e --- /dev/null +++ b/archives/extend/attachments/20140805/f3705f7b/attachment.html @@ -0,0 +1,30 @@ +<tt> +<div dir="ltr">Hi, Federico.<div><br></div><div>Check this out for the "why" regarding your question: <a href="https://github.com/ninenines/cowboy/issues/715">https://github.com/ninenines/cowboy/issues/715</a></div><br> +<div><br></div><div>It's one of the reasons (I haven't detected others yet) stopping me from moving to 1.0, unfortunately (I have some projects depending on these status codes already), but as soon as I have some time and look at all the _major_ differences between 0.9.0 and 1.0 I think I'll make the move. For the time being, I have found no issues with the REST part of cowboy (the one I use).</div><br> +<div><br></div><div>Thank you, <span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap">Loïc et all for the effort and for keeping it open source.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px;white-space:nowrap"><br><br> +</span></div><div><font face="arial, sans-serif"><span style="white-space:nowrap">Regards.</span></font></div><div><font face="arial, sans-serif"><span style="white-space:nowrap"><br></span></font></div><div><font face="arial, sans-serif"><span style="white-space:nowrap">- Paulo F. Oliveira</span></font></div><br> +</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 August 2014 15:18, Federico Carrone <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Congratulations Loic. I really love cowboy.<div><br></div><div>I got only one question: Why did you change the reply with 400 instead of 422 in cowboy_rest for unprocessable entities?</div><br> +<div><br></div><div><br> +<br> +Regards,</div><div>Federico.<br><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<br> +<br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div dir="ltr"><div class="gmail_extra">Loic, it is very cool!</div><div class="gmail_extra"><br></div><br> +<div class="gmail_extra"><br> +<br> +Thanks.</div></div><br> +<br></div><div class="">_______________________________________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br> +<br></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><a href="http://federicocarrone.com/" target="_blank">http://federicocarrone.com/</a><br></div><br> +<br> +</font></span></div><br> +<br>_______________________________________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br> +<br></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/fb1bc75c/attachment-0001.html b/archives/extend/attachments/20140805/fb1bc75c/attachment-0001.html new file mode 100644 index 00000000..e9fb1a85 --- /dev/null +++ b/archives/extend/attachments/20140805/fb1bc75c/attachment-0001.html @@ -0,0 +1,58 @@ +<tt> +<p dir="ltr">Congrats Loic! </p><br> +<p dir="ltr">--<br><br> +Jesse Gumm<br><br> +Owner, Sigma Star Systems<br><br> +414.940.4866 || <a href="http://sigma-star.com">sigma-star.com</a> || @jessegumm</p><br> +<div class="gmail_quote">On Aug 5, 2014 7:43 AM, "Loïc Hoguin" <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello!<br><br> +<br><br> +Cowboy 1.0 has been released.<br><br> +<br><br> +Cowboy is a small and fast HTTP server for Erlang with support for Webmachine-like REST, Websocket and more.<br><br> +<br><br> + <a href="https://github.com/ninenines/cowboy" target="_blank">https://github.com/ninenines/<u></u>cowboy</a><br><br> +<br><br> +Cowboy is the work of more than 80 people. I would like to congratulate everyone for the great work done so far. Thank you!<br><br> +<br><br> +Please see the CHANGELOG for details on what's changed.<br><br> +<br><br> + <a href="https://github.com/ninenines/cowboy/blob/master/CHANGELOG.md" target="_blank">https://github.com/ninenines/<u></u>cowboy/blob/master/CHANGELOG.<u></u>md</a><br><br> +<br><br> +This release marks the beginning of the 1.0.x branch which will contain backward compatible fixes. This branch will be maintained at least until Cowboy 2.0 gets released (longer if sponsors request it). It is highly recommended that you follow this branch if you were following master before, as master will receive backward incompatible changes starting tomorrow.<br><br> +<br> +<br><br> +Cowboy is now fully documented. It has a user guide, a function reference manual, and a wealth of examples. You can also install man pages as explained in the README of the project.<br><br> +<br><br> + <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/1.0/guide/</a><br><br> + <a href="http://ninenines.eu/docs/en/cowboy/1.0/manual/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/1.0/manual/</a><br><br> + <a href="https://github.com/ninenines/cowboy/tree/master/examples" target="_blank">https://github.com/ninenines/<u></u>cowboy/tree/master/examples</a><br><br> +<br><br> +Following a discussion on the Erlang mailing lists the Getting Started chapter was reworked and greatly simplified, in parts due to the improvements made to <a href="http://erlang.mk" target="_blank">erlang.mk</a>. Feedback is of course always welcome.<br><br> +<br> +<br><br> + <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/getting_started/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/1.0/guide/getting_<u></u>started/</a><br><br> +<br><br> +Starting tomorrow the master branch will receive backward incompatible changes. Most of the planned changes are detailed in the ROADMAP. You are welcome to suggest additional changes.<br><br> +<br><br> + <a href="https://github.com/ninenines/cowboy/blob/master/ROADMAP.md" target="_blank">https://github.com/ninenines/<u></u>cowboy/blob/master/ROADMAP.md</a><br><br> +<br><br> +Cowboy 2.0 is planned to be released at around the same time Erlang/OTP 18.0 comes out. There are no plans for a Cowboy 1.1 at this time, although that may change in the coming months if there is interest in new features.<br><br> +<br> +<br><br> +Ranch also got upgraded to 1.0, although there was no changes from the previous release.<br><br> +<br><br> + <a href="https://github.com/ninenines/ranch" target="_blank">https://github.com/ninenines/<u></u>ranch</a><br><br> +<br><br> +Thanks to everyone who made this project what it is today!<br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</blockquote></div><br> + +</tt> diff --git a/archives/extend/attachments/20140805/fb1bc75c/attachment.html b/archives/extend/attachments/20140805/fb1bc75c/attachment.html new file mode 100644 index 00000000..e9fb1a85 --- /dev/null +++ b/archives/extend/attachments/20140805/fb1bc75c/attachment.html @@ -0,0 +1,58 @@ +<tt> +<p dir="ltr">Congrats Loic! </p><br> +<p dir="ltr">--<br><br> +Jesse Gumm<br><br> +Owner, Sigma Star Systems<br><br> +414.940.4866 || <a href="http://sigma-star.com">sigma-star.com</a> || @jessegumm</p><br> +<div class="gmail_quote">On Aug 5, 2014 7:43 AM, "Loïc Hoguin" <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hello!<br><br> +<br><br> +Cowboy 1.0 has been released.<br><br> +<br><br> +Cowboy is a small and fast HTTP server for Erlang with support for Webmachine-like REST, Websocket and more.<br><br> +<br><br> + <a href="https://github.com/ninenines/cowboy" target="_blank">https://github.com/ninenines/<u></u>cowboy</a><br><br> +<br><br> +Cowboy is the work of more than 80 people. I would like to congratulate everyone for the great work done so far. Thank you!<br><br> +<br><br> +Please see the CHANGELOG for details on what's changed.<br><br> +<br><br> + <a href="https://github.com/ninenines/cowboy/blob/master/CHANGELOG.md" target="_blank">https://github.com/ninenines/<u></u>cowboy/blob/master/CHANGELOG.<u></u>md</a><br><br> +<br><br> +This release marks the beginning of the 1.0.x branch which will contain backward compatible fixes. This branch will be maintained at least until Cowboy 2.0 gets released (longer if sponsors request it). It is highly recommended that you follow this branch if you were following master before, as master will receive backward incompatible changes starting tomorrow.<br><br> +<br> +<br><br> +Cowboy is now fully documented. It has a user guide, a function reference manual, and a wealth of examples. You can also install man pages as explained in the README of the project.<br><br> +<br><br> + <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/1.0/guide/</a><br><br> + <a href="http://ninenines.eu/docs/en/cowboy/1.0/manual/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/1.0/manual/</a><br><br> + <a href="https://github.com/ninenines/cowboy/tree/master/examples" target="_blank">https://github.com/ninenines/<u></u>cowboy/tree/master/examples</a><br><br> +<br><br> +Following a discussion on the Erlang mailing lists the Getting Started chapter was reworked and greatly simplified, in parts due to the improvements made to <a href="http://erlang.mk" target="_blank">erlang.mk</a>. Feedback is of course always welcome.<br><br> +<br> +<br><br> + <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/getting_started/" target="_blank">http://ninenines.eu/docs/en/<u></u>cowboy/1.0/guide/getting_<u></u>started/</a><br><br> +<br><br> +Starting tomorrow the master branch will receive backward incompatible changes. Most of the planned changes are detailed in the ROADMAP. You are welcome to suggest additional changes.<br><br> +<br><br> + <a href="https://github.com/ninenines/cowboy/blob/master/ROADMAP.md" target="_blank">https://github.com/ninenines/<u></u>cowboy/blob/master/ROADMAP.md</a><br><br> +<br><br> +Cowboy 2.0 is planned to be released at around the same time Erlang/OTP 18.0 comes out. There are no plans for a Cowboy 1.1 at this time, although that may change in the coming months if there is interest in new features.<br><br> +<br> +<br><br> +Ranch also got upgraded to 1.0, although there was no changes from the previous release.<br><br> +<br><br> + <a href="https://github.com/ninenines/ranch" target="_blank">https://github.com/ninenines/<u></u>ranch</a><br><br> +<br><br> +Thanks to everyone who made this project what it is today!<br><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br> +______________________________<u></u>_________________<br><br> +erlang-questions mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br><br> +</blockquote></div><br> + +</tt> diff --git a/archives/extend/attachments/20140813/7903a29a/attachment-0001.html b/archives/extend/attachments/20140813/7903a29a/attachment-0001.html new file mode 100644 index 00000000..23bc5d66 --- /dev/null +++ b/archives/extend/attachments/20140813/7903a29a/attachment-0001.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">hi,<br> +<div><br></div><div>is it possible to run eunit tests when executing make tests?</div><div>I have my tests directly in the modules (e.g. xyz_server)</div><div><br></div><div>Regards,</div><div><br></div><div>Michael</div><br> +<div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140813/7903a29a/attachment.html b/archives/extend/attachments/20140813/7903a29a/attachment.html new file mode 100644 index 00000000..23bc5d66 --- /dev/null +++ b/archives/extend/attachments/20140813/7903a29a/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">hi,<br> +<div><br></div><div>is it possible to run eunit tests when executing make tests?</div><div>I have my tests directly in the modules (e.g. xyz_server)</div><div><br></div><div>Regards,</div><div><br></div><div>Michael</div><br> +<div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140814/64f862ef/attachment-0001.html b/archives/extend/attachments/20140814/64f862ef/attachment-0001.html new file mode 100644 index 00000000..fe0f66a7 --- /dev/null +++ b/archives/extend/attachments/20140814/64f862ef/attachment-0001.html @@ -0,0 +1,3 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span style="font-family: LiberationMono; font-size: 11px;">Hello,</span><br style="font-family: LiberationMono; font-size: 11px;"><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">I would like to set a Content-Range header in the response of a HEAD request.</span><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Can I do that within the context of a cowboy_rest handler?</span><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Ideally, I wish to let cowboy_rest reply and just specify this additional header.</span><br style="font-family: LiberationMono; font-size: 11px;"><br style="font-family: LiberationMono; font-size: 11px;"><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Best,</span><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Camille</span></body></html> +</tt> diff --git a/archives/extend/attachments/20140814/64f862ef/attachment.html b/archives/extend/attachments/20140814/64f862ef/attachment.html new file mode 100644 index 00000000..fe0f66a7 --- /dev/null +++ b/archives/extend/attachments/20140814/64f862ef/attachment.html @@ -0,0 +1,3 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span style="font-family: LiberationMono; font-size: 11px;">Hello,</span><br style="font-family: LiberationMono; font-size: 11px;"><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">I would like to set a Content-Range header in the response of a HEAD request.</span><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Can I do that within the context of a cowboy_rest handler?</span><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Ideally, I wish to let cowboy_rest reply and just specify this additional header.</span><br style="font-family: LiberationMono; font-size: 11px;"><br style="font-family: LiberationMono; font-size: 11px;"><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Best,</span><br style="font-family: LiberationMono; font-size: 11px;"><span style="font-family: LiberationMono; font-size: 11px;">Camille</span></body></html> +</tt> diff --git a/archives/extend/attachments/20140823/51e1d345/attachment-0001.html b/archives/extend/attachments/20140823/51e1d345/attachment-0001.html new file mode 100644 index 00000000..7882295b --- /dev/null +++ b/archives/extend/attachments/20140823/51e1d345/attachment-0001.html @@ -0,0 +1,30 @@ +<tt> +<div dir="ltr">You should implement the resource_exists() callback; this will let the rest module pick a 200 vs 201. If the db name was incorrect, I think you are just supposed to return false from the put callback. I can't remember the http code for that case.<div><br> +<br></div><div>Regards,</div><div>Dan.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 23, 2014 at 6:58 PM, Stéphane Wirtel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br><br> +<br><br> +1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have a small crash.<br><br> +<br><br> +Here is my code:<br><br> +<br><br> +<a href="https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4" target="_blank">https://www.friendpaste.com/<u></u>7O3X4fG4u31gBg9MgW5xg4</a><br><br> +<br><br> +Could you tell me if I correctly use cowboy_rest for the PUT verb? I have seen is_conflict/2, but I don't know how to use it.<br><br> +<br><br> +2. I would like to change the response code, but I get the error. Is it possible?<br><br> +<br><br> +Thank you.<br><br> +<br><br> +Regards,<br><br> +<br><br> +Stephane<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +</blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140823/51e1d345/attachment.html b/archives/extend/attachments/20140823/51e1d345/attachment.html new file mode 100644 index 00000000..7882295b --- /dev/null +++ b/archives/extend/attachments/20140823/51e1d345/attachment.html @@ -0,0 +1,30 @@ +<tt> +<div dir="ltr">You should implement the resource_exists() callback; this will let the rest module pick a 200 vs 201. If the db name was incorrect, I think you are just supposed to return false from the put callback. I can't remember the http code for that case.<div><br> +<br></div><div>Regards,</div><div>Dan.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 23, 2014 at 6:58 PM, Stéphane Wirtel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br><br> +<br><br> +1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have a small crash.<br><br> +<br><br> +Here is my code:<br><br> +<br><br> +<a href="https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4" target="_blank">https://www.friendpaste.com/<u></u>7O3X4fG4u31gBg9MgW5xg4</a><br><br> +<br><br> +Could you tell me if I correctly use cowboy_rest for the PUT verb? I have seen is_conflict/2, but I don't know how to use it.<br><br> +<br><br> +2. I would like to change the response code, but I get the error. Is it possible?<br><br> +<br><br> +Thank you.<br><br> +<br><br> +Regards,<br><br> +<br><br> +Stephane<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +</blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20140824/89d3a7f6/attachment-0001.html b/archives/extend/attachments/20140824/89d3a7f6/attachment-0001.html new file mode 100644 index 00000000..c0ba22f6 --- /dev/null +++ b/archives/extend/attachments/20140824/89d3a7f6/attachment-0001.html @@ -0,0 +1,65 @@ +<tt> +<div dir="ltr">I think you can always halt the processing and do the reply by yourself:<div><br></div>{ok, Req2} = cowboy_req:reply(412, Req),<br>{halt, Req2, State}.</div><div class="gmail_extra"><br><br><div class="gmail_quote"><br> +On Sun, Aug 24, 2014 at 12:22 PM, Stéphane Wirtel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +resource_exists is used by POST<br><br> +is_conflict is used by PUT (from the code)<br><br> +but in the case where my database already exists, I need to return 412 and not 409.<br><br> +<br><br> +and I know I don't respect the default value returned by Cowboy_rest.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You should implement the resource_exists() callback; this will let the rest<br><br> +module pick a 200 vs 201. If the db name was incorrect, I think you are<br><br> +just supposed to return false from the put callback. I can't remember the<br><br> +http code for that case.<br><br> +<br><br> +Regards,<br><br> +Dan.<br><br> +<br><br> +<br><br> +On Sat, Aug 23, 2014 at 6:58 PM, Stéphane Wirtel <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi all,<br><br> +<br><br> +1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have<br><br> +a small crash.<br><br> +<br><br> +Here is my code:<br><br> +<br><br> +<a href="https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4" target="_blank">https://www.friendpaste.com/<u></u>7O3X4fG4u31gBg9MgW5xg4</a><br><br> +<br><br> +Could you tell me if I correctly use cowboy_rest for the PUT verb? I have<br><br> +seen is_conflict/2, but I don't know how to use it.<br><br> +<br><br> +2. I would like to change the response code, but I get the error. Is it<br><br> +possible?<br><br> +<br><br> +Thank you.<br><br> +<br><br> +Regards,<br><br> +<br><br> +Stephane<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><br> +</blockquote></blockquote><br> +<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140824/89d3a7f6/attachment.html b/archives/extend/attachments/20140824/89d3a7f6/attachment.html new file mode 100644 index 00000000..c0ba22f6 --- /dev/null +++ b/archives/extend/attachments/20140824/89d3a7f6/attachment.html @@ -0,0 +1,65 @@ +<tt> +<div dir="ltr">I think you can always halt the processing and do the reply by yourself:<div><br></div>{ok, Req2} = cowboy_req:reply(412, Req),<br>{halt, Req2, State}.</div><div class="gmail_extra"><br><br><div class="gmail_quote"><br> +On Sun, Aug 24, 2014 at 12:22 PM, Stéphane Wirtel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +resource_exists is used by POST<br><br> +is_conflict is used by PUT (from the code)<br><br> +but in the case where my database already exists, I need to return 412 and not 409.<br><br> +<br><br> +and I know I don't respect the default value returned by Cowboy_rest.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You should implement the resource_exists() callback; this will let the rest<br><br> +module pick a 200 vs 201. If the db name was incorrect, I think you are<br><br> +just supposed to return false from the put callback. I can't remember the<br><br> +http code for that case.<br><br> +<br><br> +Regards,<br><br> +Dan.<br><br> +<br><br> +<br><br> +On Sat, Aug 23, 2014 at 6:58 PM, Stéphane Wirtel <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi all,<br><br> +<br><br> +1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have<br><br> +a small crash.<br><br> +<br><br> +Here is my code:<br><br> +<br><br> +<a href="https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4" target="_blank">https://www.friendpaste.com/<u></u>7O3X4fG4u31gBg9MgW5xg4</a><br><br> +<br><br> +Could you tell me if I correctly use cowboy_rest for the PUT verb? I have<br><br> +seen is_conflict/2, but I don't know how to use it.<br><br> +<br><br> +2. I would like to change the response code, but I get the error. Is it<br><br> +possible?<br><br> +<br><br> +Thank you.<br><br> +<br><br> +Regards,<br><br> +<br><br> +Stephane<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><br> +</blockquote></blockquote><br> +<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140824/f35e1e51/attachment-0001.html b/archives/extend/attachments/20140824/f35e1e51/attachment-0001.html new file mode 100644 index 00000000..84c843c5 --- /dev/null +++ b/archives/extend/attachments/20140824/f35e1e51/attachment-0001.html @@ -0,0 +1,65 @@ +<tt> +<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Ok I will try asap, thanks</div><div><br>On 24 août 2014, at 02:25 AM, Eduardo Gurgel <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">I think you can always halt the processing and do the reply by yourself:<div><br></div>{ok, Req2} = cowboy_req:reply(412, Req),<br>{halt, Req2, State}.</div><div class="gmail_extra"><br><br><div class="gmail_quote"><br> +On Sun, Aug 24, 2014 at 12:22 PM, Stéphane Wirtel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +resource_exists is used by POST<br><br> +is_conflict is used by PUT (from the code)<br><br> +but in the case where my database already exists, I need to return 412 and not 409.<br><br> +<br><br> +and I know I don't respect the default value returned by Cowboy_rest.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You should implement the resource_exists() callback; this will let the rest<br><br> +module pick a 200 vs 201. If the db name was incorrect, I think you are<br><br> +just supposed to return false from the put callback. I can't remember the<br><br> +http code for that case.<br><br> +<br><br> +Regards,<br><br> +Dan.<br><br> +<br><br> +<br><br> +On Sat, Aug 23, 2014 at 6:58 PM, Stéphane Wirtel <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi all,<br><br> +<br><br> +1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have<br><br> +a small crash.<br><br> +<br><br> +Here is my code:<br><br> +<br><br> +<a href="https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4" target="_blank">https://www.friendpaste.com/<u></u>7O3X4fG4u31gBg9MgW5xg4</a><br><br> +<br><br> +Could you tell me if I correctly use cowboy_rest for the PUT verb? I have<br><br> +seen is_conflict/2, but I don't know how to use it.<br><br> +<br><br> +2. I would like to change the response code, but I get the error. Is it<br><br> +possible?<br><br> +<br><br> +Thank you.<br><br> +<br><br> +Regards,<br><br> +<br><br> +Stephane<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><br> +</blockquote></blockquote><br> +<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</div><br> +</div></blockquote></body></html> +</tt> diff --git a/archives/extend/attachments/20140824/f35e1e51/attachment.html b/archives/extend/attachments/20140824/f35e1e51/attachment.html new file mode 100644 index 00000000..84c843c5 --- /dev/null +++ b/archives/extend/attachments/20140824/f35e1e51/attachment.html @@ -0,0 +1,65 @@ +<tt> +<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Ok I will try asap, thanks</div><div><br>On 24 août 2014, at 02:25 AM, Eduardo Gurgel <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">I think you can always halt the processing and do the reply by yourself:<div><br></div>{ok, Req2} = cowboy_req:reply(412, Req),<br>{halt, Req2, State}.</div><div class="gmail_extra"><br><br><div class="gmail_quote"><br> +On Sun, Aug 24, 2014 at 12:22 PM, Stéphane Wirtel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +resource_exists is used by POST<br><br> +is_conflict is used by PUT (from the code)<br><br> +but in the case where my database already exists, I need to return 412 and not 409.<br><br> +<br><br> +and I know I don't respect the default value returned by Cowboy_rest.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +You should implement the resource_exists() callback; this will let the rest<br><br> +module pick a 200 vs 201. If the db name was incorrect, I think you are<br><br> +just supposed to return false from the put callback. I can't remember the<br><br> +http code for that case.<br><br> +<br><br> +Regards,<br><br> +Dan.<br><br> +<br><br> +<br><br> +On Sat, Aug 23, 2014 at 6:58 PM, Stéphane Wirtel <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:<br><br> +<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Hi all,<br><br> +<br><br> +1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have<br><br> +a small crash.<br><br> +<br><br> +Here is my code:<br><br> +<br><br> +<a href="https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4" target="_blank">https://www.friendpaste.com/<u></u>7O3X4fG4u31gBg9MgW5xg4</a><br><br> +<br><br> +Could you tell me if I correctly use cowboy_rest for the PUT verb? I have<br><br> +seen is_conflict/2, but I don't know how to use it.<br><br> +<br><br> +2. I would like to change the response code, but I get the error. Is it<br><br> +possible?<br><br> +<br><br> +Thank you.<br><br> +<br><br> +Regards,<br><br> +<br><br> +Stephane<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +<br><br> +</blockquote></blockquote><br> +<br><br> +<br><br> +--<br><br> +Stéphane Wirtel - <a href="http://wirtel.be" target="_blank">http://wirtel.be</a> - @matrixise<br><br> +______________________________<u></u>_________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br><br> +</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</div><br> +</div></blockquote></body></html> +</tt> diff --git a/archives/extend/attachments/20140827/91c1e017/attachment-0001.html b/archives/extend/attachments/20140827/91c1e017/attachment-0001.html new file mode 100644 index 00000000..695891b6 --- /dev/null +++ b/archives/extend/attachments/20140827/91c1e017/attachment-0001.html @@ -0,0 +1,54 @@ +<tt> +<div dir="ltr">Greetings!<div><br></div><div>I'm trying to resurrect one of my neglected ranch applications. It uses Common Test, <a href="http://erlang.mk">erlang.mk</a>, and relx all in the usual way. When I run <font face="courier new, monospace">make tests</font> with all fresh dependencies, I get this:</div><br> +<div><br></div><div><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<p class=""><font face="courier new, monospace">Doing /home/brandon/src/my_proj/deps/ranch...</font></p><br> +<p class=""><font face="courier new, monospace">make[1]: *** No rule to make target `build-tests'. Stop.</font></p><br> +<p class=""><font face="courier new, monospace">make: *** [build-deps-tests] Error 2</font></p><p class=""><br></p><p class="">A diff of my <a href="http://erlang.mk">erlang.mk</a> and deps/ranch/<a href="http://erlang.mk">erlang.mk</a> shows they are dramatically different. Mine came from here just this morning:</p><br> +<p class=""><span style="font-size:14px;font-family:Consolas"><a href="https://raw">https://raw</a>.</span><span style="font-size:14px;font-family:Consolas;color:rgb(4,46,238)"><u><a href="http://github.com">github.com</a></u></span><span style="font-size:14px;font-family:Consolas">/extend/<a href="http://erlang.mk/master/erlang.mk">erlang.mk/master/erlang.mk</a></span> <br><br> +</p><p class=""><font face="arial, helvetica, sans-serif">Which one is the "right" one for creating new apps?</font></p><p class=""><font face="arial, helvetica, sans-serif"><br></font></p><p class=""><font face="arial, helvetica, sans-serif">Thank you!</font></p><br> +<p class=""><span style="font-family:arial,helvetica,sans-serif">~BC</span><br></p><p class=""><font face="arial, helvetica, sans-serif"><br></font></p><p class=""><br></p></div><div><p class=""><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +</p><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140827/91c1e017/attachment.html b/archives/extend/attachments/20140827/91c1e017/attachment.html new file mode 100644 index 00000000..695891b6 --- /dev/null +++ b/archives/extend/attachments/20140827/91c1e017/attachment.html @@ -0,0 +1,54 @@ +<tt> +<div dir="ltr">Greetings!<div><br></div><div>I'm trying to resurrect one of my neglected ranch applications. It uses Common Test, <a href="http://erlang.mk">erlang.mk</a>, and relx all in the usual way. When I run <font face="courier new, monospace">make tests</font> with all fresh dependencies, I get this:</div><br> +<div><br></div><div><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<p class=""><font face="courier new, monospace">Doing /home/brandon/src/my_proj/deps/ranch...</font></p><br> +<p class=""><font face="courier new, monospace">make[1]: *** No rule to make target `build-tests'. Stop.</font></p><br> +<p class=""><font face="courier new, monospace">make: *** [build-deps-tests] Error 2</font></p><p class=""><br></p><p class="">A diff of my <a href="http://erlang.mk">erlang.mk</a> and deps/ranch/<a href="http://erlang.mk">erlang.mk</a> shows they are dramatically different. Mine came from here just this morning:</p><br> +<p class=""><span style="font-size:14px;font-family:Consolas"><a href="https://raw">https://raw</a>.</span><span style="font-size:14px;font-family:Consolas;color:rgb(4,46,238)"><u><a href="http://github.com">github.com</a></u></span><span style="font-size:14px;font-family:Consolas">/extend/<a href="http://erlang.mk/master/erlang.mk">erlang.mk/master/erlang.mk</a></span> <br><br> +</p><p class=""><font face="arial, helvetica, sans-serif">Which one is the "right" one for creating new apps?</font></p><p class=""><font face="arial, helvetica, sans-serif"><br></font></p><p class=""><font face="arial, helvetica, sans-serif">Thank you!</font></p><br> +<p class=""><span style="font-family:arial,helvetica,sans-serif">~BC</span><br></p><p class=""><font face="arial, helvetica, sans-serif"><br></font></p><p class=""><br></p></div><div><p class=""><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +</p><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140915/26d4e023/attachment-0001.html b/archives/extend/attachments/20140915/26d4e023/attachment-0001.html new file mode 100644 index 00000000..c4f70e58 --- /dev/null +++ b/archives/extend/attachments/20140915/26d4e023/attachment-0001.html @@ -0,0 +1,12 @@ +<tt> +<div dir="ltr">Hi.<div><br></div><div>I recently implemented a checksum header (X-Checksum) that allows validating the content of a request's body by hash comparison (just to give you some context). I'm using the onrequest hook to affect all requests (and be able to reply appropriately for non-conformance to the hash function result) but can't figure out how to not read the request body twice, i.e. I read it in the onrequest hook but later on need to read it again in the route handler, but I can't (from the manual, for cowboy_req:body: "This function can only be called once. Cowboy will not cache the result of this call."). At the moment, and because the API consumers were in a hurry, the solution I found (I understand it might be an ugly hack), was to read the body, store it in the Req's meta (property body, for example) and then access that property later on, instead of using cowboy_req:body. I'm not quite happy with this solution and was wondering if there is anything more elegant that I can implement.</div><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<div><br></div><div>Thanks.</div><div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140915/26d4e023/attachment.html b/archives/extend/attachments/20140915/26d4e023/attachment.html new file mode 100644 index 00000000..c4f70e58 --- /dev/null +++ b/archives/extend/attachments/20140915/26d4e023/attachment.html @@ -0,0 +1,12 @@ +<tt> +<div dir="ltr">Hi.<div><br></div><div>I recently implemented a checksum header (X-Checksum) that allows validating the content of a request's body by hash comparison (just to give you some context). I'm using the onrequest hook to affect all requests (and be able to reply appropriately for non-conformance to the hash function result) but can't figure out how to not read the request body twice, i.e. I read it in the onrequest hook but later on need to read it again in the route handler, but I can't (from the manual, for cowboy_req:body: "This function can only be called once. Cowboy will not cache the result of this call."). At the moment, and because the API consumers were in a hurry, the solution I found (I understand it might be an ugly hack), was to read the body, store it in the Req's meta (property body, for example) and then access that property later on, instead of using cowboy_req:body. I'm not quite happy with this solution and was wondering if there is anything more elegant that I can implement.</div><br> +<br> +<br> +<br> +<br> +<br> +<br> +<br> +<div><br></div><div>Thanks.</div><div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140915/5f3302e4/attachment-0001.html b/archives/extend/attachments/20140915/5f3302e4/attachment-0001.html new file mode 100644 index 00000000..289a6657 --- /dev/null +++ b/archives/extend/attachments/20140915/5f3302e4/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">Hi.</span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">This can be read in the cowboy_req:binding doc: "By default the value is a binary, however constraints may change the type of this value (for example automatically converting numbers to integer)."</span><br><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">What constraints are we talking about here?</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">Also, there's no reference to the fact that the bindings are URL-decoded, even though they appear to be.</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">Cheers.</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">- Paulo F. Oliveira</span></font></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140915/5f3302e4/attachment.html b/archives/extend/attachments/20140915/5f3302e4/attachment.html new file mode 100644 index 00000000..289a6657 --- /dev/null +++ b/archives/extend/attachments/20140915/5f3302e4/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">Hi.</span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px">This can be read in the cowboy_req:binding doc: "By default the value is a binary, however constraints may change the type of this value (for example automatically converting numbers to integer)."</span><br><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:19.600000381469727px"><br></span></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">What constraints are we talking about here?</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">Also, there's no reference to the fact that the bindings are URL-decoded, even though they appear to be.</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">Cheers.</span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px"><br></span></font></div><div><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px;line-height:19.600000381469727px">- Paulo F. Oliveira</span></font></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140915/d97a6072/attachment-0001.html b/archives/extend/attachments/20140915/d97a6072/attachment-0001.html new file mode 100644 index 00000000..467b0cfb --- /dev/null +++ b/archives/extend/attachments/20140915/d97a6072/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div>OK, I guess "constraints" refers to this: <a href="http://ninenines.eu/docs/en/cowboy/HEAD/guide/routing/#constraints">http://ninenines.eu/docs/en/cowboy/HEAD/guide/routing/#constraints</a></div><div><br></div><div>:D</div><div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140915/d97a6072/attachment.html b/archives/extend/attachments/20140915/d97a6072/attachment.html new file mode 100644 index 00000000..467b0cfb --- /dev/null +++ b/archives/extend/attachments/20140915/d97a6072/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div>OK, I guess "constraints" refers to this: <a href="http://ninenines.eu/docs/en/cowboy/HEAD/guide/routing/#constraints">http://ninenines.eu/docs/en/cowboy/HEAD/guide/routing/#constraints</a></div><div><br></div><div>:D</div><div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140929/84fe21a4/attachment-0001.html b/archives/extend/attachments/20140929/84fe21a4/attachment-0001.html new file mode 100644 index 00000000..d8a3a0b0 --- /dev/null +++ b/archives/extend/attachments/20140929/84fe21a4/attachment-0001.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr"><div>Hello list, I hope this is the right place to ask this.<br><br></div><div>I'm learning Erlang, and I wanted to create a Cowboy app to record audio from a web browser.<br><br>Based on the websocket example in the Cowboy source code, I get the user mic input and send this input to the websocket.<br><br></div><div>I created a "recorder" module, which functionality is to save the data to the a file.<br><br><b>#rawe_handler.erl<br></b>-module(rawec_handler).<br>-behaviour(cowboy_websocket_handler).<br>......<br>init(_, _, _) -><br> case whereis(recorder) of<br> undefined -><br> RecorderPid = recorder:start(),<br> register(recorder, RecorderPid);<br> _ -> ok<br> end,<br> {upgrade, protocol, cowboy_websocket}.<br>.....<br>websocket_handle(_Frame, Req, State) -><br> RecorderPid = whereis(recorder),<br> RecorderPid ! {rec, _Frame/binary},<br> {ok, Req, State}.<br><br></div><div><b>#recorder.erl</b><br>-module(recorder).<br><br>-export([start/0, recorder_fun/1]).<br>-compile([debug_info]).<br><br>recorder_fun(IoDevice) -> <br> receive<br> {rec, Data} -><br> ok = file:write(IoDevice, Data),<br> io:format(Data),<br> recorder_fun(IoDevice);<br> {stop, _} -><br> %%Close file<br> file:close(IoDevice)<br> end.<br> <br>start() -><br> {ok, IoDevice} = file:open("/tmp/test_binary.wav", [write, binary]), <br> spawn(recorder, recorder_fun, [IoDevice]).<br> <br><br></div><div>When I start the console, and allow the microphone on the browser, I see this error on the console:<br><br>=ERROR REPORT==== 29-Sep-2014::18:13:03 ===<br>Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.178.0> exit with reason: <b>{[{reason,badarith},{mfa,{rawec_handler,websocket_handle,3</b>}},{stacktrace,[{rawec_handler,websocket_handle,3,[{file,"src/rawec_handler.erl"},{line,35}]},{cowboy_websocket,handler_call,7,[{file,"src/cowboy_websocket.erl"},{line,588}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{msg,{binary,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0....(ETC, DATA STREAM CONTINUES)<br></div><div><br></div><div>Probably my approach to do this is totally wrong. I there any obvious problem here?<br></div><div>Can someone point me to a right direction?. Maybe I should write directly to a file in the <b>websocket_handle </b>funcion, but how can I keep a file opened during the streaming?<br><br></div><div>The github repo is here: <a href="https://github.com/jmrepetti/rawec">https://github.com/jmrepetti/rawec</a> with the whole source code if you want to take a look.<br><br><br></div><div>Thanks in advance,<br></div><div>Matias.<br><br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140929/84fe21a4/attachment.html b/archives/extend/attachments/20140929/84fe21a4/attachment.html new file mode 100644 index 00000000..d8a3a0b0 --- /dev/null +++ b/archives/extend/attachments/20140929/84fe21a4/attachment.html @@ -0,0 +1,5 @@ +<tt> +<div dir="ltr"><div>Hello list, I hope this is the right place to ask this.<br><br></div><div>I'm learning Erlang, and I wanted to create a Cowboy app to record audio from a web browser.<br><br>Based on the websocket example in the Cowboy source code, I get the user mic input and send this input to the websocket.<br><br></div><div>I created a "recorder" module, which functionality is to save the data to the a file.<br><br><b>#rawe_handler.erl<br></b>-module(rawec_handler).<br>-behaviour(cowboy_websocket_handler).<br>......<br>init(_, _, _) -><br> case whereis(recorder) of<br> undefined -><br> RecorderPid = recorder:start(),<br> register(recorder, RecorderPid);<br> _ -> ok<br> end,<br> {upgrade, protocol, cowboy_websocket}.<br>.....<br>websocket_handle(_Frame, Req, State) -><br> RecorderPid = whereis(recorder),<br> RecorderPid ! {rec, _Frame/binary},<br> {ok, Req, State}.<br><br></div><div><b>#recorder.erl</b><br>-module(recorder).<br><br>-export([start/0, recorder_fun/1]).<br>-compile([debug_info]).<br><br>recorder_fun(IoDevice) -> <br> receive<br> {rec, Data} -><br> ok = file:write(IoDevice, Data),<br> io:format(Data),<br> recorder_fun(IoDevice);<br> {stop, _} -><br> %%Close file<br> file:close(IoDevice)<br> end.<br> <br>start() -><br> {ok, IoDevice} = file:open("/tmp/test_binary.wav", [write, binary]), <br> spawn(recorder, recorder_fun, [IoDevice]).<br> <br><br></div><div>When I start the console, and allow the microphone on the browser, I see this error on the console:<br><br>=ERROR REPORT==== 29-Sep-2014::18:13:03 ===<br>Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.178.0> exit with reason: <b>{[{reason,badarith},{mfa,{rawec_handler,websocket_handle,3</b>}},{stacktrace,[{rawec_handler,websocket_handle,3,[{file,"src/rawec_handler.erl"},{line,35}]},{cowboy_websocket,handler_call,7,[{file,"src/cowboy_websocket.erl"},{line,588}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{msg,{binary,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0....(ETC, DATA STREAM CONTINUES)<br></div><div><br></div><div>Probably my approach to do this is totally wrong. I there any obvious problem here?<br></div><div>Can someone point me to a right direction?. Maybe I should write directly to a file in the <b>websocket_handle </b>funcion, but how can I keep a file opened during the streaming?<br><br></div><div>The github repo is here: <a href="https://github.com/jmrepetti/rawec">https://github.com/jmrepetti/rawec</a> with the whole source code if you want to take a look.<br><br><br></div><div>Thanks in advance,<br></div><div>Matias.<br><br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20140930/6d952ce6/attachment-0001.html b/archives/extend/attachments/20140930/6d952ce6/attachment-0001.html new file mode 100644 index 00000000..08dea64c --- /dev/null +++ b/archives/extend/attachments/20140930/6d952ce6/attachment-0001.html @@ -0,0 +1,11 @@ +<tt> +<div dir="ltr">Looking on the output it says:<div><br></div><div><b style="font-family:arial,sans-serif;font-size:13px">{reason,badarith} </b><span style="font-family:arial,sans-serif;font-size:13px">on this line: </span></div><div><span class="" style="color:rgb(0,128,128);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre"><br></span></div>RecorderPid ! {rec, _Frame/binary},<div><br></div><div>This may help you somehow. </div><div><br></div><div>BTW, variables starting with _ are usually used to show unused variables and stop warnings from the compiler.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 September 2014 05:52, Juan Matías <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello list, I hope this is the right place to ask this.<br><br></div><div>I'm learning Erlang, and I wanted to create a Cowboy app to record audio from a web browser.<br><br>Based on the websocket example in the Cowboy source code, I get the user mic input and send this input to the websocket.<br><br></div><div>I created a "recorder" module, which functionality is to save the data to the a file.<br><br><b>#rawe_handler.erl<br></b>-module(rawec_handler).<br>-behaviour(cowboy_websocket_handler).<br>......<br>init(_, _, _) -><br> case whereis(recorder) of<br> undefined -><br> RecorderPid = recorder:start(),<br> register(recorder, RecorderPid);<br> _ -> ok<br> end,<br> {upgrade, protocol, cowboy_websocket}.<br>.....<br>websocket_handle(_Frame, Req, State) -><br> RecorderPid = whereis(recorder),<br> RecorderPid ! {rec, _Frame/binary},<br> {ok, Req, State}.<br><br></div><div><b>#recorder.erl</b><br>-module(recorder).<br><br>-export([start/0, recorder_fun/1]).<br>-compile([debug_info]).<br><br>recorder_fun(IoDevice) -> <br> receive<br> {rec, Data} -><br> ok = file:write(IoDevice, Data),<br> io:format(Data),<br> recorder_fun(IoDevice);<br> {stop, _} -><br> %%Close file<br> file:close(IoDevice)<br> end.<br> <br>start() -><br> {ok, IoDevice} = file:open("/tmp/test_binary.wav", [write, binary]), <br> spawn(recorder, recorder_fun, [IoDevice]).<br> <br><br></div><div>When I start the console, and allow the microphone on the browser, I see this error on the console:<br><br>=ERROR REPORT==== 29-Sep-2014::18:13:03 ===<br>Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.178.0> exit with reason: <b>{[{reason,badarith},{mfa,{rawec_handler,websocket_handle,3</b>}},{stacktrace,[{rawec_handler,websocket_handle,3,[{file,"src/rawec_handler.erl"},{line,35}]},{cowboy_websocket,handler_call,7,[{file,"src/cowboy_websocket.erl"},{line,588}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{msg,{binary,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0....(ETC, DATA STREAM CONTINUES)<br></div><div><br></div><div>Probably my approach to do this is totally wrong. I there any obvious problem here?<br></div><div>Can someone point me to a right direction?. Maybe I should write directly to a file in the <b>websocket_handle </b>funcion, but how can I keep a file opened during the streaming?<br><br></div><div>The github repo is here: <a href="https://github.com/jmrepetti/rawec" target="_blank">https://github.com/jmrepetti/rawec</a> with the whole source code if you want to take a look.<br><br><br></div><div>Thanks in advance,<br></div><div>Matias.<br><br> +</div></div><br> +<br>_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140930/6d952ce6/attachment.html b/archives/extend/attachments/20140930/6d952ce6/attachment.html new file mode 100644 index 00000000..08dea64c --- /dev/null +++ b/archives/extend/attachments/20140930/6d952ce6/attachment.html @@ -0,0 +1,11 @@ +<tt> +<div dir="ltr">Looking on the output it says:<div><br></div><div><b style="font-family:arial,sans-serif;font-size:13px">{reason,badarith} </b><span style="font-family:arial,sans-serif;font-size:13px">on this line: </span></div><div><span class="" style="color:rgb(0,128,128);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre"><br></span></div>RecorderPid ! {rec, _Frame/binary},<div><br></div><div>This may help you somehow. </div><div><br></div><div>BTW, variables starting with _ are usually used to show unused variables and stop warnings from the compiler.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 September 2014 05:52, Juan Matías <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello list, I hope this is the right place to ask this.<br><br></div><div>I'm learning Erlang, and I wanted to create a Cowboy app to record audio from a web browser.<br><br>Based on the websocket example in the Cowboy source code, I get the user mic input and send this input to the websocket.<br><br></div><div>I created a "recorder" module, which functionality is to save the data to the a file.<br><br><b>#rawe_handler.erl<br></b>-module(rawec_handler).<br>-behaviour(cowboy_websocket_handler).<br>......<br>init(_, _, _) -><br> case whereis(recorder) of<br> undefined -><br> RecorderPid = recorder:start(),<br> register(recorder, RecorderPid);<br> _ -> ok<br> end,<br> {upgrade, protocol, cowboy_websocket}.<br>.....<br>websocket_handle(_Frame, Req, State) -><br> RecorderPid = whereis(recorder),<br> RecorderPid ! {rec, _Frame/binary},<br> {ok, Req, State}.<br><br></div><div><b>#recorder.erl</b><br>-module(recorder).<br><br>-export([start/0, recorder_fun/1]).<br>-compile([debug_info]).<br><br>recorder_fun(IoDevice) -> <br> receive<br> {rec, Data} -><br> ok = file:write(IoDevice, Data),<br> io:format(Data),<br> recorder_fun(IoDevice);<br> {stop, _} -><br> %%Close file<br> file:close(IoDevice)<br> end.<br> <br>start() -><br> {ok, IoDevice} = file:open("/tmp/test_binary.wav", [write, binary]), <br> spawn(recorder, recorder_fun, [IoDevice]).<br> <br><br></div><div>When I start the console, and allow the microphone on the browser, I see this error on the console:<br><br>=ERROR REPORT==== 29-Sep-2014::18:13:03 ===<br>Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.178.0> exit with reason: <b>{[{reason,badarith},{mfa,{rawec_handler,websocket_handle,3</b>}},{stacktrace,[{rawec_handler,websocket_handle,3,[{file,"src/rawec_handler.erl"},{line,35}]},{cowboy_websocket,handler_call,7,[{file,"src/cowboy_websocket.erl"},{line,588}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{msg,{binary,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0....(ETC, DATA STREAM CONTINUES)<br></div><div><br></div><div>Probably my approach to do this is totally wrong. I there any obvious problem here?<br></div><div>Can someone point me to a right direction?. Maybe I should write directly to a file in the <b>websocket_handle </b>funcion, but how can I keep a file opened during the streaming?<br><br></div><div>The github repo is here: <a href="https://github.com/jmrepetti/rawec" target="_blank">https://github.com/jmrepetti/rawec</a> with the whole source code if you want to take a look.<br><br><br></div><div>Thanks in advance,<br></div><div>Matias.<br><br> +</div></div><br> +<br>_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140930/ef46837f/attachment-0001.html b/archives/extend/attachments/20140930/ef46837f/attachment-0001.html new file mode 100644 index 00000000..555c66a2 --- /dev/null +++ b/archives/extend/attachments/20140930/ef46837f/attachment-0001.html @@ -0,0 +1,13 @@ +<tt> +<div dir="ltr">Thanks, that fixed the error. Now I'm having other but I'll investigate. <br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 30, 2014 at 12:53 AM, Eduardo Gurgel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Looking on the output it says:<div><br></div><div><b style="font-family:arial,sans-serif;font-size:13px">{reason,badarith} </b><span style="font-family:arial,sans-serif;font-size:13px">on this line: </span></div><span class=""><div><span style="color:rgb(0,128,128);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre-wrap"><br></span></div>RecorderPid ! {rec, _Frame/binary},<div><br></div></span><div>This may help you somehow. </div><div><br></div><div>BTW, variables starting with _ are usually used to show unused variables and stop warnings from the compiler.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 30 September 2014 05:52, Juan Matías <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hello list, I hope this is the right place to ask this.<br><br></div><div>I'm learning Erlang, and I wanted to create a Cowboy app to record audio from a web browser.<br><br>Based on the websocket example in the Cowboy source code, I get the user mic input and send this input to the websocket.<br><br></div><div>I created a "recorder" module, which functionality is to save the data to the a file.<br><br><b>#rawe_handler.erl<br></b>-module(rawec_handler).<br>-behaviour(cowboy_websocket_handler).<br>......<br>init(_, _, _) -><br> case whereis(recorder) of<br> undefined -><br> RecorderPid = recorder:start(),<br> register(recorder, RecorderPid);<br> _ -> ok<br> end,<br> {upgrade, protocol, cowboy_websocket}.<br>.....<br>websocket_handle(_Frame, Req, State) -><br> RecorderPid = whereis(recorder),<br> RecorderPid ! {rec, _Frame/binary},<br> {ok, Req, State}.<br><br></div><div><b>#recorder.erl</b><br>-module(recorder).<br><br>-export([start/0, recorder_fun/1]).<br>-compile([debug_info]).<br><br>recorder_fun(IoDevice) -> <br> receive<br> {rec, Data} -><br> ok = file:write(IoDevice, Data),<br> io:format(Data),<br> recorder_fun(IoDevice);<br> {stop, _} -><br> %%Close file<br> file:close(IoDevice)<br> end.<br> <br>start() -><br> {ok, IoDevice} = file:open("/tmp/test_binary.wav", [write, binary]), <br> spawn(recorder, recorder_fun, [IoDevice]).<br> <br><br></div><div>When I start the console, and allow the microphone on the browser, I see this error on the console:<br><br>=ERROR REPORT==== 29-Sep-2014::18:13:03 ===<br>Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.178.0> exit with reason: <b>{[{reason,badarith},{mfa,{rawec_handler,websocket_handle,3</b>}},{stacktrace,[{rawec_handler,websocket_handle,3,[{file,"src/rawec_handler.erl"},{line,35}]},{cowboy_websocket,handler_call,7,[{file,"src/cowboy_websocket.erl"},{line,588}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{msg,{binary,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0....(ETC, DATA STREAM CONTINUES)<br></div><div><br></div><div>Probably my approach to do this is totally wrong. I there any obvious problem here?<br></div><div>Can someone point me to a right direction?. Maybe I should write directly to a file in the <b>websocket_handle </b>funcion, but how can I keep a file opened during the streaming?<br><br></div><div>The github repo is here: <a href="https://github.com/jmrepetti/rawec" target="_blank">https://github.com/jmrepetti/rawec</a> with the whole source code if you want to take a look.<br><br><br></div><div>Thanks in advance,<br></div><div>Matias.<br><br> +</div></div><br> +<br></div></div>_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</font></span></div><br> +</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Matías <br></div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20140930/ef46837f/attachment.html b/archives/extend/attachments/20140930/ef46837f/attachment.html new file mode 100644 index 00000000..555c66a2 --- /dev/null +++ b/archives/extend/attachments/20140930/ef46837f/attachment.html @@ -0,0 +1,13 @@ +<tt> +<div dir="ltr">Thanks, that fixed the error. Now I'm having other but I'll investigate. <br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 30, 2014 at 12:53 AM, Eduardo Gurgel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Looking on the output it says:<div><br></div><div><b style="font-family:arial,sans-serif;font-size:13px">{reason,badarith} </b><span style="font-family:arial,sans-serif;font-size:13px">on this line: </span></div><span class=""><div><span style="color:rgb(0,128,128);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre-wrap"><br></span></div>RecorderPid ! {rec, _Frame/binary},<div><br></div></span><div>This may help you somehow. </div><div><br></div><div>BTW, variables starting with _ are usually used to show unused variables and stop warnings from the compiler.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 30 September 2014 05:52, Juan Matías <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hello list, I hope this is the right place to ask this.<br><br></div><div>I'm learning Erlang, and I wanted to create a Cowboy app to record audio from a web browser.<br><br>Based on the websocket example in the Cowboy source code, I get the user mic input and send this input to the websocket.<br><br></div><div>I created a "recorder" module, which functionality is to save the data to the a file.<br><br><b>#rawe_handler.erl<br></b>-module(rawec_handler).<br>-behaviour(cowboy_websocket_handler).<br>......<br>init(_, _, _) -><br> case whereis(recorder) of<br> undefined -><br> RecorderPid = recorder:start(),<br> register(recorder, RecorderPid);<br> _ -> ok<br> end,<br> {upgrade, protocol, cowboy_websocket}.<br>.....<br>websocket_handle(_Frame, Req, State) -><br> RecorderPid = whereis(recorder),<br> RecorderPid ! {rec, _Frame/binary},<br> {ok, Req, State}.<br><br></div><div><b>#recorder.erl</b><br>-module(recorder).<br><br>-export([start/0, recorder_fun/1]).<br>-compile([debug_info]).<br><br>recorder_fun(IoDevice) -> <br> receive<br> {rec, Data} -><br> ok = file:write(IoDevice, Data),<br> io:format(Data),<br> recorder_fun(IoDevice);<br> {stop, _} -><br> %%Close file<br> file:close(IoDevice)<br> end.<br> <br>start() -><br> {ok, IoDevice} = file:open("/tmp/test_binary.wav", [write, binary]), <br> spawn(recorder, recorder_fun, [IoDevice]).<br> <br><br></div><div>When I start the console, and allow the microphone on the browser, I see this error on the console:<br><br>=ERROR REPORT==== 29-Sep-2014::18:13:03 ===<br>Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.178.0> exit with reason: <b>{[{reason,badarith},{mfa,{rawec_handler,websocket_handle,3</b>}},{stacktrace,[{rawec_handler,websocket_handle,3,[{file,"src/rawec_handler.erl"},{line,35}]},{cowboy_websocket,handler_call,7,[{file,"src/cowboy_websocket.erl"},{line,588}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{msg,{binary,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0....(ETC, DATA STREAM CONTINUES)<br></div><div><br></div><div>Probably my approach to do this is totally wrong. I there any obvious problem here?<br></div><div>Can someone point me to a right direction?. Maybe I should write directly to a file in the <b>websocket_handle </b>funcion, but how can I keep a file opened during the streaming?<br><br></div><div>The github repo is here: <a href="https://github.com/jmrepetti/rawec" target="_blank">https://github.com/jmrepetti/rawec</a> with the whole source code if you want to take a look.<br><br><br></div><div>Thanks in advance,<br></div><div>Matias.<br><br> +</div></div><br> +<br></div></div>_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Eduardo<br></div><br> +</font></span></div><br> +</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Matías <br></div><br> +</div><br> + +</tt> diff --git a/archives/extend/attachments/20141014/77f74bf0/attachment-0001.html b/archives/extend/attachments/20141014/77f74bf0/attachment-0001.html new file mode 100644 index 00000000..2a78f5ad --- /dev/null +++ b/archives/extend/attachments/20141014/77f74bf0/attachment-0001.html @@ -0,0 +1,5 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Stefan,<div><br></div><div><br><div><div>On 14 Oct 2014, at 10:05, Stefan Strigler <<a href="mailto:[email protected]">[email protected]</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>just subscribed yesterday and now that's already my first question.</div><div><br></div><div>I'm referring to <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/</a>. Given you have a PUT on a new resource the diagram suggests that the response's status code depends on whether you've set a location and/or body.</div></div></blockquote><div><br></div><div>This is correct, I have experience this behaviour on Cowboy 1.0.0 and 2.0.0-pre.1.</div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div>But when looking at the code (v1.0.0) then cowboy_rest:maybe_created/2 would always return a 201. No matter what. I think the code is right, but the diagram needs to be fixed. </div></div></blockquote><div><br></div><div>Could you be more specific?</div><div>I�m afraid it is not how it works for me.</div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div>But then I'm not totally sure how to interpret <a href="http://tools.ietf.org/html/rfc2616#section-10.2.2">http://tools.ietf.org/html/rfc2616#section-10.2.2</a> which states</div><div><br></div><div><pre class="" style="font-size: 1em; margin-top: 0px; margin-bottom: 0px;"> The newly created resource can be referenced by the URI(s)<br> + returned in the entity of the response, with the most specific URI<br> + for the resource given by a Location header field.</pre><pre class="" style="font-size: 1em; margin-top: 0px; margin-bottom: 0px;"><br></pre><pre class="" style="font-size: 1em; margin-top: 0px; margin-bottom: 0px;"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Because currently it is totally possible to not have a location header set (just as no body) for the response. In my opinion the current code behaves good enough and it's up to the service to ensure the requirements as stated by the RFC. Should cowboy enforce a header field? Should it try to figure that out on its own?</span><br></pre></div></div></blockquote><div><br></div></div>I think how Cowboy does is best at the moment.</div><div>I like to have the freedom to specify myself the Location, especially when PUT-ting <i>new</i> resources.</div><div><br></div><div><br></div><div>A bit off topic, I think this article is interesting regarding RFC-2616.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><a href="https://www.mnot.net/blog/2014/06/07/rfc2616_is_dead">https://www.mnot.net/blog/2014/06/07/rfc2616_is_dead</a></div><div><br></div><div>Given that, you might want to have a look at RFC-7231, section 3.1.4.2:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://tools.ietf.org/html/rfc7231#section-3.1.4.2">http://tools.ietf.org/html/rfc7231#section-3.1.4.2</a>.</div><div><br></div><div><br></div><div>Camille</div><div><br></div></body></html> +</tt> diff --git a/archives/extend/attachments/20141014/77f74bf0/attachment.html b/archives/extend/attachments/20141014/77f74bf0/attachment.html new file mode 100644 index 00000000..2a78f5ad --- /dev/null +++ b/archives/extend/attachments/20141014/77f74bf0/attachment.html @@ -0,0 +1,5 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Stefan,<div><br></div><div><br><div><div>On 14 Oct 2014, at 10:05, Stefan Strigler <<a href="mailto:[email protected]">[email protected]</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>just subscribed yesterday and now that's already my first question.</div><div><br></div><div>I'm referring to <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/</a>. Given you have a PUT on a new resource the diagram suggests that the response's status code depends on whether you've set a location and/or body.</div></div></blockquote><div><br></div><div>This is correct, I have experience this behaviour on Cowboy 1.0.0 and 2.0.0-pre.1.</div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div>But when looking at the code (v1.0.0) then cowboy_rest:maybe_created/2 would always return a 201. No matter what. I think the code is right, but the diagram needs to be fixed. </div></div></blockquote><div><br></div><div>Could you be more specific?</div><div>I�m afraid it is not how it works for me.</div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div>But then I'm not totally sure how to interpret <a href="http://tools.ietf.org/html/rfc2616#section-10.2.2">http://tools.ietf.org/html/rfc2616#section-10.2.2</a> which states</div><div><br></div><div><pre class="" style="font-size: 1em; margin-top: 0px; margin-bottom: 0px;"> The newly created resource can be referenced by the URI(s)<br> + returned in the entity of the response, with the most specific URI<br> + for the resource given by a Location header field.</pre><pre class="" style="font-size: 1em; margin-top: 0px; margin-bottom: 0px;"><br></pre><pre class="" style="font-size: 1em; margin-top: 0px; margin-bottom: 0px;"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Because currently it is totally possible to not have a location header set (just as no body) for the response. In my opinion the current code behaves good enough and it's up to the service to ensure the requirements as stated by the RFC. Should cowboy enforce a header field? Should it try to figure that out on its own?</span><br></pre></div></div></blockquote><div><br></div></div>I think how Cowboy does is best at the moment.</div><div>I like to have the freedom to specify myself the Location, especially when PUT-ting <i>new</i> resources.</div><div><br></div><div><br></div><div>A bit off topic, I think this article is interesting regarding RFC-2616.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><a href="https://www.mnot.net/blog/2014/06/07/rfc2616_is_dead">https://www.mnot.net/blog/2014/06/07/rfc2616_is_dead</a></div><div><br></div><div>Given that, you might want to have a look at RFC-7231, section 3.1.4.2:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://tools.ietf.org/html/rfc7231#section-3.1.4.2">http://tools.ietf.org/html/rfc7231#section-3.1.4.2</a>.</div><div><br></div><div><br></div><div>Camille</div><div><br></div></body></html> +</tt> diff --git a/archives/extend/attachments/20141014/d89bced6/attachment-0001.html b/archives/extend/attachments/20141014/d89bced6/attachment-0001.html new file mode 100644 index 00000000..fc1c7513 --- /dev/null +++ b/archives/extend/attachments/20141014/d89bced6/attachment-0001.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hey,<div><br></div><div>just subscribed yesterday and now that's already my first question.</div><div><br></div><div>I'm referring to <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/</a>. Given you have a PUT on a new resource the diagram suggests that the response's status code depends on whether you've set a location and/or body. But when looking at the code (v1.0.0) then cowboy_rest:maybe_created/2 would always return a 201. No matter what. I think the code is right, but the diagram needs to be fixed. </div><div><br></div><div>But then I'm not totally sure how to interpret <a href="http://tools.ietf.org/html/rfc2616#section-10.2.2">http://tools.ietf.org/html/rfc2616#section-10.2.2</a> which states</div><div><br></div><div><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"> The newly created resource can be referenced by the URI(s)<br> + returned in the entity of the response, with the most specific URI<br> + for the resource given by a Location header field.</pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><br></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Because currently it is totally possible to not have a location header set (just as no body) for the response. In my opinion the current code behaves good enough and it's up to the service to ensure the requirements as stated by the RFC. Should cowboy enforce a header field? Should it try to figure that out on its own?</span><br></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em"><br></span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Regards,</span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em"><br></span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Stefan</span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><div style="color:rgb(34,34,34);font-family:arial;white-space:normal"><br></div><div style="color:rgb(34,34,34);font-family:arial;white-space:normal"><br></div></pre></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20141014/d89bced6/attachment.html b/archives/extend/attachments/20141014/d89bced6/attachment.html new file mode 100644 index 00000000..fc1c7513 --- /dev/null +++ b/archives/extend/attachments/20141014/d89bced6/attachment.html @@ -0,0 +1,6 @@ +<tt> +<div dir="ltr">Hey,<div><br></div><div>just subscribed yesterday and now that's already my first question.</div><div><br></div><div>I'm referring to <a href="http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/">http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/</a>. Given you have a PUT on a new resource the diagram suggests that the response's status code depends on whether you've set a location and/or body. But when looking at the code (v1.0.0) then cowboy_rest:maybe_created/2 would always return a 201. No matter what. I think the code is right, but the diagram needs to be fixed. </div><div><br></div><div>But then I'm not totally sure how to interpret <a href="http://tools.ietf.org/html/rfc2616#section-10.2.2">http://tools.ietf.org/html/rfc2616#section-10.2.2</a> which states</div><div><br></div><div><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"> The newly created resource can be referenced by the URI(s)<br> + returned in the entity of the response, with the most specific URI<br> + for the resource given by a Location header field.</pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><br></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Because currently it is totally possible to not have a location header set (just as no body) for the response. In my opinion the current code behaves good enough and it's up to the service to ensure the requirements as stated by the RFC. Should cowboy enforce a header field? Should it try to figure that out on its own?</span><br></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em"><br></span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Regards,</span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em"><br></span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><span style="color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em">Stefan</span></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><div style="color:rgb(34,34,34);font-family:arial;white-space:normal"><br></div><div style="color:rgb(34,34,34);font-family:arial;white-space:normal"><br></div></pre></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20141031/fc6724a7/attachment-0001.html b/archives/extend/attachments/20141031/fc6724a7/attachment-0001.html new file mode 100644 index 00000000..4da7589d --- /dev/null +++ b/archives/extend/attachments/20141031/fc6724a7/attachment-0001.html @@ -0,0 +1,67 @@ +<tt> +<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +<meta name="Generator" content="Microsoft Word 14 (filtered medium)"><br> +<style><!--<br> +/* Font Definitions */<br> +@font-face<br> + {font-family:Calibri;<br> + panose-1:2 15 5 2 2 2 4 3 2 4;}<br> +/* Style Definitions */<br> +p.MsoNormal, li.MsoNormal, div.MsoNormal<br> + {margin:0in;<br> + margin-bottom:.0001pt;<br> + font-size:11.0pt;<br> + font-family:"Calibri","sans-serif";}<br> +a:link, span.MsoHyperlink<br> + {mso-style-priority:99;<br> + color:blue;<br> + text-decoration:underline;}<br> +a:visited, span.MsoHyperlinkFollowed<br> + {mso-style-priority:99;<br> + color:purple;<br> + text-decoration:underline;}<br> +span.EmailStyle17<br> + {mso-style-type:personal-compose;<br> + font-family:"Calibri","sans-serif";<br> + color:windowtext;}<br> +.MsoChpDefault<br> + {mso-style-type:export-only;<br> + font-family:"Calibri","sans-serif";}<br> +@page WordSection1<br> + {size:8.5in 11.0in;<br> + margin:1.0in 1.0in 1.0in 1.0in;}<br> +div.WordSection1<br> + {page:WordSection1;}<br> +--></style><!--[if gte mso 9]><xml><br> +<o:shapedefaults v:ext="edit" spidmax="1026" /><br> +</xml><![endif]--><!--[if gte mso 9]><xml><br> +<o:shapelayout v:ext="edit"><br> +<o:idmap v:ext="edit" data="1" /><br> +</o:shapelayout></xml><![endif]--><br> +</head><br> +<body lang="EN-US" link="blue" vlink="purple"><br> +<div class="WordSection1"><br> +<p class="MsoNormal">Hello,<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal">Has anyone had trouble getting IE9 connecting to Cowboy over HTTPS?<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal">We're using Cowboy embedded in MongooseIM, and IE9 is giving us fits.<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal">Thanks,<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New"">David<o:p></o:p></span></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +</div><br> +<br> +<HR>This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.<BR><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20141031/fc6724a7/attachment.html b/archives/extend/attachments/20141031/fc6724a7/attachment.html new file mode 100644 index 00000000..4da7589d --- /dev/null +++ b/archives/extend/attachments/20141031/fc6724a7/attachment.html @@ -0,0 +1,67 @@ +<tt> +<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><br> +<head><br> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br> +<meta name="Generator" content="Microsoft Word 14 (filtered medium)"><br> +<style><!--<br> +/* Font Definitions */<br> +@font-face<br> + {font-family:Calibri;<br> + panose-1:2 15 5 2 2 2 4 3 2 4;}<br> +/* Style Definitions */<br> +p.MsoNormal, li.MsoNormal, div.MsoNormal<br> + {margin:0in;<br> + margin-bottom:.0001pt;<br> + font-size:11.0pt;<br> + font-family:"Calibri","sans-serif";}<br> +a:link, span.MsoHyperlink<br> + {mso-style-priority:99;<br> + color:blue;<br> + text-decoration:underline;}<br> +a:visited, span.MsoHyperlinkFollowed<br> + {mso-style-priority:99;<br> + color:purple;<br> + text-decoration:underline;}<br> +span.EmailStyle17<br> + {mso-style-type:personal-compose;<br> + font-family:"Calibri","sans-serif";<br> + color:windowtext;}<br> +.MsoChpDefault<br> + {mso-style-type:export-only;<br> + font-family:"Calibri","sans-serif";}<br> +@page WordSection1<br> + {size:8.5in 11.0in;<br> + margin:1.0in 1.0in 1.0in 1.0in;}<br> +div.WordSection1<br> + {page:WordSection1;}<br> +--></style><!--[if gte mso 9]><xml><br> +<o:shapedefaults v:ext="edit" spidmax="1026" /><br> +</xml><![endif]--><!--[if gte mso 9]><xml><br> +<o:shapelayout v:ext="edit"><br> +<o:idmap v:ext="edit" data="1" /><br> +</o:shapelayout></xml><![endif]--><br> +</head><br> +<body lang="EN-US" link="blue" vlink="purple"><br> +<div class="WordSection1"><br> +<p class="MsoNormal">Hello,<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal">Has anyone had trouble getting IE9 connecting to Cowboy over HTTPS?<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal">We're using Cowboy embedded in MongooseIM, and IE9 is giving us fits.<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal">Thanks,<o:p></o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New"">David<o:p></o:p></span></p><br> +<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p><br> +<p class="MsoNormal"><o:p> </o:p></p><br> +</div><br> +<br> +<HR>This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.<BR><br> +</body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20141106/85a93e04/attachment-0001.html b/archives/extend/attachments/20141106/85a93e04/attachment-0001.html new file mode 100644 index 00000000..c761d6c6 --- /dev/null +++ b/archives/extend/attachments/20141106/85a93e04/attachment-0001.html @@ -0,0 +1,6 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">Can you suggest a best library to encode/decode html and url? I am using cowboy and bullet. Mochiweb seems to support only url encode/decode.</div><div class=""><br class=""></div>I have been using mochijson2.erl file from mochi web to encode/decode json.<div class=""> <br class=""><div apple-content-edited="true" class=""><br> +<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">Cheers</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">Suresh<br class=""><br class=""><br class=""></div></span></span><br> +</div><br> +<br class=""></div></body></html> +</tt> diff --git a/archives/extend/attachments/20141106/85a93e04/attachment.html b/archives/extend/attachments/20141106/85a93e04/attachment.html new file mode 100644 index 00000000..c761d6c6 --- /dev/null +++ b/archives/extend/attachments/20141106/85a93e04/attachment.html @@ -0,0 +1,6 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">Can you suggest a best library to encode/decode html and url? I am using cowboy and bullet. Mochiweb seems to support only url encode/decode.</div><div class=""><br class=""></div>I have been using mochijson2.erl file from mochi web to encode/decode json.<div class=""> <br class=""><div apple-content-edited="true" class=""><br> +<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">Cheers</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">Suresh<br class=""><br class=""><br class=""></div></span></span><br> +</div><br> +<br class=""></div></body></html> +</tt> diff --git a/archives/extend/attachments/20141110/a4b469a5/attachment-0001.html b/archives/extend/attachments/20141110/a4b469a5/attachment-0001.html new file mode 100644 index 00000000..6aac3086 --- /dev/null +++ b/archives/extend/attachments/20141110/a4b469a5/attachment-0001.html @@ -0,0 +1,13 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.4"><br> +</HEAD><br> +<BODY><br> +I am building a streaming music server that delivers mp3 files from disk to instances of 'mplayer'. So far I am using the Cowboy static handler for this, and it is working for a single player but I wonder how efficient the buffering is at the network level. Should I instead be doing this myself with an http handler and chunked replies?<br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20141110/a4b469a5/attachment.html b/archives/extend/attachments/20141110/a4b469a5/attachment.html new file mode 100644 index 00000000..6aac3086 --- /dev/null +++ b/archives/extend/attachments/20141110/a4b469a5/attachment.html @@ -0,0 +1,13 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.4"><br> +</HEAD><br> +<BODY><br> +I am building a streaming music server that delivers mp3 files from disk to instances of 'mplayer'. So far I am using the Cowboy static handler for this, and it is working for a single player but I wonder how efficient the buffering is at the network level. Should I instead be doing this myself with an http handler and chunked replies?<br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20141122/bcb1d17c/attachment-0001.html b/archives/extend/attachments/20141122/bcb1d17c/attachment-0001.html new file mode 100644 index 00000000..835de200 --- /dev/null +++ b/archives/extend/attachments/20141122/bcb1d17c/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<HTML><HEAD><META http-equiv="content-type" content: text/html; charset=UTF-8></HEAD><BODY><a href="http://antiq.co.il/ko/vichpcrgddbxwhfcdpsflud.sqkehqciqedlfxud">http://antiq.co.il/ko/vichpcrgddbxwhfcdpsflud.sqkehqciqedlfxud</a> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> Tristan Sloughter <br><br><br> </BODY></HTML><br> + +</tt> diff --git a/archives/extend/attachments/20141122/bcb1d17c/attachment.html b/archives/extend/attachments/20141122/bcb1d17c/attachment.html new file mode 100644 index 00000000..835de200 --- /dev/null +++ b/archives/extend/attachments/20141122/bcb1d17c/attachment.html @@ -0,0 +1,4 @@ +<tt> +<HTML><HEAD><META http-equiv="content-type" content: text/html; charset=UTF-8></HEAD><BODY><a href="http://antiq.co.il/ko/vichpcrgddbxwhfcdpsflud.sqkehqciqedlfxud">http://antiq.co.il/ko/vichpcrgddbxwhfcdpsflud.sqkehqciqedlfxud</a> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> Tristan Sloughter <br><br><br> </BODY></HTML><br> + +</tt> diff --git a/archives/extend/attachments/20141124/9ceef28a/attachment-0001.html b/archives/extend/attachments/20141124/9ceef28a/attachment-0001.html new file mode 100644 index 00000000..fce057d3 --- /dev/null +++ b/archives/extend/attachments/20141124/9ceef28a/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div><div><div>I'm working quite a bit with <a href="http://erlang.mk">erlang.mk</a>, and one thing I've noticed is that I've seen no mention of how to deal with multiple apps. There are some great examples of how to build a single app and its dependencies into a release, but what is the proper way of handling things when you have say 6 custom written apps (with their deps)?<br><br><br></div>Right now my top level directory looks like this:<br><br></div><span style="font-family:monospace">Makefile<br></span></div><span style="font-family:monospace"><a href="http://erlang.mk">erlang.mk</a><br></span></div><span style="font-family:monospace">deps/<br></span></div><span style="font-family:monospace">custom_app_1/<br>custom_app_2/<br>custom_app_3/<br>...</span><br><br><br></div>I've got the Makefile using <a href="http://erlang.mk">erlang.mk</a> to handle all the dependencies, and then some custom rules to invoke make on all the app subdirectories. It's not too bad so far. I was thinking of formalizing some of this into a subapp plugin.<br><br><br><div><br><br><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20141124/9ceef28a/attachment.html b/archives/extend/attachments/20141124/9ceef28a/attachment.html new file mode 100644 index 00000000..fce057d3 --- /dev/null +++ b/archives/extend/attachments/20141124/9ceef28a/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div><div><div>I'm working quite a bit with <a href="http://erlang.mk">erlang.mk</a>, and one thing I've noticed is that I've seen no mention of how to deal with multiple apps. There are some great examples of how to build a single app and its dependencies into a release, but what is the proper way of handling things when you have say 6 custom written apps (with their deps)?<br><br><br></div>Right now my top level directory looks like this:<br><br></div><span style="font-family:monospace">Makefile<br></span></div><span style="font-family:monospace"><a href="http://erlang.mk">erlang.mk</a><br></span></div><span style="font-family:monospace">deps/<br></span></div><span style="font-family:monospace">custom_app_1/<br>custom_app_2/<br>custom_app_3/<br>...</span><br><br><br></div>I've got the Makefile using <a href="http://erlang.mk">erlang.mk</a> to handle all the dependencies, and then some custom rules to invoke make on all the app subdirectories. It's not too bad so far. I was thinking of formalizing some of this into a subapp plugin.<br><br><br><div><br><br><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20141225/ff94953b/attachment-0001.html b/archives/extend/attachments/20141225/ff94953b/attachment-0001.html new file mode 100644 index 00000000..7936c528 --- /dev/null +++ b/archives/extend/attachments/20141225/ff94953b/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<HTML><HEAD><META http-equiv="content-type" content: text/html; charset=UTF-8></HEAD><BODY><br> <a href="http://www.salaricevimenticiccarone.com/uxzx/flknraadbnipv.ohsuzvezlxsrhzgegyczlppiuxh">http://www.salaricevimenticiccarone.com/uxzx/flknraadbnipv.ohsuzvezlxsrhzgegyczlppiuxh</a> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> Tristan Sloughter</BODY></HTML><br> + +</tt> diff --git a/archives/extend/attachments/20141225/ff94953b/attachment.html b/archives/extend/attachments/20141225/ff94953b/attachment.html new file mode 100644 index 00000000..7936c528 --- /dev/null +++ b/archives/extend/attachments/20141225/ff94953b/attachment.html @@ -0,0 +1,4 @@ +<tt> +<HTML><HEAD><META http-equiv="content-type" content: text/html; charset=UTF-8></HEAD><BODY><br> <a href="http://www.salaricevimenticiccarone.com/uxzx/flknraadbnipv.ohsuzvezlxsrhzgegyczlppiuxh">http://www.salaricevimenticiccarone.com/uxzx/flknraadbnipv.ohsuzvezlxsrhzgegyczlppiuxh</a> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> Tristan Sloughter</BODY></HTML><br> + +</tt> diff --git a/archives/extend/attachments/20150114/3267f73e/attachment-0001.html b/archives/extend/attachments/20150114/3267f73e/attachment-0001.html new file mode 100644 index 00000000..e297a303 --- /dev/null +++ b/archives/extend/attachments/20150114/3267f73e/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr">Hey there,<div><br></div><div>maybe I'm missing the obvious. What I want to do is add some generic handler for exception handling. Say we have a set of resources some of which delegating stuff to external, other services. These calls might result in a</div><div><br></div><div>throw({error, timeout})</div><div><br></div><div>for instance. How would I add/modify cowboy's middleware (right place?) to handle those (known) exception and return a custom error (like 504 - Gateway Timeout).</div><div><br></div><div>Thanks for any hints,</div><div><br></div><div>Steve</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20150114/3267f73e/attachment.html b/archives/extend/attachments/20150114/3267f73e/attachment.html new file mode 100644 index 00000000..e297a303 --- /dev/null +++ b/archives/extend/attachments/20150114/3267f73e/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr">Hey there,<div><br></div><div>maybe I'm missing the obvious. What I want to do is add some generic handler for exception handling. Say we have a set of resources some of which delegating stuff to external, other services. These calls might result in a</div><div><br></div><div>throw({error, timeout})</div><div><br></div><div>for instance. How would I add/modify cowboy's middleware (right place?) to handle those (known) exception and return a custom error (like 504 - Gateway Timeout).</div><div><br></div><div>Thanks for any hints,</div><div><br></div><div>Steve</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20150125/370811e4/attachment-0001.html b/archives/extend/attachments/20150125/370811e4/attachment-0001.html new file mode 100644 index 00000000..7783cc74 --- /dev/null +++ b/archives/extend/attachments/20150125/370811e4/attachment-0001.html @@ -0,0 +1,25 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5"><br> +</HEAD><br> +<BODY><br> +I am trying to write a middleware step that will modify the URL in a request before it gets to the default static request handler. I can not find an example of how to do this. What I have so far:<BR><br> +<BR><br> +execute( Req, Env ) -><BR><br> + HostUrl = cowboy_req:host_url(Req),<BR><br> + NewUrl = rewrite( HostUrl ),<BR><br> + NewReq = ???<BR><br> + {ok, NewReq, Env}.<BR><br> +<BR><br> +How do I modify a Request object so that it contains my modified URL, which cowboy_static will then process normally? My 'rewrite' function converts logical directory names into real file-system paths, using a dynamic algorithm that can not be simply written into cowboy's dispatch rules.<BR><br> +<BR><br> +The dispatch rules I am using is as follows, where 'bz_libmap' is my module containing the code above:<BR><br> + {"/music/[...]", cowboy_static, {dir, bz_libmap, ""}},<BR><br> +<BR><br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20150125/370811e4/attachment.html b/archives/extend/attachments/20150125/370811e4/attachment.html new file mode 100644 index 00000000..7783cc74 --- /dev/null +++ b/archives/extend/attachments/20150125/370811e4/attachment.html @@ -0,0 +1,25 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5"><br> +</HEAD><br> +<BODY><br> +I am trying to write a middleware step that will modify the URL in a request before it gets to the default static request handler. I can not find an example of how to do this. What I have so far:<BR><br> +<BR><br> +execute( Req, Env ) -><BR><br> + HostUrl = cowboy_req:host_url(Req),<BR><br> + NewUrl = rewrite( HostUrl ),<BR><br> + NewReq = ???<BR><br> + {ok, NewReq, Env}.<BR><br> +<BR><br> +How do I modify a Request object so that it contains my modified URL, which cowboy_static will then process normally? My 'rewrite' function converts logical directory names into real file-system paths, using a dynamic algorithm that can not be simply written into cowboy's dispatch rules.<BR><br> +<BR><br> +The dispatch rules I am using is as follows, where 'bz_libmap' is my module containing the code above:<BR><br> + {"/music/[...]", cowboy_static, {dir, bz_libmap, ""}},<BR><br> +<BR><br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20150127/1916d612/attachment-0001.html b/archives/extend/attachments/20150127/1916d612/attachment-0001.html new file mode 100644 index 00000000..5c77ef18 --- /dev/null +++ b/archives/extend/attachments/20150127/1916d612/attachment-0001.html @@ -0,0 +1,29 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5"><br> +</HEAD><br> +<BODY><br> +On Tue, 2015-01-27 at 14:10 +0100, Loïc Hoguin wrote:<br> +<BLOCKQUOTE TYPE=CITE><br> +<PRE><br> +On 01/27/2015 02:07 PM, Paul Dickson wrote:<br> +<FONT COLOR="#737373">> Info [<<"/">>,<<"music">>,<<"Library">>,<<"Folk">>,<<"Swiss">>,</FONT><br> +<FONT COLOR="#737373">> <<"Alphorn.ogg">>]</FONT><br> +<br> +Should be from Library onward, and not include the first two elements.<br> +<br> +</PRE><br> +</BLOCKQUOTE><br> +<BR><br> +This is perhaps a confusing case, because the incoming URL and the transformed URL both start with "/music". What if that was not the case, and the resulting path was, for example,<BR><br> +<BR><br> + /home/me/music/Folk/Swiss/Alphorn.ogg<BR><br> +<BR><br> +which does not match anything in the rules at all? Is that allowed, or must the rewritten URL also match a rule?<br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20150127/1916d612/attachment.html b/archives/extend/attachments/20150127/1916d612/attachment.html new file mode 100644 index 00000000..5c77ef18 --- /dev/null +++ b/archives/extend/attachments/20150127/1916d612/attachment.html @@ -0,0 +1,29 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5"><br> +</HEAD><br> +<BODY><br> +On Tue, 2015-01-27 at 14:10 +0100, Loïc Hoguin wrote:<br> +<BLOCKQUOTE TYPE=CITE><br> +<PRE><br> +On 01/27/2015 02:07 PM, Paul Dickson wrote:<br> +<FONT COLOR="#737373">> Info [<<"/">>,<<"music">>,<<"Library">>,<<"Folk">>,<<"Swiss">>,</FONT><br> +<FONT COLOR="#737373">> <<"Alphorn.ogg">>]</FONT><br> +<br> +Should be from Library onward, and not include the first two elements.<br> +<br> +</PRE><br> +</BLOCKQUOTE><br> +<BR><br> +This is perhaps a confusing case, because the incoming URL and the transformed URL both start with "/music". What if that was not the case, and the resulting path was, for example,<BR><br> +<BR><br> + /home/me/music/Folk/Swiss/Alphorn.ogg<BR><br> +<BR><br> +which does not match anything in the rules at all? Is that allowed, or must the rewritten URL also match a rule?<br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20150215/9d2f5de1/attachment-0001.html b/archives/extend/attachments/20150215/9d2f5de1/attachment-0001.html new file mode 100644 index 00000000..3c8d377c --- /dev/null +++ b/archives/extend/attachments/20150215/9d2f5de1/attachment-0001.html @@ -0,0 +1,25 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5"><br> +</HEAD><br> +<BODY><br> +I am writing a CalDAV handler, which is a type of WebDAV server. CalDAV defines a bunch of<BR><br> +additional methods beyond what a typical web browser would use, such as REPORT and PROPFIND.<BR><br> +<BR><br> +I have written the allowed_methods and known_methods callbacks to report that all these methods<BR><br> +are acceptable. My content_types_provided has an entry for "application/xml", which is how these<BR><br> +extra methods turn up.<BR><br> +<BR><br> +When I connect to my server using the calendar function of Evolution, one of the first things it does<BR><br> +is a REPORT method, which is sort of a query. This gets as far as content_types_provided, but after<BR><br> +that it does not call the function I identified in content_types_provided.<BR><br> +<BR><br> +What is the best way to handle the non-standard methods that do not have defined callbacks?<BR><br> +<BR><br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20150215/9d2f5de1/attachment.html b/archives/extend/attachments/20150215/9d2f5de1/attachment.html new file mode 100644 index 00000000..3c8d377c --- /dev/null +++ b/archives/extend/attachments/20150215/9d2f5de1/attachment.html @@ -0,0 +1,25 @@ +<tt> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br> +<HTML><br> +<HEAD><br> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"><br> + <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5"><br> +</HEAD><br> +<BODY><br> +I am writing a CalDAV handler, which is a type of WebDAV server. CalDAV defines a bunch of<BR><br> +additional methods beyond what a typical web browser would use, such as REPORT and PROPFIND.<BR><br> +<BR><br> +I have written the allowed_methods and known_methods callbacks to report that all these methods<BR><br> +are acceptable. My content_types_provided has an entry for "application/xml", which is how these<BR><br> +extra methods turn up.<BR><br> +<BR><br> +When I connect to my server using the calendar function of Evolution, one of the first things it does<BR><br> +is a REPORT method, which is sort of a query. This gets as far as content_types_provided, but after<BR><br> +that it does not call the function I identified in content_types_provided.<BR><br> +<BR><br> +What is the best way to handle the non-standard methods that do not have defined callbacks?<BR><br> +<BR><br> +</BODY><br> +</HTML><br> + +</tt> diff --git a/archives/extend/attachments/20150623/3556788c/attachment-0001.html b/archives/extend/attachments/20150623/3556788c/attachment-0001.html new file mode 100644 index 00000000..82ea0504 --- /dev/null +++ b/archives/extend/attachments/20150623/3556788c/attachment-0001.html @@ -0,0 +1,203 @@ +<tt> +<div dir="ltr">It's bitten me a few times :(</div><div class="gmail_extra"><br><div class="gmail_quote">On 23 June 2015 at 10:09, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oh nice catch ahah. We should probably warn when something like this happens.<span class=""><br><br> +<br><br> +On 06/23/2015 11:06 AM, Graham Hay wrote:<br><br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br> +I think the order of your routes is the problem, try putting this line<br></span><br> +<<a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17</a>><span class=""><br><br> +last.<br><br> +<br><br> +On 23 June 2015 at 09:56, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><div><div class="h5"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + The {error, enoent}, especially there, is probably just because the<br><br> + browser is trying to fetch the favicon.<br><br> +<br><br> + Your issue is that Websocket won't connect, so it has nothing to do<br><br> + with cowboy_rest. Try tracing cowboy_websocket or enable SASL to<br><br> + have more info.<br><br> +<br><br> +<br><br> + On 06/23/2015 10:28 AM, Robert Balogh wrote:<br><br> +<br><br> + hello,<br><br> +<br><br> + First of all I would say I am a beginner in Cowboy web server, so<br><br> + probably I made something wrong, that is why I got the "fault",<br><br> + what I got.<br><br> +<br><br> + I would like to build up web page, where the client can<br><br> + communicate to<br><br> + server, and server can do the same to client, if client does not<br><br> + send<br><br> + anything to server too. The Cowboy has the websocket example,<br><br> + what does<br><br> + what I would like to do.<br><br> +<br><br> + There is only one thing is missing what I would like to have.<br><br> + This is<br><br> + the "frameset". My idea is to build the index.html using framsets. I<br><br> + made this changes, and I build up the html files for the frames,<br><br> + and of<br><br> + course I set these in the index.html.<br><br> +<br><br> + Here is how the index.html looks like<br><br> + <html><br><br> +<br><br> + <head><br><br> + <title>Welcome to Websocket example 2</title><br><br> + </head><br><br> +<br><br> + <frameset rows="64,*"><br><br> + <frame name="top_frame" noresize="noresize" scrolling="no"<br><br> + src="frame_top.html"><br><br> + <frameset cols="450,*"><br><br> + <frame name="left_frame" scrolling="auto"<br><br> + src="frame_left.html"><br><br> + <frame name="right_frame" src="frame_right.html"><br><br> + </frameset><br><br> + <noframes><br><br> + <body><br><br> +<br><br> + </body><br><br> + </noframes><br><br> + </frameset><br><br> +<br><br> + </html><br><br> +<br><br> + This is how the priv folder looks like<br><br> + -----------------------------------------------------------<br><br> + ls priv/<br><br> + frame_left.html frame_right.html frame_top.html<br><br> + index.html static<br><br> +<br><br> + This is how I changed the websocket_2_app:start/2 function<br><br> + -----------------------------------------------------------<br><br> + Dispatch = cowboy_router:compile([<br><br> + {'_', [<br><br> +<br><br> + {"/", cowboy_static, {priv_file, websocket_2,<br><br> + "index.html"}},<br><br> + {"/[...]", cowboy_static, {priv_dir, websocket_2,<br><br> + ""}},<br><br> +<br><br> + {"/websocket_2", ws_handler_2, []},<br><br> + {"/static/[...]", cowboy_static, {priv_dir,<br><br> + websocket_2,<br><br> + "static"}}<br><br> + ]}<br><br> + ]),<br><br> +<br><br> + After compile and make release package of the app, I can reach the<br><br> + webserver on the port 8080, but some connection does not set up<br><br> + correctly. The following texts are present in the browser<br><br> + DISCONNECTED<br><br> +<br><br> + ERROR: undefined<br><br> +<br><br> + Connecting to: ws://localhost:8080/websocket_2<br><br> +<br><br> + I made a dbg trace on all cowboy modules, to start some kind of<br><br> + troubleshooting. In the "tons" of printout I can see this one.<br><br> + So in the<br><br> + bottom of this, there is an {error,enoent}. It comes when tries<br><br> + connect<br><br> + to the socket. But unfortunatelly I do not have idea what may<br><br> + cause this :-(<br><br> +<br><br> + The part of trace<br><br> + -----------------------------------------------------------<br><br> + (<0.177.0>) call<br><br> + cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br><br> + {{127,0,0,1},33241},<br><br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br><br> + [<<"websocket_2">>],<br><br> + <<>>,undefined,[],<br><br> + [{<<"host">>,<<"localhost:8080">>},<br><br> + {<<"connection">>,<<"Upgrade">>},<br><br> + {<<"pragma">>,<<"no-cache">>},<br><br> + {<<"cache-control">>,<<"no-cache">>},<br><br> + {<<"upgrade">>,<<"websocket">>},<br><br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br><br> + {<<"sec-websocket-version">>,<<"13">>},<br><br> + {<<"user-agent">>,<br><br> + <<"Mozilla/5.0 (X11; Linux i686)<br><br> + AppleWebKit/537.36<br><br> + (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br><br> + {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br><br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br><br> +<br><br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br><br> + {<<"sec-websocket-extensions">>,<br><br> + <<"permessage-deflate;<br><br> + client_max_window_bits">>}],<br><br> + [{<<"connection">>,[<<"upgrade">>]}],<br><br> +<br><br> + undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br><br> + {handler_opts,{priv_dir,websocket_2,[]}},<br><br> + {listener,http},<br><br> + {dispatch,[{'_',[],<br><br> + [{[],[],cowboy_static,<br><br> +<br><br> + {priv_file,websocket_2,"index.html"}},<br><br> +<br><br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br><br> +<br><br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br><br> + {[<<"static">>,'...'],<br><br> + [],cowboy_static,<br><br> +<br><br> + {priv_dir,websocket_2,"static"}}]}]}],<br><br> + <<"GET">>,cowboy_static,<br><br> +<br><br> + {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br><br> + {error,enoent},<br><br> + []},<br><br> +<br><br> + undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br><br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br><br> + (Timestamp: {1435,<br><br> +<br><br> + 46126,<br><br> +<br><br> + 935663})<br><br> +<br><br> + I guess, I did something very wrong, but I did not found what is<br><br> + that,<br><br> + thus I would like to get some help from you.<br><br> +<br><br> + Please find my small project in github:<br><br> + <a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br><br> +<br><br> + thanks for your help,<br><br> + /Robi<br><br> +<br><br> +<br><br> +<br><br> + _______________________________________________<br><br> + Extend mailing list<br></div></div><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><span class=""><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> + Author of The Erlanger Playbook,<br><br> + A book about software development using Erlang<br><br> + _______________________________________________<br><br> + Extend mailing list<br></span><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> +</blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150623/3556788c/attachment.html b/archives/extend/attachments/20150623/3556788c/attachment.html new file mode 100644 index 00000000..82ea0504 --- /dev/null +++ b/archives/extend/attachments/20150623/3556788c/attachment.html @@ -0,0 +1,203 @@ +<tt> +<div dir="ltr">It's bitten me a few times :(</div><div class="gmail_extra"><br><div class="gmail_quote">On 23 June 2015 at 10:09, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oh nice catch ahah. We should probably warn when something like this happens.<span class=""><br><br> +<br><br> +On 06/23/2015 11:06 AM, Graham Hay wrote:<br><br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br> +I think the order of your routes is the problem, try putting this line<br></span><br> +<<a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17</a>><span class=""><br><br> +last.<br><br> +<br><br> +On 23 June 2015 at 09:56, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><div><div class="h5"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + The {error, enoent}, especially there, is probably just because the<br><br> + browser is trying to fetch the favicon.<br><br> +<br><br> + Your issue is that Websocket won't connect, so it has nothing to do<br><br> + with cowboy_rest. Try tracing cowboy_websocket or enable SASL to<br><br> + have more info.<br><br> +<br><br> +<br><br> + On 06/23/2015 10:28 AM, Robert Balogh wrote:<br><br> +<br><br> + hello,<br><br> +<br><br> + First of all I would say I am a beginner in Cowboy web server, so<br><br> + probably I made something wrong, that is why I got the "fault",<br><br> + what I got.<br><br> +<br><br> + I would like to build up web page, where the client can<br><br> + communicate to<br><br> + server, and server can do the same to client, if client does not<br><br> + send<br><br> + anything to server too. The Cowboy has the websocket example,<br><br> + what does<br><br> + what I would like to do.<br><br> +<br><br> + There is only one thing is missing what I would like to have.<br><br> + This is<br><br> + the "frameset". My idea is to build the index.html using framsets. I<br><br> + made this changes, and I build up the html files for the frames,<br><br> + and of<br><br> + course I set these in the index.html.<br><br> +<br><br> + Here is how the index.html looks like<br><br> + <html><br><br> +<br><br> + <head><br><br> + <title>Welcome to Websocket example 2</title><br><br> + </head><br><br> +<br><br> + <frameset rows="64,*"><br><br> + <frame name="top_frame" noresize="noresize" scrolling="no"<br><br> + src="frame_top.html"><br><br> + <frameset cols="450,*"><br><br> + <frame name="left_frame" scrolling="auto"<br><br> + src="frame_left.html"><br><br> + <frame name="right_frame" src="frame_right.html"><br><br> + </frameset><br><br> + <noframes><br><br> + <body><br><br> +<br><br> + </body><br><br> + </noframes><br><br> + </frameset><br><br> +<br><br> + </html><br><br> +<br><br> + This is how the priv folder looks like<br><br> + -----------------------------------------------------------<br><br> + ls priv/<br><br> + frame_left.html frame_right.html frame_top.html<br><br> + index.html static<br><br> +<br><br> + This is how I changed the websocket_2_app:start/2 function<br><br> + -----------------------------------------------------------<br><br> + Dispatch = cowboy_router:compile([<br><br> + {'_', [<br><br> +<br><br> + {"/", cowboy_static, {priv_file, websocket_2,<br><br> + "index.html"}},<br><br> + {"/[...]", cowboy_static, {priv_dir, websocket_2,<br><br> + ""}},<br><br> +<br><br> + {"/websocket_2", ws_handler_2, []},<br><br> + {"/static/[...]", cowboy_static, {priv_dir,<br><br> + websocket_2,<br><br> + "static"}}<br><br> + ]}<br><br> + ]),<br><br> +<br><br> + After compile and make release package of the app, I can reach the<br><br> + webserver on the port 8080, but some connection does not set up<br><br> + correctly. The following texts are present in the browser<br><br> + DISCONNECTED<br><br> +<br><br> + ERROR: undefined<br><br> +<br><br> + Connecting to: ws://localhost:8080/websocket_2<br><br> +<br><br> + I made a dbg trace on all cowboy modules, to start some kind of<br><br> + troubleshooting. In the "tons" of printout I can see this one.<br><br> + So in the<br><br> + bottom of this, there is an {error,enoent}. It comes when tries<br><br> + connect<br><br> + to the socket. But unfortunatelly I do not have idea what may<br><br> + cause this :-(<br><br> +<br><br> + The part of trace<br><br> + -----------------------------------------------------------<br><br> + (<0.177.0>) call<br><br> + cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br><br> + {{127,0,0,1},33241},<br><br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br><br> + [<<"websocket_2">>],<br><br> + <<>>,undefined,[],<br><br> + [{<<"host">>,<<"localhost:8080">>},<br><br> + {<<"connection">>,<<"Upgrade">>},<br><br> + {<<"pragma">>,<<"no-cache">>},<br><br> + {<<"cache-control">>,<<"no-cache">>},<br><br> + {<<"upgrade">>,<<"websocket">>},<br><br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br><br> + {<<"sec-websocket-version">>,<<"13">>},<br><br> + {<<"user-agent">>,<br><br> + <<"Mozilla/5.0 (X11; Linux i686)<br><br> + AppleWebKit/537.36<br><br> + (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br><br> + {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br><br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br><br> +<br><br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br><br> + {<<"sec-websocket-extensions">>,<br><br> + <<"permessage-deflate;<br><br> + client_max_window_bits">>}],<br><br> + [{<<"connection">>,[<<"upgrade">>]}],<br><br> +<br><br> + undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br><br> + {handler_opts,{priv_dir,websocket_2,[]}},<br><br> + {listener,http},<br><br> + {dispatch,[{'_',[],<br><br> + [{[],[],cowboy_static,<br><br> +<br><br> + {priv_file,websocket_2,"index.html"}},<br><br> +<br><br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br><br> +<br><br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br><br> + {[<<"static">>,'...'],<br><br> + [],cowboy_static,<br><br> +<br><br> + {priv_dir,websocket_2,"static"}}]}]}],<br><br> + <<"GET">>,cowboy_static,<br><br> +<br><br> + {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br><br> + {error,enoent},<br><br> + []},<br><br> +<br><br> + undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br><br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br><br> + (Timestamp: {1435,<br><br> +<br><br> + 46126,<br><br> +<br><br> + 935663})<br><br> +<br><br> + I guess, I did something very wrong, but I did not found what is<br><br> + that,<br><br> + thus I would like to get some help from you.<br><br> +<br><br> + Please find my small project in github:<br><br> + <a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br><br> +<br><br> + thanks for your help,<br><br> + /Robi<br><br> +<br><br> +<br><br> +<br><br> + _______________________________________________<br><br> + Extend mailing list<br></div></div><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><span class=""><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> + Author of The Erlanger Playbook,<br><br> + A book about software development using Erlang<br><br> + _______________________________________________<br><br> + Extend mailing list<br></span><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> +</blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150623/69dfc8e4/attachment-0001.html b/archives/extend/attachments/20150623/69dfc8e4/attachment-0001.html new file mode 100644 index 00000000..afae15ff --- /dev/null +++ b/archives/extend/attachments/20150623/69dfc8e4/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr">hello,<br><br>First of all I would say I am a beginner in Cowboy web server, so probably I made something wrong, that is why I got the "fault", what I got.<br><br>I would like to build up web page, where the client can communicate to server, and server can do the same to client, if client does not send anything to server too. The Cowboy has the websocket example, what does what I would like to do.<br><br>There is only one thing is missing what I would like to have. This is the "frameset". My idea is to build the index.html using framsets. I made this changes, and I build up the html files for the frames, and of course I set these in the index.html. <br><br>Here is how the index.html looks like<br> <html><br><br> <head><br> <title>Welcome to Websocket example 2</title><br> </head><br><br> <frameset rows="64,*"><br> <frame name="top_frame" noresize="noresize" scrolling="no" src="frame_top.html"><br> <frameset cols="450,*"><br> <frame name="left_frame" scrolling="auto" src="frame_left.html"><br> <frame name="right_frame" src="frame_right.html"><br> </frameset><br> <noframes><br> <body><br><br> </body><br> </noframes><br> </frameset><br><br> </html><br><br>This is how the priv folder looks like<br>-----------------------------------------------------------<br> ls priv/<br> frame_left.html frame_right.html frame_top.html index.html static<br><br>This is how I changed the websocket_2_app:start/2 function<br>-----------------------------------------------------------<br> Dispatch = cowboy_router:compile([<br> {'_', [<br> <br> {"/", cowboy_static, {priv_file, websocket_2, "index.html"}},<br> {"/[...]", cowboy_static, {priv_dir, websocket_2, ""}},<br> <br> {"/websocket_2", ws_handler_2, []},<br> {"/static/[...]", cowboy_static, {priv_dir, websocket_2, "static"}}<br> ]}<br> ]),<br><br>After compile and make release package of the app, I can reach the webserver on the port 8080, but some connection does not set up correctly. The following texts are present in the browser<br> DISCONNECTED<br><br> ERROR: undefined<br><br> Connecting to: ws://localhost:8080/websocket_2<br><br>I made a dbg trace on all cowboy modules, to start some kind of troubleshooting. In the "tons" of printout I can see this one. So in the bottom of this, there is an {error,enoent}. It comes when tries connect to the socket. But unfortunatelly I do not have idea what may cause this :-(<br><br>The part of trace<br>-----------------------------------------------------------<br> (<0.177.0>) call cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br> {{127,0,0,1},33241},<br> <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br> [<<"websocket_2">>],<br> <<>>,undefined,[],<br> [{<<"host">>,<<"localhost:8080">>},<br> {<<"connection">>,<<"Upgrade">>},<br> {<<"pragma">>,<<"no-cache">>},<br> {<<"cache-control">>,<<"no-cache">>},<br> {<<"upgrade">>,<<"websocket">>},<br> {<<"origin">>,<<"<a href="http://localhost:8080">http://localhost:8080</a>">>},<br> {<<"sec-websocket-version">>,<<"13">>},<br> {<<"user-agent">>,<br> <<"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br> {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br> {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br> {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br> {<<"sec-websocket-extensions">>,<br> <<"permessage-deflate; client_max_window_bits">>}],<br> [{<<"connection">>,[<<"upgrade">>]}],<br> undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br> {handler_opts,{priv_dir,websocket_2,[]}},<br> {listener,http},<br> {dispatch,[{'_',[],<br> [{[],[],cowboy_static,<br> {priv_file,websocket_2,"index.html"}},<br> {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br> {[<<"websocket_2">>],[],ws_handler_2,[]},<br> {[<<"static">>,'...'],<br> [],cowboy_static,<br> {priv_dir,websocket_2,"static"}}]}]}],<br> <<"GET">>,cowboy_static,<br> {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br> {error,enoent},<br> []},<br> undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br> undefined,undefined},#Fun<cowboy_rest.2.41839999>) (Timestamp: {1435,<br> 46126,<br> 935663})<br><br>I guess, I did something very wrong, but I did not found what is that, thus I would like to get some help from you.<br><br>Please find my small project in github: <a href="https://github.com/ethrbh/websocket_2">https://github.com/ethrbh/websocket_2</a><br><br>thanks for your help,<br>/Robi<br><br></div>
<br> + +</tt> diff --git a/archives/extend/attachments/20150623/69dfc8e4/attachment.html b/archives/extend/attachments/20150623/69dfc8e4/attachment.html new file mode 100644 index 00000000..afae15ff --- /dev/null +++ b/archives/extend/attachments/20150623/69dfc8e4/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr">hello,<br><br>First of all I would say I am a beginner in Cowboy web server, so probably I made something wrong, that is why I got the "fault", what I got.<br><br>I would like to build up web page, where the client can communicate to server, and server can do the same to client, if client does not send anything to server too. The Cowboy has the websocket example, what does what I would like to do.<br><br>There is only one thing is missing what I would like to have. This is the "frameset". My idea is to build the index.html using framsets. I made this changes, and I build up the html files for the frames, and of course I set these in the index.html. <br><br>Here is how the index.html looks like<br> <html><br><br> <head><br> <title>Welcome to Websocket example 2</title><br> </head><br><br> <frameset rows="64,*"><br> <frame name="top_frame" noresize="noresize" scrolling="no" src="frame_top.html"><br> <frameset cols="450,*"><br> <frame name="left_frame" scrolling="auto" src="frame_left.html"><br> <frame name="right_frame" src="frame_right.html"><br> </frameset><br> <noframes><br> <body><br><br> </body><br> </noframes><br> </frameset><br><br> </html><br><br>This is how the priv folder looks like<br>-----------------------------------------------------------<br> ls priv/<br> frame_left.html frame_right.html frame_top.html index.html static<br><br>This is how I changed the websocket_2_app:start/2 function<br>-----------------------------------------------------------<br> Dispatch = cowboy_router:compile([<br> {'_', [<br> <br> {"/", cowboy_static, {priv_file, websocket_2, "index.html"}},<br> {"/[...]", cowboy_static, {priv_dir, websocket_2, ""}},<br> <br> {"/websocket_2", ws_handler_2, []},<br> {"/static/[...]", cowboy_static, {priv_dir, websocket_2, "static"}}<br> ]}<br> ]),<br><br>After compile and make release package of the app, I can reach the webserver on the port 8080, but some connection does not set up correctly. The following texts are present in the browser<br> DISCONNECTED<br><br> ERROR: undefined<br><br> Connecting to: ws://localhost:8080/websocket_2<br><br>I made a dbg trace on all cowboy modules, to start some kind of troubleshooting. In the "tons" of printout I can see this one. So in the bottom of this, there is an {error,enoent}. It comes when tries connect to the socket. But unfortunatelly I do not have idea what may cause this :-(<br><br>The part of trace<br>-----------------------------------------------------------<br> (<0.177.0>) call cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br> {{127,0,0,1},33241},<br> <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br> [<<"websocket_2">>],<br> <<>>,undefined,[],<br> [{<<"host">>,<<"localhost:8080">>},<br> {<<"connection">>,<<"Upgrade">>},<br> {<<"pragma">>,<<"no-cache">>},<br> {<<"cache-control">>,<<"no-cache">>},<br> {<<"upgrade">>,<<"websocket">>},<br> {<<"origin">>,<<"<a href="http://localhost:8080">http://localhost:8080</a>">>},<br> {<<"sec-websocket-version">>,<<"13">>},<br> {<<"user-agent">>,<br> <<"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br> {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br> {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br> {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br> {<<"sec-websocket-extensions">>,<br> <<"permessage-deflate; client_max_window_bits">>}],<br> [{<<"connection">>,[<<"upgrade">>]}],<br> undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br> {handler_opts,{priv_dir,websocket_2,[]}},<br> {listener,http},<br> {dispatch,[{'_',[],<br> [{[],[],cowboy_static,<br> {priv_file,websocket_2,"index.html"}},<br> {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br> {[<<"websocket_2">>],[],ws_handler_2,[]},<br> {[<<"static">>,'...'],<br> [],cowboy_static,<br> {priv_dir,websocket_2,"static"}}]}]}],<br> <<"GET">>,cowboy_static,<br> {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br> {error,enoent},<br> []},<br> undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br> undefined,undefined},#Fun<cowboy_rest.2.41839999>) (Timestamp: {1435,<br> 46126,<br> 935663})<br><br>I guess, I did something very wrong, but I did not found what is that, thus I would like to get some help from you.<br><br>Please find my small project in github: <a href="https://github.com/ethrbh/websocket_2">https://github.com/ethrbh/websocket_2</a><br><br>thanks for your help,<br>/Robi<br><br></div>
<br> + +</tt> diff --git a/archives/extend/attachments/20150623/dd7366a3/attachment-0001.html b/archives/extend/attachments/20150623/dd7366a3/attachment-0001.html new file mode 100644 index 00000000..26109560 --- /dev/null +++ b/archives/extend/attachments/20150623/dd7366a3/attachment-0001.html @@ -0,0 +1,160 @@ +<tt> +<div dir="ltr">I think the order of your routes is the problem, try putting this <a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17">line</a> last.</div><div class="gmail_extra"><br><div class="gmail_quote">On 23 June 2015 at 09:56, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The {error, enoent}, especially there, is probably just because the browser is trying to fetch the favicon.<br><br> +<br><br> +Your issue is that Websocket won't connect, so it has nothing to do with cowboy_rest. Try tracing cowboy_websocket or enable SASL to have more info.<div><div class="h5"><br><br> +<br><br> +On 06/23/2015 10:28 AM, Robert Balogh wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +hello,<br><br> +<br><br> +First of all I would say I am a beginner in Cowboy web server, so<br><br> +probably I made something wrong, that is why I got the "fault", what I got.<br><br> +<br><br> +I would like to build up web page, where the client can communicate to<br><br> +server, and server can do the same to client, if client does not send<br><br> +anything to server too. The Cowboy has the websocket example, what does<br><br> +what I would like to do.<br><br> +<br><br> +There is only one thing is missing what I would like to have. This is<br><br> +the "frameset". My idea is to build the index.html using framsets. I<br><br> +made this changes, and I build up the html files for the frames, and of<br><br> +course I set these in the index.html.<br><br> +<br><br> +Here is how the index.html looks like<br><br> + <html><br><br> +<br><br> + <head><br><br> + <title>Welcome to Websocket example 2</title><br><br> + </head><br><br> +<br><br> + <frameset rows="64,*"><br><br> + <frame name="top_frame" noresize="noresize" scrolling="no"<br><br> +src="frame_top.html"><br><br> + <frameset cols="450,*"><br><br> + <frame name="left_frame" scrolling="auto"<br><br> +src="frame_left.html"><br><br> + <frame name="right_frame" src="frame_right.html"><br><br> + </frameset><br><br> + <noframes><br><br> + <body><br><br> +<br><br> + </body><br><br> + </noframes><br><br> + </frameset><br><br> +<br><br> + </html><br><br> +<br><br> +This is how the priv folder looks like<br><br> +-----------------------------------------------------------<br><br> + ls priv/<br><br> + frame_left.html frame_right.html frame_top.html index.html static<br><br> +<br><br> +This is how I changed the websocket_2_app:start/2 function<br><br> +-----------------------------------------------------------<br><br> + Dispatch = cowboy_router:compile([<br><br> + {'_', [<br><br> +<br><br> + {"/", cowboy_static, {priv_file, websocket_2, "index.html"}},<br><br> + {"/[...]", cowboy_static, {priv_dir, websocket_2, ""}},<br><br> +<br><br> + {"/websocket_2", ws_handler_2, []},<br><br> + {"/static/[...]", cowboy_static, {priv_dir, websocket_2,<br><br> +"static"}}<br><br> + ]}<br><br> + ]),<br><br> +<br><br> +After compile and make release package of the app, I can reach the<br><br> +webserver on the port 8080, but some connection does not set up<br><br> +correctly. The following texts are present in the browser<br><br> + DISCONNECTED<br><br> +<br><br> + ERROR: undefined<br><br> +<br><br> + Connecting to: ws://localhost:8080/websocket_2<br><br> +<br><br> +I made a dbg trace on all cowboy modules, to start some kind of<br><br> +troubleshooting. In the "tons" of printout I can see this one. So in the<br><br> +bottom of this, there is an {error,enoent}. It comes when tries connect<br><br> +to the socket. But unfortunatelly I do not have idea what may cause this :-(<br><br> +<br><br> +The part of trace<br><br> +-----------------------------------------------------------<br><br> + (<0.177.0>) call<br><br> +cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br><br> + {{127,0,0,1},33241},<br><br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br><br> + [<<"websocket_2">>],<br><br> + <<>>,undefined,[],<br><br> + [{<<"host">>,<<"localhost:8080">>},<br><br> + {<<"connection">>,<<"Upgrade">>},<br><br> + {<<"pragma">>,<<"no-cache">>},<br><br> + {<<"cache-control">>,<<"no-cache">>},<br><br> + {<<"upgrade">>,<<"websocket">>},<br><br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br><br> + {<<"sec-websocket-version">>,<<"13">>},<br><br> + {<<"user-agent">>,<br><br> + <<"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36<br><br> +(KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br><br> + {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br><br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br><br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br><br> + {<<"sec-websocket-extensions">>,<br><br> + <<"permessage-deflate; client_max_window_bits">>}],<br><br> + [{<<"connection">>,[<<"upgrade">>]}],<br><br> +<br><br> +undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br><br> + {handler_opts,{priv_dir,websocket_2,[]}},<br><br> + {listener,http},<br><br> + {dispatch,[{'_',[],<br><br> + [{[],[],cowboy_static,<br><br> + {priv_file,websocket_2,"index.html"}},<br><br> +<br><br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br><br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br><br> + {[<<"static">>,'...'],<br><br> + [],cowboy_static,<br><br> + {priv_dir,websocket_2,"static"}}]}]}],<br><br> + <<"GET">>,cowboy_static,<br><br> +<br><br> +{<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br><br> + {error,enoent},<br><br> + []},<br><br> +<br><br> +undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br><br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br><br> +(Timestamp: {1435,<br><br> +<br><br> + 46126,<br><br> +<br><br> + 935663})<br><br> +<br><br> +I guess, I did something very wrong, but I did not found what is that,<br><br> +thus I would like to get some help from you.<br><br> +<br><br> +Please find my small project in github:<br><br> +<a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br><br> +<br><br> +thanks for your help,<br><br> +/Robi<br><br> +<br><br> +<br><br> +<br></div></div><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150623/dd7366a3/attachment.html b/archives/extend/attachments/20150623/dd7366a3/attachment.html new file mode 100644 index 00000000..26109560 --- /dev/null +++ b/archives/extend/attachments/20150623/dd7366a3/attachment.html @@ -0,0 +1,160 @@ +<tt> +<div dir="ltr">I think the order of your routes is the problem, try putting this <a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17">line</a> last.</div><div class="gmail_extra"><br><div class="gmail_quote">On 23 June 2015 at 09:56, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The {error, enoent}, especially there, is probably just because the browser is trying to fetch the favicon.<br><br> +<br><br> +Your issue is that Websocket won't connect, so it has nothing to do with cowboy_rest. Try tracing cowboy_websocket or enable SASL to have more info.<div><div class="h5"><br><br> +<br><br> +On 06/23/2015 10:28 AM, Robert Balogh wrote:<br><br> +</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br> +hello,<br><br> +<br><br> +First of all I would say I am a beginner in Cowboy web server, so<br><br> +probably I made something wrong, that is why I got the "fault", what I got.<br><br> +<br><br> +I would like to build up web page, where the client can communicate to<br><br> +server, and server can do the same to client, if client does not send<br><br> +anything to server too. The Cowboy has the websocket example, what does<br><br> +what I would like to do.<br><br> +<br><br> +There is only one thing is missing what I would like to have. This is<br><br> +the "frameset". My idea is to build the index.html using framsets. I<br><br> +made this changes, and I build up the html files for the frames, and of<br><br> +course I set these in the index.html.<br><br> +<br><br> +Here is how the index.html looks like<br><br> + <html><br><br> +<br><br> + <head><br><br> + <title>Welcome to Websocket example 2</title><br><br> + </head><br><br> +<br><br> + <frameset rows="64,*"><br><br> + <frame name="top_frame" noresize="noresize" scrolling="no"<br><br> +src="frame_top.html"><br><br> + <frameset cols="450,*"><br><br> + <frame name="left_frame" scrolling="auto"<br><br> +src="frame_left.html"><br><br> + <frame name="right_frame" src="frame_right.html"><br><br> + </frameset><br><br> + <noframes><br><br> + <body><br><br> +<br><br> + </body><br><br> + </noframes><br><br> + </frameset><br><br> +<br><br> + </html><br><br> +<br><br> +This is how the priv folder looks like<br><br> +-----------------------------------------------------------<br><br> + ls priv/<br><br> + frame_left.html frame_right.html frame_top.html index.html static<br><br> +<br><br> +This is how I changed the websocket_2_app:start/2 function<br><br> +-----------------------------------------------------------<br><br> + Dispatch = cowboy_router:compile([<br><br> + {'_', [<br><br> +<br><br> + {"/", cowboy_static, {priv_file, websocket_2, "index.html"}},<br><br> + {"/[...]", cowboy_static, {priv_dir, websocket_2, ""}},<br><br> +<br><br> + {"/websocket_2", ws_handler_2, []},<br><br> + {"/static/[...]", cowboy_static, {priv_dir, websocket_2,<br><br> +"static"}}<br><br> + ]}<br><br> + ]),<br><br> +<br><br> +After compile and make release package of the app, I can reach the<br><br> +webserver on the port 8080, but some connection does not set up<br><br> +correctly. The following texts are present in the browser<br><br> + DISCONNECTED<br><br> +<br><br> + ERROR: undefined<br><br> +<br><br> + Connecting to: ws://localhost:8080/websocket_2<br><br> +<br><br> +I made a dbg trace on all cowboy modules, to start some kind of<br><br> +troubleshooting. In the "tons" of printout I can see this one. So in the<br><br> +bottom of this, there is an {error,enoent}. It comes when tries connect<br><br> +to the socket. But unfortunatelly I do not have idea what may cause this :-(<br><br> +<br><br> +The part of trace<br><br> +-----------------------------------------------------------<br><br> + (<0.177.0>) call<br><br> +cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br><br> + {{127,0,0,1},33241},<br><br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br><br> + [<<"websocket_2">>],<br><br> + <<>>,undefined,[],<br><br> + [{<<"host">>,<<"localhost:8080">>},<br><br> + {<<"connection">>,<<"Upgrade">>},<br><br> + {<<"pragma">>,<<"no-cache">>},<br><br> + {<<"cache-control">>,<<"no-cache">>},<br><br> + {<<"upgrade">>,<<"websocket">>},<br><br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br><br> + {<<"sec-websocket-version">>,<<"13">>},<br><br> + {<<"user-agent">>,<br><br> + <<"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36<br><br> +(KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br><br> + {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br><br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br><br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br><br> + {<<"sec-websocket-extensions">>,<br><br> + <<"permessage-deflate; client_max_window_bits">>}],<br><br> + [{<<"connection">>,[<<"upgrade">>]}],<br><br> +<br><br> +undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br><br> + {handler_opts,{priv_dir,websocket_2,[]}},<br><br> + {listener,http},<br><br> + {dispatch,[{'_',[],<br><br> + [{[],[],cowboy_static,<br><br> + {priv_file,websocket_2,"index.html"}},<br><br> +<br><br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br><br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br><br> + {[<<"static">>,'...'],<br><br> + [],cowboy_static,<br><br> + {priv_dir,websocket_2,"static"}}]}]}],<br><br> + <<"GET">>,cowboy_static,<br><br> +<br><br> +{<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br><br> + {error,enoent},<br><br> + []},<br><br> +<br><br> +undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br><br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br><br> +(Timestamp: {1435,<br><br> +<br><br> + 46126,<br><br> +<br><br> + 935663})<br><br> +<br><br> +I guess, I did something very wrong, but I did not found what is that,<br><br> +thus I would like to get some help from you.<br><br> +<br><br> +Please find my small project in github:<br><br> +<a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br><br> +<br><br> +thanks for your help,<br><br> +/Robi<br><br> +<br><br> +<br><br> +<br></div></div><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><span class="HOEnZb"><font color="#888888"><br> +</font></span></blockquote><span class="HOEnZb"><font color="#888888"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +</font></span></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150623/f7c19f68/attachment-0001.html b/archives/extend/attachments/20150623/f7c19f68/attachment-0001.html new file mode 100644 index 00000000..d9145fe0 --- /dev/null +++ b/archives/extend/attachments/20150623/f7c19f68/attachment-0001.html @@ -0,0 +1,256 @@ +<tt> +<div dir="ltr"><div><div><div>hello,<br><br></div>I would like to thanks for both of you the grate support.<br><br></div>thanks again,<br></div>/Robi<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-23 11:12 GMT+02:00 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've opened a ticket to remember so something will be done eventually. Thanks for helping!<span class=""><br>
<br> +<br>
<br> +On 06/23/2015 11:11 AM, Graham Hay wrote:<br>
<br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br> +It's bitten me a few times :(<br>
<br> +<br>
<br> +On 23 June 2015 at 10:09, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><span class="">
<br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br>
<br> +<br>
<br> + Oh nice catch ahah. We should probably warn when something like this<br>
<br> + happens.<br>
<br> +<br>
<br> + On 06/23/2015 11:06 AM, Graham Hay wrote:<br>
<br> +<br>
<br> + I think the order of your routes is the problem, try putting<br>
<br> + this line<br>
<br> + <<a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17</a>><br>
<br> + last.<br>
<br> +<br>
<br> + On 23 June 2015 at 09:56, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></span><div><div class="h5">
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>>> wrote:<br>
<br> +<br>
<br> + The {error, enoent}, especially there, is probably just<br>
<br> + because the<br>
<br> + browser is trying to fetch the favicon.<br>
<br> +<br>
<br> + Your issue is that Websocket won't connect, so it has<br>
<br> + nothing to do<br>
<br> + with cowboy_rest. Try tracing cowboy_websocket or enable<br>
<br> + SASL to<br>
<br> + have more info.<br>
<br> +<br>
<br> +<br>
<br> + On 06/23/2015 10:28 AM, Robert Balogh wrote:<br>
<br> +<br>
<br> + hello,<br>
<br> +<br>
<br> + First of all I would say I am a beginner in Cowboy web<br>
<br> + server, so<br>
<br> + probably I made something wrong, that is why I got the<br>
<br> + "fault",<br>
<br> + what I got.<br>
<br> +<br>
<br> + I would like to build up web page, where the client can<br>
<br> + communicate to<br>
<br> + server, and server can do the same to client, if client<br>
<br> + does not<br>
<br> + send<br>
<br> + anything to server too. The Cowboy has the websocket<br>
<br> + example,<br>
<br> + what does<br>
<br> + what I would like to do.<br>
<br> +<br>
<br> + There is only one thing is missing what I would like to<br>
<br> + have.<br>
<br> + This is<br>
<br> + the "frameset". My idea is to build the index.html<br>
<br> + using framsets. I<br>
<br> + made this changes, and I build up the html files for<br>
<br> + the frames,<br>
<br> + and of<br>
<br> + course I set these in the index.html.<br>
<br> +<br>
<br> + Here is how the index.html looks like<br>
<br> + <html><br>
<br> +<br>
<br> + <head><br>
<br> + <title>Welcome to Websocket example 2</title><br>
<br> + </head><br>
<br> +<br>
<br> + <frameset rows="64,*"><br>
<br> + <frame name="top_frame" noresize="noresize"<br>
<br> + scrolling="no"<br>
<br> + src="frame_top.html"><br>
<br> + <frameset cols="450,*"><br>
<br> + <frame name="left_frame" scrolling="auto"<br>
<br> + src="frame_left.html"><br>
<br> + <frame name="right_frame"<br>
<br> + src="frame_right.html"><br>
<br> + </frameset><br>
<br> + <noframes><br>
<br> + <body><br>
<br> +<br>
<br> + </body><br>
<br> + </noframes><br>
<br> + </frameset><br>
<br> +<br>
<br> + </html><br>
<br> +<br>
<br> + This is how the priv folder looks like<br>
<br> + -----------------------------------------------------------<br>
<br> + ls priv/<br>
<br> + frame_left.html frame_right.html frame_top.html<br>
<br> + index.html static<br>
<br> +<br>
<br> + This is how I changed the websocket_2_app:start/2 function<br>
<br> + -----------------------------------------------------------<br>
<br> + Dispatch = cowboy_router:compile([<br>
<br> + {'_', [<br>
<br> +<br>
<br> + {"/", cowboy_static, {priv_file, websocket_2,<br>
<br> + "index.html"}},<br>
<br> + {"/[...]", cowboy_static, {priv_dir,<br>
<br> + websocket_2,<br>
<br> + ""}},<br>
<br> +<br>
<br> + {"/websocket_2", ws_handler_2, []},<br>
<br> + {"/static/[...]", cowboy_static, {priv_dir,<br>
<br> + websocket_2,<br>
<br> + "static"}}<br>
<br> + ]}<br>
<br> + ]),<br>
<br> +<br>
<br> + After compile and make release package of the app, I<br>
<br> + can reach the<br>
<br> + webserver on the port 8080, but some connection does<br>
<br> + not set up<br>
<br> + correctly. The following texts are present in the browser<br>
<br> + DISCONNECTED<br>
<br> +<br>
<br> + ERROR: undefined<br>
<br> +<br>
<br> + Connecting to: ws://localhost:8080/websocket_2<br>
<br> +<br>
<br> + I made a dbg trace on all cowboy modules, to start some<br>
<br> + kind of<br>
<br> + troubleshooting. In the "tons" of printout I can see<br>
<br> + this one.<br>
<br> + So in the<br>
<br> + bottom of this, there is an {error,enoent}. It comes<br>
<br> + when tries<br>
<br> + connect<br>
<br> + to the socket. But unfortunatelly I do not have idea<br>
<br> + what may<br>
<br> + cause this :-(<br>
<br> +<br>
<br> + The part of trace<br>
<br> + -----------------------------------------------------------<br>
<br> + (<0.177.0>) call<br>
<br> +<br>
<br> + cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br>
<br> + {{127,0,0,1},33241},<br>
<br> +<br>
<br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br>
<br> + [<<"websocket_2">>],<br>
<br> + <<>>,undefined,[],<br>
<br> + [{<<"host">>,<<"localhost:8080">>},<br>
<br> + {<<"connection">>,<<"Upgrade">>},<br>
<br> + {<<"pragma">>,<<"no-cache">>},<br>
<br> + {<<"cache-control">>,<<"no-cache">>},<br>
<br> + {<<"upgrade">>,<<"websocket">>},<br>
<br> +<br>
<br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br>
<br> + {<<"sec-websocket-version">>,<<"13">>},<br>
<br> + {<<"user-agent">>,<br>
<br> + <<"Mozilla/5.0 (X11; Linux i686)<br>
<br> + AppleWebKit/537.36<br>
<br> + (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br>
<br> + {<<"accept-encoding">>,<<"gzip,<br>
<br> + deflate, sdch">>},<br>
<br> +<br>
<br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br>
<br> +<br>
<br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br>
<br> + {<<"sec-websocket-extensions">>,<br>
<br> + <<"permessage-deflate;<br>
<br> + client_max_window_bits">>}],<br>
<br> + [{<<"connection">>,[<<"upgrade">>]}],<br>
<br> +<br>
<br> +<br>
<br> + undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br>
<br> + {handler_opts,{priv_dir,websocket_2,[]}},<br>
<br> + {listener,http},<br>
<br> + {dispatch,[{'_',[],<br>
<br> + [{[],[],cowboy_static,<br>
<br> +<br>
<br> + {priv_file,websocket_2,"index.html"}},<br>
<br> +<br>
<br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br>
<br> +<br>
<br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br>
<br> + {[<<"static">>,'...'],<br>
<br> + [],cowboy_static,<br>
<br> +<br>
<br> + {priv_dir,websocket_2,"static"}}]}]}],<br>
<br> + <<"GET">>,cowboy_static,<br>
<br> +<br>
<br> +<br>
<br> + {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br>
<br> + {error,enoent},<br>
<br> + []},<br>
<br> +<br>
<br> +<br>
<br> + undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br>
<br> +<br>
<br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br>
<br> + (Timestamp: {1435,<br>
<br> +<br>
<br> + 46126,<br>
<br> +<br>
<br> + 935663})<br>
<br> +<br>
<br> + I guess, I did something very wrong, but I did not<br>
<br> + found what is<br>
<br> + that,<br>
<br> + thus I would like to get some help from you.<br>
<br> +<br>
<br> + Please find my small project in github:<br>
<br> + <a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br>
<br> +<br>
<br> + thanks for your help,<br>
<br> + /Robi<br>
<br> +<br>
<br> +<br>
<br> +<br>
<br> + _______________________________________________<br>
<br> + Extend mailing list<br>
<br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></div></div>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a><span class=""><br>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>><br>
<br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br>
<br> +<br>
<br> +<br>
<br> + --<br>
<br> + Loïc Hoguin<br>
<br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
<br> + Author of The Erlanger Playbook,<br>
<br> + A book about software development using Erlang<br>
<br> + _______________________________________________<br>
<br> + Extend mailing list<br>
<br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></span>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a><span class=""><br>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>><br>
<br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br>
<br> +<br>
<br> +<br>
<br> +<br>
<br> + --<br>
<br> + Loïc Hoguin<br>
<br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
<br> + Author of The Erlanger Playbook,<br>
<br> + A book about software development using Erlang<br>
<br> +<br>
<br> +<br>
<br> +</span></blockquote><div class="HOEnZb"><div class="h5">
<br> +<br>
<br> +-- <br>
<br> +Loïc Hoguin<br>
<br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
<br> +Author of The Erlanger Playbook,<br>
<br> +A book about software development using Erlang<br>
<br> +</div></div></blockquote></div><br></div>
<br> + +</tt> diff --git a/archives/extend/attachments/20150623/f7c19f68/attachment.html b/archives/extend/attachments/20150623/f7c19f68/attachment.html new file mode 100644 index 00000000..d9145fe0 --- /dev/null +++ b/archives/extend/attachments/20150623/f7c19f68/attachment.html @@ -0,0 +1,256 @@ +<tt> +<div dir="ltr"><div><div><div>hello,<br><br></div>I would like to thanks for both of you the grate support.<br><br></div>thanks again,<br></div>/Robi<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-23 11:12 GMT+02:00 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've opened a ticket to remember so something will be done eventually. Thanks for helping!<span class=""><br>
<br> +<br>
<br> +On 06/23/2015 11:11 AM, Graham Hay wrote:<br>
<br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br> +It's bitten me a few times :(<br>
<br> +<br>
<br> +On 23 June 2015 at 10:09, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><span class="">
<br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br>
<br> +<br>
<br> + Oh nice catch ahah. We should probably warn when something like this<br>
<br> + happens.<br>
<br> +<br>
<br> + On 06/23/2015 11:06 AM, Graham Hay wrote:<br>
<br> +<br>
<br> + I think the order of your routes is the problem, try putting<br>
<br> + this line<br>
<br> + <<a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17</a>><br>
<br> + last.<br>
<br> +<br>
<br> + On 23 June 2015 at 09:56, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></span><div><div class="h5">
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>>> wrote:<br>
<br> +<br>
<br> + The {error, enoent}, especially there, is probably just<br>
<br> + because the<br>
<br> + browser is trying to fetch the favicon.<br>
<br> +<br>
<br> + Your issue is that Websocket won't connect, so it has<br>
<br> + nothing to do<br>
<br> + with cowboy_rest. Try tracing cowboy_websocket or enable<br>
<br> + SASL to<br>
<br> + have more info.<br>
<br> +<br>
<br> +<br>
<br> + On 06/23/2015 10:28 AM, Robert Balogh wrote:<br>
<br> +<br>
<br> + hello,<br>
<br> +<br>
<br> + First of all I would say I am a beginner in Cowboy web<br>
<br> + server, so<br>
<br> + probably I made something wrong, that is why I got the<br>
<br> + "fault",<br>
<br> + what I got.<br>
<br> +<br>
<br> + I would like to build up web page, where the client can<br>
<br> + communicate to<br>
<br> + server, and server can do the same to client, if client<br>
<br> + does not<br>
<br> + send<br>
<br> + anything to server too. The Cowboy has the websocket<br>
<br> + example,<br>
<br> + what does<br>
<br> + what I would like to do.<br>
<br> +<br>
<br> + There is only one thing is missing what I would like to<br>
<br> + have.<br>
<br> + This is<br>
<br> + the "frameset". My idea is to build the index.html<br>
<br> + using framsets. I<br>
<br> + made this changes, and I build up the html files for<br>
<br> + the frames,<br>
<br> + and of<br>
<br> + course I set these in the index.html.<br>
<br> +<br>
<br> + Here is how the index.html looks like<br>
<br> + <html><br>
<br> +<br>
<br> + <head><br>
<br> + <title>Welcome to Websocket example 2</title><br>
<br> + </head><br>
<br> +<br>
<br> + <frameset rows="64,*"><br>
<br> + <frame name="top_frame" noresize="noresize"<br>
<br> + scrolling="no"<br>
<br> + src="frame_top.html"><br>
<br> + <frameset cols="450,*"><br>
<br> + <frame name="left_frame" scrolling="auto"<br>
<br> + src="frame_left.html"><br>
<br> + <frame name="right_frame"<br>
<br> + src="frame_right.html"><br>
<br> + </frameset><br>
<br> + <noframes><br>
<br> + <body><br>
<br> +<br>
<br> + </body><br>
<br> + </noframes><br>
<br> + </frameset><br>
<br> +<br>
<br> + </html><br>
<br> +<br>
<br> + This is how the priv folder looks like<br>
<br> + -----------------------------------------------------------<br>
<br> + ls priv/<br>
<br> + frame_left.html frame_right.html frame_top.html<br>
<br> + index.html static<br>
<br> +<br>
<br> + This is how I changed the websocket_2_app:start/2 function<br>
<br> + -----------------------------------------------------------<br>
<br> + Dispatch = cowboy_router:compile([<br>
<br> + {'_', [<br>
<br> +<br>
<br> + {"/", cowboy_static, {priv_file, websocket_2,<br>
<br> + "index.html"}},<br>
<br> + {"/[...]", cowboy_static, {priv_dir,<br>
<br> + websocket_2,<br>
<br> + ""}},<br>
<br> +<br>
<br> + {"/websocket_2", ws_handler_2, []},<br>
<br> + {"/static/[...]", cowboy_static, {priv_dir,<br>
<br> + websocket_2,<br>
<br> + "static"}}<br>
<br> + ]}<br>
<br> + ]),<br>
<br> +<br>
<br> + After compile and make release package of the app, I<br>
<br> + can reach the<br>
<br> + webserver on the port 8080, but some connection does<br>
<br> + not set up<br>
<br> + correctly. The following texts are present in the browser<br>
<br> + DISCONNECTED<br>
<br> +<br>
<br> + ERROR: undefined<br>
<br> +<br>
<br> + Connecting to: ws://localhost:8080/websocket_2<br>
<br> +<br>
<br> + I made a dbg trace on all cowboy modules, to start some<br>
<br> + kind of<br>
<br> + troubleshooting. In the "tons" of printout I can see<br>
<br> + this one.<br>
<br> + So in the<br>
<br> + bottom of this, there is an {error,enoent}. It comes<br>
<br> + when tries<br>
<br> + connect<br>
<br> + to the socket. But unfortunatelly I do not have idea<br>
<br> + what may<br>
<br> + cause this :-(<br>
<br> +<br>
<br> + The part of trace<br>
<br> + -----------------------------------------------------------<br>
<br> + (<0.177.0>) call<br>
<br> +<br>
<br> + cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br>
<br> + {{127,0,0,1},33241},<br>
<br> +<br>
<br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br>
<br> + [<<"websocket_2">>],<br>
<br> + <<>>,undefined,[],<br>
<br> + [{<<"host">>,<<"localhost:8080">>},<br>
<br> + {<<"connection">>,<<"Upgrade">>},<br>
<br> + {<<"pragma">>,<<"no-cache">>},<br>
<br> + {<<"cache-control">>,<<"no-cache">>},<br>
<br> + {<<"upgrade">>,<<"websocket">>},<br>
<br> +<br>
<br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br>
<br> + {<<"sec-websocket-version">>,<<"13">>},<br>
<br> + {<<"user-agent">>,<br>
<br> + <<"Mozilla/5.0 (X11; Linux i686)<br>
<br> + AppleWebKit/537.36<br>
<br> + (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br>
<br> + {<<"accept-encoding">>,<<"gzip,<br>
<br> + deflate, sdch">>},<br>
<br> +<br>
<br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br>
<br> +<br>
<br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br>
<br> + {<<"sec-websocket-extensions">>,<br>
<br> + <<"permessage-deflate;<br>
<br> + client_max_window_bits">>}],<br>
<br> + [{<<"connection">>,[<<"upgrade">>]}],<br>
<br> +<br>
<br> +<br>
<br> + undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br>
<br> + {handler_opts,{priv_dir,websocket_2,[]}},<br>
<br> + {listener,http},<br>
<br> + {dispatch,[{'_',[],<br>
<br> + [{[],[],cowboy_static,<br>
<br> +<br>
<br> + {priv_file,websocket_2,"index.html"}},<br>
<br> +<br>
<br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br>
<br> +<br>
<br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br>
<br> + {[<<"static">>,'...'],<br>
<br> + [],cowboy_static,<br>
<br> +<br>
<br> + {priv_dir,websocket_2,"static"}}]}]}],<br>
<br> + <<"GET">>,cowboy_static,<br>
<br> +<br>
<br> +<br>
<br> + {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br>
<br> + {error,enoent},<br>
<br> + []},<br>
<br> +<br>
<br> +<br>
<br> + undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br>
<br> +<br>
<br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br>
<br> + (Timestamp: {1435,<br>
<br> +<br>
<br> + 46126,<br>
<br> +<br>
<br> + 935663})<br>
<br> +<br>
<br> + I guess, I did something very wrong, but I did not<br>
<br> + found what is<br>
<br> + that,<br>
<br> + thus I would like to get some help from you.<br>
<br> +<br>
<br> + Please find my small project in github:<br>
<br> + <a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br>
<br> +<br>
<br> + thanks for your help,<br>
<br> + /Robi<br>
<br> +<br>
<br> +<br>
<br> +<br>
<br> + _______________________________________________<br>
<br> + Extend mailing list<br>
<br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></div></div>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a><span class=""><br>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>><br>
<br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br>
<br> +<br>
<br> +<br>
<br> + --<br>
<br> + Loïc Hoguin<br>
<br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
<br> + Author of The Erlanger Playbook,<br>
<br> + A book about software development using Erlang<br>
<br> + _______________________________________________<br>
<br> + Extend mailing list<br>
<br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br></span>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a><span class=""><br>
<br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>><br>
<br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br>
<br> +<br>
<br> +<br>
<br> +<br>
<br> + --<br>
<br> + Loïc Hoguin<br>
<br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
<br> + Author of The Erlanger Playbook,<br>
<br> + A book about software development using Erlang<br>
<br> +<br>
<br> +<br>
<br> +</span></blockquote><div class="HOEnZb"><div class="h5">
<br> +<br>
<br> +-- <br>
<br> +Loïc Hoguin<br>
<br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
<br> +Author of The Erlanger Playbook,<br>
<br> +A book about software development using Erlang<br>
<br> +</div></div></blockquote></div><br></div>
<br> + +</tt> diff --git a/archives/extend/attachments/20150623/fcdb2d7b/attachment-0001.html b/archives/extend/attachments/20150623/fcdb2d7b/attachment-0001.html new file mode 100644 index 00000000..70f7ec08 --- /dev/null +++ b/archives/extend/attachments/20150623/fcdb2d7b/attachment-0001.html @@ -0,0 +1,203 @@ +<tt> +<div dir="ltr"><div><div><div><div><div>hello,<br><br></div>Thanks for all. The solution is to put the line at last<br> {<span class=""><span class="">"</span>/[...]<span class="">"</span></span>, <span class="">cowboy_static</span>, {<span class="">priv_dir</span>, <span class="">websocket_2</span>, <span class=""><span class="">"</span><span class="">"</span></span>}}<br><br></div>Now It works as I expect.<br><br></div>thanks for your help again.<br><br></div>br,<br></div>/Robi<br><div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-23 11:09 GMT+02:00 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oh nice catch ahah. We should probably warn when something like this happens.<span class=""><br><br> +<br><br> +On 06/23/2015 11:06 AM, Graham Hay wrote:<br><br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br> +I think the order of your routes is the problem, try putting this line<br></span><br> +<<a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17</a>><span class=""><br><br> +last.<br><br> +<br><br> +On 23 June 2015 at 09:56, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><div><div class="h5"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + The {error, enoent}, especially there, is probably just because the<br><br> + browser is trying to fetch the favicon.<br><br> +<br><br> + Your issue is that Websocket won't connect, so it has nothing to do<br><br> + with cowboy_rest. Try tracing cowboy_websocket or enable SASL to<br><br> + have more info.<br><br> +<br><br> +<br><br> + On 06/23/2015 10:28 AM, Robert Balogh wrote:<br><br> +<br><br> + hello,<br><br> +<br><br> + First of all I would say I am a beginner in Cowboy web server, so<br><br> + probably I made something wrong, that is why I got the "fault",<br><br> + what I got.<br><br> +<br><br> + I would like to build up web page, where the client can<br><br> + communicate to<br><br> + server, and server can do the same to client, if client does not<br><br> + send<br><br> + anything to server too. The Cowboy has the websocket example,<br><br> + what does<br><br> + what I would like to do.<br><br> +<br><br> + There is only one thing is missing what I would like to have.<br><br> + This is<br><br> + the "frameset". My idea is to build the index.html using framsets. I<br><br> + made this changes, and I build up the html files for the frames,<br><br> + and of<br><br> + course I set these in the index.html.<br><br> +<br><br> + Here is how the index.html looks like<br><br> + <html><br><br> +<br><br> + <head><br><br> + <title>Welcome to Websocket example 2</title><br><br> + </head><br><br> +<br><br> + <frameset rows="64,*"><br><br> + <frame name="top_frame" noresize="noresize" scrolling="no"<br><br> + src="frame_top.html"><br><br> + <frameset cols="450,*"><br><br> + <frame name="left_frame" scrolling="auto"<br><br> + src="frame_left.html"><br><br> + <frame name="right_frame" src="frame_right.html"><br><br> + </frameset><br><br> + <noframes><br><br> + <body><br><br> +<br><br> + </body><br><br> + </noframes><br><br> + </frameset><br><br> +<br><br> + </html><br><br> +<br><br> + This is how the priv folder looks like<br><br> + -----------------------------------------------------------<br><br> + ls priv/<br><br> + frame_left.html frame_right.html frame_top.html<br><br> + index.html static<br><br> +<br><br> + This is how I changed the websocket_2_app:start/2 function<br><br> + -----------------------------------------------------------<br><br> + Dispatch = cowboy_router:compile([<br><br> + {'_', [<br><br> +<br><br> + {"/", cowboy_static, {priv_file, websocket_2,<br><br> + "index.html"}},<br><br> + {"/[...]", cowboy_static, {priv_dir, websocket_2,<br><br> + ""}},<br><br> +<br><br> + {"/websocket_2", ws_handler_2, []},<br><br> + {"/static/[...]", cowboy_static, {priv_dir,<br><br> + websocket_2,<br><br> + "static"}}<br><br> + ]}<br><br> + ]),<br><br> +<br><br> + After compile and make release package of the app, I can reach the<br><br> + webserver on the port 8080, but some connection does not set up<br><br> + correctly. The following texts are present in the browser<br><br> + DISCONNECTED<br><br> +<br><br> + ERROR: undefined<br><br> +<br><br> + Connecting to: ws://localhost:8080/websocket_2<br><br> +<br><br> + I made a dbg trace on all cowboy modules, to start some kind of<br><br> + troubleshooting. In the "tons" of printout I can see this one.<br><br> + So in the<br><br> + bottom of this, there is an {error,enoent}. It comes when tries<br><br> + connect<br><br> + to the socket. But unfortunatelly I do not have idea what may<br><br> + cause this :-(<br><br> +<br><br> + The part of trace<br><br> + -----------------------------------------------------------<br><br> + (<0.177.0>) call<br><br> + cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br><br> + {{127,0,0,1},33241},<br><br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br><br> + [<<"websocket_2">>],<br><br> + <<>>,undefined,[],<br><br> + [{<<"host">>,<<"localhost:8080">>},<br><br> + {<<"connection">>,<<"Upgrade">>},<br><br> + {<<"pragma">>,<<"no-cache">>},<br><br> + {<<"cache-control">>,<<"no-cache">>},<br><br> + {<<"upgrade">>,<<"websocket">>},<br><br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br><br> + {<<"sec-websocket-version">>,<<"13">>},<br><br> + {<<"user-agent">>,<br><br> + <<"Mozilla/5.0 (X11; Linux i686)<br><br> + AppleWebKit/537.36<br><br> + (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br><br> + {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br><br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br><br> +<br><br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br><br> + {<<"sec-websocket-extensions">>,<br><br> + <<"permessage-deflate;<br><br> + client_max_window_bits">>}],<br><br> + [{<<"connection">>,[<<"upgrade">>]}],<br><br> +<br><br> + undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br><br> + {handler_opts,{priv_dir,websocket_2,[]}},<br><br> + {listener,http},<br><br> + {dispatch,[{'_',[],<br><br> + [{[],[],cowboy_static,<br><br> +<br><br> + {priv_file,websocket_2,"index.html"}},<br><br> +<br><br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br><br> +<br><br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br><br> + {[<<"static">>,'...'],<br><br> + [],cowboy_static,<br><br> +<br><br> + {priv_dir,websocket_2,"static"}}]}]}],<br><br> + <<"GET">>,cowboy_static,<br><br> +<br><br> + {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br><br> + {error,enoent},<br><br> + []},<br><br> +<br><br> + undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br><br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br><br> + (Timestamp: {1435,<br><br> +<br><br> + 46126,<br><br> +<br><br> + 935663})<br><br> +<br><br> + I guess, I did something very wrong, but I did not found what is<br><br> + that,<br><br> + thus I would like to get some help from you.<br><br> +<br><br> + Please find my small project in github:<br><br> + <a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br><br> +<br><br> + thanks for your help,<br><br> + /Robi<br><br> +<br><br> +<br><br> +<br><br> + _______________________________________________<br><br> + Extend mailing list<br></div></div><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><span class=""><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> + Author of The Erlanger Playbook,<br><br> + A book about software development using Erlang<br><br> + _______________________________________________<br><br> + Extend mailing list<br></span><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> +</blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150623/fcdb2d7b/attachment.html b/archives/extend/attachments/20150623/fcdb2d7b/attachment.html new file mode 100644 index 00000000..70f7ec08 --- /dev/null +++ b/archives/extend/attachments/20150623/fcdb2d7b/attachment.html @@ -0,0 +1,203 @@ +<tt> +<div dir="ltr"><div><div><div><div><div>hello,<br><br></div>Thanks for all. The solution is to put the line at last<br> {<span class=""><span class="">"</span>/[...]<span class="">"</span></span>, <span class="">cowboy_static</span>, {<span class="">priv_dir</span>, <span class="">websocket_2</span>, <span class=""><span class="">"</span><span class="">"</span></span>}}<br><br></div>Now It works as I expect.<br><br></div>thanks for your help again.<br><br></div>br,<br></div>/Robi<br><div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-23 11:09 GMT+02:00 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oh nice catch ahah. We should probably warn when something like this happens.<span class=""><br><br> +<br><br> +On 06/23/2015 11:06 AM, Graham Hay wrote:<br><br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br> +I think the order of your routes is the problem, try putting this line<br></span><br> +<<a href="https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2/blob/master/src/websocket_2_app.erl#L17</a>><span class=""><br><br> +last.<br><br> +<br><br> +On 23 June 2015 at 09:56, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><div><div class="h5"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + The {error, enoent}, especially there, is probably just because the<br><br> + browser is trying to fetch the favicon.<br><br> +<br><br> + Your issue is that Websocket won't connect, so it has nothing to do<br><br> + with cowboy_rest. Try tracing cowboy_websocket or enable SASL to<br><br> + have more info.<br><br> +<br><br> +<br><br> + On 06/23/2015 10:28 AM, Robert Balogh wrote:<br><br> +<br><br> + hello,<br><br> +<br><br> + First of all I would say I am a beginner in Cowboy web server, so<br><br> + probably I made something wrong, that is why I got the "fault",<br><br> + what I got.<br><br> +<br><br> + I would like to build up web page, where the client can<br><br> + communicate to<br><br> + server, and server can do the same to client, if client does not<br><br> + send<br><br> + anything to server too. The Cowboy has the websocket example,<br><br> + what does<br><br> + what I would like to do.<br><br> +<br><br> + There is only one thing is missing what I would like to have.<br><br> + This is<br><br> + the "frameset". My idea is to build the index.html using framsets. I<br><br> + made this changes, and I build up the html files for the frames,<br><br> + and of<br><br> + course I set these in the index.html.<br><br> +<br><br> + Here is how the index.html looks like<br><br> + <html><br><br> +<br><br> + <head><br><br> + <title>Welcome to Websocket example 2</title><br><br> + </head><br><br> +<br><br> + <frameset rows="64,*"><br><br> + <frame name="top_frame" noresize="noresize" scrolling="no"<br><br> + src="frame_top.html"><br><br> + <frameset cols="450,*"><br><br> + <frame name="left_frame" scrolling="auto"<br><br> + src="frame_left.html"><br><br> + <frame name="right_frame" src="frame_right.html"><br><br> + </frameset><br><br> + <noframes><br><br> + <body><br><br> +<br><br> + </body><br><br> + </noframes><br><br> + </frameset><br><br> +<br><br> + </html><br><br> +<br><br> + This is how the priv folder looks like<br><br> + -----------------------------------------------------------<br><br> + ls priv/<br><br> + frame_left.html frame_right.html frame_top.html<br><br> + index.html static<br><br> +<br><br> + This is how I changed the websocket_2_app:start/2 function<br><br> + -----------------------------------------------------------<br><br> + Dispatch = cowboy_router:compile([<br><br> + {'_', [<br><br> +<br><br> + {"/", cowboy_static, {priv_file, websocket_2,<br><br> + "index.html"}},<br><br> + {"/[...]", cowboy_static, {priv_dir, websocket_2,<br><br> + ""}},<br><br> +<br><br> + {"/websocket_2", ws_handler_2, []},<br><br> + {"/static/[...]", cowboy_static, {priv_dir,<br><br> + websocket_2,<br><br> + "static"}}<br><br> + ]}<br><br> + ]),<br><br> +<br><br> + After compile and make release package of the app, I can reach the<br><br> + webserver on the port 8080, but some connection does not set up<br><br> + correctly. The following texts are present in the browser<br><br> + DISCONNECTED<br><br> +<br><br> + ERROR: undefined<br><br> +<br><br> + Connecting to: ws://localhost:8080/websocket_2<br><br> +<br><br> + I made a dbg trace on all cowboy modules, to start some kind of<br><br> + troubleshooting. In the "tons" of printout I can see this one.<br><br> + So in the<br><br> + bottom of this, there is an {error,enoent}. It comes when tries<br><br> + connect<br><br> + to the socket. But unfortunatelly I do not have idea what may<br><br> + cause this :-(<br><br> +<br><br> + The part of trace<br><br> + -----------------------------------------------------------<br><br> + (<0.177.0>) call<br><br> + cowboy_rest:next({http_req,#Port<0.646>,ranch_tcp,keepalive,<0.177.0>,<<"GET">>,'HTTP/1.1',<br><br> + {{127,0,0,1},33241},<br><br> + <<"localhost">>,undefined,8080,<<"/websocket_2">>,<br><br> + [<<"websocket_2">>],<br><br> + <<>>,undefined,[],<br><br> + [{<<"host">>,<<"localhost:8080">>},<br><br> + {<<"connection">>,<<"Upgrade">>},<br><br> + {<<"pragma">>,<<"no-cache">>},<br><br> + {<<"cache-control">>,<<"no-cache">>},<br><br> + {<<"upgrade">>,<<"websocket">>},<br><br> + {<<"origin">>,<<"<a href="http://localhost:8080" rel="noreferrer" target="_blank">http://localhost:8080</a>">>},<br><br> + {<<"sec-websocket-version">>,<<"13">>},<br><br> + {<<"user-agent">>,<br><br> + <<"Mozilla/5.0 (X11; Linux i686)<br><br> + AppleWebKit/537.36<br><br> + (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36">>},<br><br> + {<<"accept-encoding">>,<<"gzip, deflate, sdch">>},<br><br> + {<<"accept-language">>,<<"en-US,en;q=0.8">>},<br><br> +<br><br> + {<<"sec-websocket-key">>,<<"by/gwaQvb/51W7Wa9zrGQg==">>},<br><br> + {<<"sec-websocket-extensions">>,<br><br> + <<"permessage-deflate;<br><br> + client_max_window_bits">>}],<br><br> + [{<<"connection">>,[<<"upgrade">>]}],<br><br> +<br><br> + undefined,[],waiting,<<>>,undefined,false,waiting,[],<<>>,undefined},{state,[{handler,cowboy_static},<br><br> + {handler_opts,{priv_dir,websocket_2,[]}},<br><br> + {listener,http},<br><br> + {dispatch,[{'_',[],<br><br> + [{[],[],cowboy_static,<br><br> +<br><br> + {priv_file,websocket_2,"index.html"}},<br><br> +<br><br> + {['...'],[],cowboy_static,{priv_dir,websocket_2,[]}},<br><br> +<br><br> + {[<<"websocket_2">>],[],ws_handler_2,[]},<br><br> + {[<<"static">>,'...'],<br><br> + [],cowboy_static,<br><br> +<br><br> + {priv_dir,websocket_2,"static"}}]}]}],<br><br> + <<"GET">>,cowboy_static,<br><br> +<br><br> + {<<"/home/ethrbh/projects/github/websocket_2/_rel/websocket_2/lib/websocket_2-1/priv/websocket_2">>,<br><br> + {error,enoent},<br><br> + []},<br><br> +<br><br> + undefined,[],undefined,[],undefined,[],undefined,false,undefined,<br><br> + undefined,undefined},#Fun<cowboy_rest.2.41839999>)<br><br> + (Timestamp: {1435,<br><br> +<br><br> + 46126,<br><br> +<br><br> + 935663})<br><br> +<br><br> + I guess, I did something very wrong, but I did not found what is<br><br> + that,<br><br> + thus I would like to get some help from you.<br><br> +<br><br> + Please find my small project in github:<br><br> + <a href="https://github.com/ethrbh/websocket_2" rel="noreferrer" target="_blank">https://github.com/ethrbh/websocket_2</a><br><br> +<br><br> + thanks for your help,<br><br> + /Robi<br><br> +<br><br> +<br><br> +<br><br> + _______________________________________________<br><br> + Extend mailing list<br></div></div><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><span class=""><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> + Author of The Erlanger Playbook,<br><br> + A book about software development using Erlang<br><br> + _______________________________________________<br><br> + Extend mailing list<br></span><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> +</blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150624/204c1308/attachment-0001.html b/archives/extend/attachments/20150624/204c1308/attachment-0001.html new file mode 100644 index 00000000..961f2d3b --- /dev/null +++ b/archives/extend/attachments/20150624/204c1308/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div>hello,<br><br></div>According to you grate support I got from you at yesterday, I could continue my project, where I use Cowboy webserver and using Websocket. Now I made an own web page with basic features I need, so the server and client can communicates to eachother. I like it. <br><br>Now I would like to step forward, and I would like to implement a Request-Response mechanism. I read few articles in to this topic, and all of them has mentioned this "feature" is not part of the Websocket standard. They were suggested to use some sub-protocols for this, but I did not see any written in Erlang.<br><br></div>So, I would like to ask you, do I understand right that Cowboy does not have this feature too? If so, do you have some idea how can I implement a basic request-response mechanism? Probably one of you guys in this forum have some idea.<br><br></div><div>Btw, the links I read about this topic:<br> <a href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br> <a href="http://alabor.me/articles/request-response-oriented-websockets/">http://alabor.me/articles/request-response-oriented-websockets/</a><br> <a href="https://www.npmjs.com/package/primus-responder">https://www.npmjs.com/package/primus-responder</a><br></div><div><br></div>thanks for your help,<br></div>/Robi<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150624/204c1308/attachment.html b/archives/extend/attachments/20150624/204c1308/attachment.html new file mode 100644 index 00000000..961f2d3b --- /dev/null +++ b/archives/extend/attachments/20150624/204c1308/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div>hello,<br><br></div>According to you grate support I got from you at yesterday, I could continue my project, where I use Cowboy webserver and using Websocket. Now I made an own web page with basic features I need, so the server and client can communicates to eachother. I like it. <br><br>Now I would like to step forward, and I would like to implement a Request-Response mechanism. I read few articles in to this topic, and all of them has mentioned this "feature" is not part of the Websocket standard. They were suggested to use some sub-protocols for this, but I did not see any written in Erlang.<br><br></div>So, I would like to ask you, do I understand right that Cowboy does not have this feature too? If so, do you have some idea how can I implement a basic request-response mechanism? Probably one of you guys in this forum have some idea.<br><br></div><div>Btw, the links I read about this topic:<br> <a href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br> <a href="http://alabor.me/articles/request-response-oriented-websockets/">http://alabor.me/articles/request-response-oriented-websockets/</a><br> <a href="https://www.npmjs.com/package/primus-responder">https://www.npmjs.com/package/primus-responder</a><br></div><div><br></div>thanks for your help,<br></div>/Robi<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150624/6d15706e/attachment-0001.html b/archives/extend/attachments/20150624/6d15706e/attachment-0001.html new file mode 100644 index 00000000..3d01eba7 --- /dev/null +++ b/archives/extend/attachments/20150624/6d15706e/attachment-0001.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr">I think you'd have to roll your own, you just need some way to <a href="http://www.enterpriseintegrationpatterns.com/CorrelationIdentifier.html" target="_blank">correlate</a> responses with the originating request. OTP does something similar under the hood with gen_server <a href="http://www.erlang.org/doc/man/gen_server.html#call-2" target="_blank">calls</a>.<div><br></div><div>It's also possible to treat the ws connection as a messaging channel, and use something like <a href="http://www.enterpriseintegrationpatterns.com/MessageSelector.html" target="_blank">selective consumer</a> to de-multiplex the messages. e.g. you could add a type/channel field to each message, and only subscribe to those messages.</div><div><br></div><div>Remember that once you move into an async world, there are no guarantees that you will receive a response! So you need to start thinking about timeouts etc.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 June 2015 at 10:18, Robert Balogh <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>hello,<br><br></div>According to you grate support I got from you at yesterday, I could continue my project, where I use Cowboy webserver and using Websocket. Now I made an own web page with basic features I need, so the server and client can communicates to eachother. I like it. <br><br>Now I would like to step forward, and I would like to implement a Request-Response mechanism. I read few articles in to this topic, and all of them has mentioned this "feature" is not part of the Websocket standard. They were suggested to use some sub-protocols for this, but I did not see any written in Erlang.<br><br></div>So, I would like to ask you, do I understand right that Cowboy does not have this feature too? If so, do you have some idea how can I implement a basic request-response mechanism? Probably one of you guys in this forum have some idea.<br><br></div><div>Btw, the links I read about this topic:<br> <a href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol" target="_blank">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br> <a href="http://alabor.me/articles/request-response-oriented-websockets/" target="_blank">http://alabor.me/articles/request-response-oriented-websockets/</a><br> <a href="https://www.npmjs.com/package/primus-responder" target="_blank">https://www.npmjs.com/package/primus-responder</a><br></div><div><br></div>thanks for your help,<br></div>/Robi<br></div><br> +<br>_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br></blockquote></div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20150624/6d15706e/attachment.html b/archives/extend/attachments/20150624/6d15706e/attachment.html new file mode 100644 index 00000000..3d01eba7 --- /dev/null +++ b/archives/extend/attachments/20150624/6d15706e/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr">I think you'd have to roll your own, you just need some way to <a href="http://www.enterpriseintegrationpatterns.com/CorrelationIdentifier.html" target="_blank">correlate</a> responses with the originating request. OTP does something similar under the hood with gen_server <a href="http://www.erlang.org/doc/man/gen_server.html#call-2" target="_blank">calls</a>.<div><br></div><div>It's also possible to treat the ws connection as a messaging channel, and use something like <a href="http://www.enterpriseintegrationpatterns.com/MessageSelector.html" target="_blank">selective consumer</a> to de-multiplex the messages. e.g. you could add a type/channel field to each message, and only subscribe to those messages.</div><div><br></div><div>Remember that once you move into an async world, there are no guarantees that you will receive a response! So you need to start thinking about timeouts etc.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 June 2015 at 10:18, Robert Balogh <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>hello,<br><br></div>According to you grate support I got from you at yesterday, I could continue my project, where I use Cowboy webserver and using Websocket. Now I made an own web page with basic features I need, so the server and client can communicates to eachother. I like it. <br><br>Now I would like to step forward, and I would like to implement a Request-Response mechanism. I read few articles in to this topic, and all of them has mentioned this "feature" is not part of the Websocket standard. They were suggested to use some sub-protocols for this, but I did not see any written in Erlang.<br><br></div>So, I would like to ask you, do I understand right that Cowboy does not have this feature too? If so, do you have some idea how can I implement a basic request-response mechanism? Probably one of you guys in this forum have some idea.<br><br></div><div>Btw, the links I read about this topic:<br> <a href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol" target="_blank">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br> <a href="http://alabor.me/articles/request-response-oriented-websockets/" target="_blank">http://alabor.me/articles/request-response-oriented-websockets/</a><br> <a href="https://www.npmjs.com/package/primus-responder" target="_blank">https://www.npmjs.com/package/primus-responder</a><br></div><div><br></div>thanks for your help,<br></div>/Robi<br></div><br> +<br>_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br></blockquote></div><br></div></div><br> + +</tt> diff --git a/archives/extend/attachments/20150624/72689ab9/attachment-0001.html b/archives/extend/attachments/20150624/72689ab9/attachment-0001.html new file mode 100644 index 00000000..fb95808d --- /dev/null +++ b/archives/extend/attachments/20150624/72689ab9/attachment-0001.html @@ -0,0 +1,72 @@ +<tt> +<div dir="ltr"><div><div><div><div>hello,<br><br></div>I would like to thanks the response to all of you. I will try keep all these in my mind.<br><br></div>@Bas, thanks for your note about <a href="https://github.com/bwegh/erwa" target="_blank">erwa</a>, I will take a look.<br><br></div>thanks again,<br></div>/Robi<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-24 12:28 GMT+02:00 Bas Wegh <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> + <br> + <br> + <br> + <div bgcolor="#FFFFFF" text="#000000"><br> + hello Robi,<br><br> + <br><br> + you might be interested in erwa:<br><br> + <a href="https://github.com/bwegh/erwa" target="_blank">https://github.com/bwegh/erwa</a><br><br> + <br><br> + Cheers,<br><br> + Bas<span class=""><br><br> + <br><br> + <div>On 06/24/2015 11:18 AM, Robert Balogh<br> + wrote:<br><br> + </div><br> + </span><blockquote type="cite"><div><div class="h5"><br> + <div dir="ltr"><br> + <div><br> + <div><br> + <div><br> + <div>hello,<br><br> + <br><br> + </div><br> + According to you grate support I got from you at<br> + yesterday, I could continue my project, where I use Cowboy<br> + webserver and using Websocket. Now I made an own web page<br> + with basic features I need, so the server and client can<br> + communicates to eachother. I like it. <br><br> + <br><br> + Now I would like to step forward, and I would like to<br> + implement a Request-Response mechanism. I read few<br> + articles in to this topic, and all of them has mentioned<br> + this "feature" is not part of the Websocket standard. They<br> + were suggested to use some sub-protocols for this, but I<br> + did not see any written in Erlang.<br><br> + <br><br> + </div><br> + So, I would like to ask you, do I understand right that<br> + Cowboy does not have this feature too? If so, do you have<br> + some idea how can I implement a basic request-response<br> + mechanism? Probably one of you guys in this forum have some<br> + idea.<br><br> + <br><br> + </div><br> + <div>Btw, the links I read about this topic:<br><br> + <a href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol" target="_blank">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br><br> + <a href="http://alabor.me/articles/request-response-oriented-websockets/" target="_blank">http://alabor.me/articles/request-response-oriented-websockets/</a><br><br> + <a href="https://www.npmjs.com/package/primus-responder" target="_blank">https://www.npmjs.com/package/primus-responder</a><br><br> + </div><br> + <div><br><br> + </div><br> + thanks for your help,<br><br> + </div><br> + /Robi<br><br> + </div><br> + <br><br> + <fieldset></fieldset><br> + <br><br> + </div></div><span class=""><pre>_______________________________________________<br> +Extend mailing list<br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br> +</pre><br> + </span></blockquote><br> + <br><br> + </div><br> +<br> +</blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150624/72689ab9/attachment.html b/archives/extend/attachments/20150624/72689ab9/attachment.html new file mode 100644 index 00000000..fb95808d --- /dev/null +++ b/archives/extend/attachments/20150624/72689ab9/attachment.html @@ -0,0 +1,72 @@ +<tt> +<div dir="ltr"><div><div><div><div>hello,<br><br></div>I would like to thanks the response to all of you. I will try keep all these in my mind.<br><br></div>@Bas, thanks for your note about <a href="https://github.com/bwegh/erwa" target="_blank">erwa</a>, I will take a look.<br><br></div>thanks again,<br></div>/Robi<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-24 12:28 GMT+02:00 Bas Wegh <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> + <br> + <br> + <br> + <div bgcolor="#FFFFFF" text="#000000"><br> + hello Robi,<br><br> + <br><br> + you might be interested in erwa:<br><br> + <a href="https://github.com/bwegh/erwa" target="_blank">https://github.com/bwegh/erwa</a><br><br> + <br><br> + Cheers,<br><br> + Bas<span class=""><br><br> + <br><br> + <div>On 06/24/2015 11:18 AM, Robert Balogh<br> + wrote:<br><br> + </div><br> + </span><blockquote type="cite"><div><div class="h5"><br> + <div dir="ltr"><br> + <div><br> + <div><br> + <div><br> + <div>hello,<br><br> + <br><br> + </div><br> + According to you grate support I got from you at<br> + yesterday, I could continue my project, where I use Cowboy<br> + webserver and using Websocket. Now I made an own web page<br> + with basic features I need, so the server and client can<br> + communicates to eachother. I like it. <br><br> + <br><br> + Now I would like to step forward, and I would like to<br> + implement a Request-Response mechanism. I read few<br> + articles in to this topic, and all of them has mentioned<br> + this "feature" is not part of the Websocket standard. They<br> + were suggested to use some sub-protocols for this, but I<br> + did not see any written in Erlang.<br><br> + <br><br> + </div><br> + So, I would like to ask you, do I understand right that<br> + Cowboy does not have this feature too? If so, do you have<br> + some idea how can I implement a basic request-response<br> + mechanism? Probably one of you guys in this forum have some<br> + idea.<br><br> + <br><br> + </div><br> + <div>Btw, the links I read about this topic:<br><br> + <a href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol" target="_blank">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br><br> + <a href="http://alabor.me/articles/request-response-oriented-websockets/" target="_blank">http://alabor.me/articles/request-response-oriented-websockets/</a><br><br> + <a href="https://www.npmjs.com/package/primus-responder" target="_blank">https://www.npmjs.com/package/primus-responder</a><br><br> + </div><br> + <div><br><br> + </div><br> + thanks for your help,<br><br> + </div><br> + /Robi<br><br> + </div><br> + <br><br> + <fieldset></fieldset><br> + <br><br> + </div></div><span class=""><pre>_______________________________________________<br> +Extend mailing list<br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br> +<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br> +</pre><br> + </span></blockquote><br> + <br><br> + </div><br> +<br> +</blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150624/b67122b6/attachment-0001.html b/archives/extend/attachments/20150624/b67122b6/attachment-0001.html new file mode 100644 index 00000000..906afb56 --- /dev/null +++ b/archives/extend/attachments/20150624/b67122b6/attachment-0001.html @@ -0,0 +1,77 @@ +<tt> +<html><br> + <head><br> + <meta content="text/html; charset=windows-1252"<br> + http-equiv="Content-Type"><br> + </head><br> + <body bgcolor="#FFFFFF" text="#000000"><br> + hello Robi,<br><br> + <br><br> + you might be interested in erwa:<br><br> + <a class="moz-txt-link-freetext" href="https://github.com/bwegh/erwa">https://github.com/bwegh/erwa</a><br><br> + <br><br> + Cheers,<br><br> + Bas<br><br> + <br><br> + <div class="moz-cite-prefix">On 06/24/2015 11:18 AM, Robert Balogh<br> + wrote:<br><br> + </div><br> + <blockquote<br> +cite="mid:CAA4OwwXkFLY0pO7qudu4Xhe-aD4=wYGoitYx=NtN6dh5GN25CA@mail.gmail.com"<br> + type="cite"><br> + <div dir="ltr"><br> + <div><br> + <div><br> + <div><br> + <div>hello,<br><br> + <br><br> + </div><br> + According to you grate support I got from you at<br> + yesterday, I could continue my project, where I use Cowboy<br> + webserver and using Websocket. Now I made an own web page<br> + with basic features I need, so the server and client can<br> + communicates to eachother. I like it. <br><br> + <br><br> + Now I would like to step forward, and I would like to<br> + implement a Request-Response mechanism. I read few<br> + articles in to this topic, and all of them has mentioned<br> + this "feature" is not part of the Websocket standard. They<br> + were suggested to use some sub-protocols for this, but I<br> + did not see any written in Erlang.<br><br> + <br><br> + </div><br> + So, I would like to ask you, do I understand right that<br> + Cowboy does not have this feature too? If so, do you have<br> + some idea how can I implement a basic request-response<br> + mechanism? Probably one of you guys in this forum have some<br> + idea.<br><br> + <br><br> + </div><br> + <div>Btw, the links I read about this topic:<br><br> + ��� <a moz-do-not-send="true"<br> +href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br><br> + ��� <a moz-do-not-send="true"<br> + href="http://alabor.me/articles/request-response-oriented-websockets/">http://alabor.me/articles/request-response-oriented-websockets/</a><br><br> + ��� <a moz-do-not-send="true"<br> + href="https://www.npmjs.com/package/primus-responder">https://www.npmjs.com/package/primus-responder</a><br><br> + </div><br> + <div><br><br> + </div><br> + thanks for your help,<br><br> + </div><br> + /Robi<br><br> + </div><br> + <br><br> + <fieldset class="mimeAttachmentHeader"></fieldset><br> + <br><br> + <pre wrap="">_______________________________________________<br> +Extend mailing list<br> +<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a><br> +<a class="moz-txt-link-freetext" href="https://lists.ninenines.eu/listinfo/extend">https://lists.ninenines.eu/listinfo/extend</a><br> +</pre><br> + </blockquote><br> + <br><br> + </body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20150624/b67122b6/attachment.html b/archives/extend/attachments/20150624/b67122b6/attachment.html new file mode 100644 index 00000000..906afb56 --- /dev/null +++ b/archives/extend/attachments/20150624/b67122b6/attachment.html @@ -0,0 +1,77 @@ +<tt> +<html><br> + <head><br> + <meta content="text/html; charset=windows-1252"<br> + http-equiv="Content-Type"><br> + </head><br> + <body bgcolor="#FFFFFF" text="#000000"><br> + hello Robi,<br><br> + <br><br> + you might be interested in erwa:<br><br> + <a class="moz-txt-link-freetext" href="https://github.com/bwegh/erwa">https://github.com/bwegh/erwa</a><br><br> + <br><br> + Cheers,<br><br> + Bas<br><br> + <br><br> + <div class="moz-cite-prefix">On 06/24/2015 11:18 AM, Robert Balogh<br> + wrote:<br><br> + </div><br> + <blockquote<br> +cite="mid:CAA4OwwXkFLY0pO7qudu4Xhe-aD4=wYGoitYx=NtN6dh5GN25CA@mail.gmail.com"<br> + type="cite"><br> + <div dir="ltr"><br> + <div><br> + <div><br> + <div><br> + <div>hello,<br><br> + <br><br> + </div><br> + According to you grate support I got from you at<br> + yesterday, I could continue my project, where I use Cowboy<br> + webserver and using Websocket. Now I made an own web page<br> + with basic features I need, so the server and client can<br> + communicates to eachother. I like it. <br><br> + <br><br> + Now I would like to step forward, and I would like to<br> + implement a Request-Response mechanism. I read few<br> + articles in to this topic, and all of them has mentioned<br> + this "feature" is not part of the Websocket standard. They<br> + were suggested to use some sub-protocols for this, but I<br> + did not see any written in Erlang.<br><br> + <br><br> + </div><br> + So, I would like to ask you, do I understand right that<br> + Cowboy does not have this feature too? If so, do you have<br> + some idea how can I implement a basic request-response<br> + mechanism? Probably one of you guys in this forum have some<br> + idea.<br><br> + <br><br> + </div><br> + <div>Btw, the links I read about this topic:<br><br> + ��� <a moz-do-not-send="true"<br> +href="http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol">http://stackoverflow.com/questions/10882370/websocket-request-response-subprotocol</a><br><br> + ��� <a moz-do-not-send="true"<br> + href="http://alabor.me/articles/request-response-oriented-websockets/">http://alabor.me/articles/request-response-oriented-websockets/</a><br><br> + ��� <a moz-do-not-send="true"<br> + href="https://www.npmjs.com/package/primus-responder">https://www.npmjs.com/package/primus-responder</a><br><br> + </div><br> + <div><br><br> + </div><br> + thanks for your help,<br><br> + </div><br> + /Robi<br><br> + </div><br> + <br><br> + <fieldset class="mimeAttachmentHeader"></fieldset><br> + <br><br> + <pre wrap="">_______________________________________________<br> +Extend mailing list<br> +<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a><br> +<a class="moz-txt-link-freetext" href="https://lists.ninenines.eu/listinfo/extend">https://lists.ninenines.eu/listinfo/extend</a><br> +</pre><br> + </blockquote><br> + <br><br> + </body><br> +</html><br> + +</tt> diff --git a/archives/extend/attachments/20150713/eb33ab46/attachment-0001.html b/archives/extend/attachments/20150713/eb33ab46/attachment-0001.html new file mode 100644 index 00000000..4db5e976 --- /dev/null +++ b/archives/extend/attachments/20150713/eb33ab46/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div><div><div><div><div><div>hello,<br><br></div>Sorry that I turned to the list again, but I would like to get some help from you. I have a websocket based application, based on the cowboy/examples/websocket. It is working well. Now I would like to add a basic authentication, and I saw, there is an example how to do this. I checked the cowboy/examples/rest_basic_auth example.<br></div>So I tried "add" the aut. example into my websocket app by doing the following steps:<br></div> - add new module for handle the authentication<br></div> do_basic_auth.erl<br></div> - update cowboy_router:compile function call when star application with {"/", do_basic_auth, []}<br><br></div>Once the compilation done, I can start the app and I get the "basic auth" window in the browser when connecting to localhost:8080, but the "ordinary" index.html does not appears when I set the correct auth data (user/pwd). I am pretty sure that I made something wrong, I do not see what I did wrong, thus I kindly ask you, please try help me.<br><br></div>The project what I am working on can be seen in the github:<br> <a href="https://github.com/ethrbh/websocket_2">https://github.com/ethrbh/websocket_2</a> <br><br></div>thanks fro your help,<br></div>/Robi<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150713/eb33ab46/attachment.html b/archives/extend/attachments/20150713/eb33ab46/attachment.html new file mode 100644 index 00000000..4db5e976 --- /dev/null +++ b/archives/extend/attachments/20150713/eb33ab46/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div><div><div><div><div><div>hello,<br><br></div>Sorry that I turned to the list again, but I would like to get some help from you. I have a websocket based application, based on the cowboy/examples/websocket. It is working well. Now I would like to add a basic authentication, and I saw, there is an example how to do this. I checked the cowboy/examples/rest_basic_auth example.<br></div>So I tried "add" the aut. example into my websocket app by doing the following steps:<br></div> - add new module for handle the authentication<br></div> do_basic_auth.erl<br></div> - update cowboy_router:compile function call when star application with {"/", do_basic_auth, []}<br><br></div>Once the compilation done, I can start the app and I get the "basic auth" window in the browser when connecting to localhost:8080, but the "ordinary" index.html does not appears when I set the correct auth data (user/pwd). I am pretty sure that I made something wrong, I do not see what I did wrong, thus I kindly ask you, please try help me.<br><br></div>The project what I am working on can be seen in the github:<br> <a href="https://github.com/ethrbh/websocket_2">https://github.com/ethrbh/websocket_2</a> <br><br></div>thanks fro your help,<br></div>/Robi<br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150824/7576a7ab/attachment-0001.html b/archives/extend/attachments/20150824/7576a7ab/attachment-0001.html new file mode 100644 index 00000000..69a74d86 --- /dev/null +++ b/archives/extend/attachments/20150824/7576a7ab/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div>Greetings...<br><br></div>I'm finding that I can't start syslog when it is built as a dependency of my <a href="http://erlang.mk">erlang.mk</a> project. For example:<br><br><span style="font-family:monospace,monospace">$ erl -pa _rel/${MY_PROJECT}/lib/*/ebin<br>Erlang/OTP 18 [erts-7.0] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]<br><br>Eshell V7.0 (abort with ^G)<br>1> syslog:start().<br>{error,"could not load driver syslog_drv: \"cannot open shared object file: No such file or directory\""}<br></span><br><br></div>The root of the problem seems to be that <a href="http://erlang.mk">erlang.mk</a> compiled syslog_drv.c as "syslog.so" and syslog expects to load "syslog_drv.so". I have confirmed that renaming the file solves the problem.<br><br></div>What do I do with that?<br><br></div>~BC<br><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150824/7576a7ab/attachment.html b/archives/extend/attachments/20150824/7576a7ab/attachment.html new file mode 100644 index 00000000..69a74d86 --- /dev/null +++ b/archives/extend/attachments/20150824/7576a7ab/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr"><div><div><div><div>Greetings...<br><br></div>I'm finding that I can't start syslog when it is built as a dependency of my <a href="http://erlang.mk">erlang.mk</a> project. For example:<br><br><span style="font-family:monospace,monospace">$ erl -pa _rel/${MY_PROJECT}/lib/*/ebin<br>Erlang/OTP 18 [erts-7.0] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]<br><br>Eshell V7.0 (abort with ^G)<br>1> syslog:start().<br>{error,"could not load driver syslog_drv: \"cannot open shared object file: No such file or directory\""}<br></span><br><br></div>The root of the problem seems to be that <a href="http://erlang.mk">erlang.mk</a> compiled syslog_drv.c as "syslog.so" and syslog expects to load "syslog_drv.so". I have confirmed that renaming the file solves the problem.<br><br></div>What do I do with that?<br><br></div>~BC<br><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150923/fc8e4ef7/attachment-0001.html b/archives/extend/attachments/20150923/fc8e4ef7/attachment-0001.html new file mode 100644 index 00000000..44688fb4 --- /dev/null +++ b/archives/extend/attachments/20150923/fc8e4ef7/attachment-0001.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr">I was fiddling with some js, and got tired of restarting the server. I was under the <div>impression that using dev_mode with relx was the solution to this problem, but </div><div>I can't seem to get it to work. I have an example here:</div><div><br><a href="https://github.com/grahamrhay/cowboy_devmode">https://github.com/grahamrhay/cowboy_devmode</a><br><br><div>If I look in _rel, the lib folder for my app is a symlink, as expected. Yet when I change</div><div>the web page, the rendered page is unchanged. I've tried a hard reload, and clearing</div><div>the cache. </div><div><br></div><div>And, in case that wasn't annoying enough, even restarting the server isn't enough! </div><div>Nor is running make again. In fact, the only way I've found of getting it to update, </div><div>is to turn off dev mode, and build the release.</div></div><div><br></div><div>Am I missing something really obvious? As far as I can tell from perusing the code,</div><div>the cowboy static handler just serves the file directly from the file system.</div><div><br></div><div>(P.S. I am using vagrant, but I would expect that to cause errors rather than this, if </div><div>the symlink wasn't working.)</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20150923/fc8e4ef7/attachment.html b/archives/extend/attachments/20150923/fc8e4ef7/attachment.html new file mode 100644 index 00000000..44688fb4 --- /dev/null +++ b/archives/extend/attachments/20150923/fc8e4ef7/attachment.html @@ -0,0 +1,4 @@ +<tt> +<div dir="ltr">I was fiddling with some js, and got tired of restarting the server. I was under the <div>impression that using dev_mode with relx was the solution to this problem, but </div><div>I can't seem to get it to work. I have an example here:</div><div><br><a href="https://github.com/grahamrhay/cowboy_devmode">https://github.com/grahamrhay/cowboy_devmode</a><br><br><div>If I look in _rel, the lib folder for my app is a symlink, as expected. Yet when I change</div><div>the web page, the rendered page is unchanged. I've tried a hard reload, and clearing</div><div>the cache. </div><div><br></div><div>And, in case that wasn't annoying enough, even restarting the server isn't enough! </div><div>Nor is running make again. In fact, the only way I've found of getting it to update, </div><div>is to turn off dev mode, and build the release.</div></div><div><br></div><div>Am I missing something really obvious? As far as I can tell from perusing the code,</div><div>the cowboy static handler just serves the file directly from the file system.</div><div><br></div><div>(P.S. I am using vagrant, but I would expect that to cause errors rather than this, if </div><div>the symlink wasn't working.)</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20150924/6a9add86/attachment-0001.html b/archives/extend/attachments/20150924/6a9add86/attachment-0001.html new file mode 100644 index 00000000..2d32894c --- /dev/null +++ b/archives/extend/attachments/20150924/6a9add86/attachment-0001.html @@ -0,0 +1,61 @@ +<tt> +<div dir="ltr">Yeah, that's how I expected it to work. I'll see if I can identify how vagrant is causing me problems.<div><br></div><div>Didn't know about "make run", thanks :)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 September 2015 at 15:39, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wait, I'm dumb. These steps also work:<br><br> +<br><br> +Running the release, opening the website and seeing ohai, editing the file with some extra text, reloading, seeing the extra text.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 09/24/2015 04:35 PM, Loïc Hoguin wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Running the release, stopping it, editing the file, running the release<br><br> +again works here. I suspect something related to Vagrant.<br><br> +<br><br> +Also I suggest 'make run' rather than your start.sh.<br><br> +<br><br> +On 09/23/2015 07:45 PM, Graham Hay wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +I was fiddling with some js, and got tired of restarting the server. I<br><br> +was under the<br><br> +impression that using dev_mode with relx was the solution to this<br><br> +problem, but<br><br> +I can't seem to get it to work. I have an example here:<br><br> +<br><br> +<a href="https://github.com/grahamrhay/cowboy_devmode" rel="noreferrer" target="_blank">https://github.com/grahamrhay/cowboy_devmode</a><br><br> +<br><br> +If I look in _rel, the lib folder for my app is a symlink, as expected.<br><br> +Yet when I change<br><br> +the web page, the rendered page is unchanged. I've tried a hard reload,<br><br> +and clearing<br><br> +the cache.<br><br> +<br><br> +And, in case that wasn't annoying enough, even restarting the server<br><br> +isn't enough!<br><br> +Nor is running make again. In fact, the only way I've found of getting<br><br> +it to update,<br><br> +is to turn off dev mode, and build the release.<br><br> +<br><br> +Am I missing something really obvious? As far as I can tell from<br><br> +perusing the code,<br><br> +the cowboy static handler just serves the file directly from the file<br><br> +system.<br><br> +<br><br> +(P.S. I am using vagrant, but I would expect that to cause errors rather<br><br> +than this, if<br><br> +the symlink wasn't working.)<br><br> +<br><br> +<br><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +</blockquote><br> +<br><br> +</blockquote><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150924/6a9add86/attachment.html b/archives/extend/attachments/20150924/6a9add86/attachment.html new file mode 100644 index 00000000..2d32894c --- /dev/null +++ b/archives/extend/attachments/20150924/6a9add86/attachment.html @@ -0,0 +1,61 @@ +<tt> +<div dir="ltr">Yeah, that's how I expected it to work. I'll see if I can identify how vagrant is causing me problems.<div><br></div><div>Didn't know about "make run", thanks :)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 September 2015 at 15:39, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wait, I'm dumb. These steps also work:<br><br> +<br><br> +Running the release, opening the website and seeing ohai, editing the file with some extra text, reloading, seeing the extra text.<div class="HOEnZb"><div class="h5"><br><br> +<br><br> +On 09/24/2015 04:35 PM, Loïc Hoguin wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Running the release, stopping it, editing the file, running the release<br><br> +again works here. I suspect something related to Vagrant.<br><br> +<br><br> +Also I suggest 'make run' rather than your start.sh.<br><br> +<br><br> +On 09/23/2015 07:45 PM, Graham Hay wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +I was fiddling with some js, and got tired of restarting the server. I<br><br> +was under the<br><br> +impression that using dev_mode with relx was the solution to this<br><br> +problem, but<br><br> +I can't seem to get it to work. I have an example here:<br><br> +<br><br> +<a href="https://github.com/grahamrhay/cowboy_devmode" rel="noreferrer" target="_blank">https://github.com/grahamrhay/cowboy_devmode</a><br><br> +<br><br> +If I look in _rel, the lib folder for my app is a symlink, as expected.<br><br> +Yet when I change<br><br> +the web page, the rendered page is unchanged. I've tried a hard reload,<br><br> +and clearing<br><br> +the cache.<br><br> +<br><br> +And, in case that wasn't annoying enough, even restarting the server<br><br> +isn't enough!<br><br> +Nor is running make again. In fact, the only way I've found of getting<br><br> +it to update,<br><br> +is to turn off dev mode, and build the release.<br><br> +<br><br> +Am I missing something really obvious? As far as I can tell from<br><br> +perusing the code,<br><br> +the cowboy static handler just serves the file directly from the file<br><br> +system.<br><br> +<br><br> +(P.S. I am using vagrant, but I would expect that to cause errors rather<br><br> +than this, if<br><br> +the symlink wasn't working.)<br><br> +<br><br> +<br><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +</blockquote><br> +<br><br> +</blockquote><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150930/7f5e7422/attachment-0001.html b/archives/extend/attachments/20150930/7f5e7422/attachment-0001.html new file mode 100644 index 00000000..709f224f --- /dev/null +++ b/archives/extend/attachments/20150930/7f5e7422/attachment-0001.html @@ -0,0 +1,101 @@ +<tt> +<div dir="ltr">Done.<div><br></div><div><a href="https://github.com/ninenines/cowboy/issues/897">https://github.com/ninenines/cowboy/issues/897</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 September 2015 at 18:03, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's not the first time I see this bug. Can you open a ticket on the Cowboy project so it gets documented in some kind of "gotchas" section?<span class=""><br><br> +<br><br> +On 09/30/2015 06:57 PM, Graham Hay wrote:<br><br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br> +<a href="https://www.virtualbox.org/ticket/9069" rel="noreferrer" target="_blank">https://www.virtualbox.org/ticket/9069</a><br><br> +<br><br> +Opened 4 years ago :( Maybe I should give VMware some money.<br><br> +<br><br> +On 24 September 2015 at 15:57, Graham Hay <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><span class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + Yeah, that's how I expected it to work. I'll see if I can identify<br><br> + how vagrant is causing me problems.<br><br> +<br><br> + Didn't know about "make run", thanks :)<br><br> +<br><br> + On 24 September 2015 at 15:39, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><div><div class="h5"><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + Wait, I'm dumb. These steps also work:<br><br> +<br><br> + Running the release, opening the website and seeing ohai,<br><br> + editing the file with some extra text, reloading, seeing the<br><br> + extra text.<br><br> +<br><br> +<br><br> + On 09/24/2015 04:35 PM, Loïc Hoguin wrote:<br><br> +<br><br> + Running the release, stopping it, editing the file, running<br><br> + the release<br><br> + again works here. I suspect something related to Vagrant.<br><br> +<br><br> + Also I suggest 'make run' rather than your start.sh.<br><br> +<br><br> + On 09/23/2015 07:45 PM, Graham Hay wrote:<br><br> +<br><br> + I was fiddling with some js, and got tired of restarting<br><br> + the server. I<br><br> + was under the<br><br> + impression that using dev_mode with relx was the<br><br> + solution to this<br><br> + problem, but<br><br> + I can't seem to get it to work. I have an example here:<br><br> +<br><br> + <a href="https://github.com/grahamrhay/cowboy_devmode" rel="noreferrer" target="_blank">https://github.com/grahamrhay/cowboy_devmode</a><br><br> +<br><br> + If I look in _rel, the lib folder for my app is a<br><br> + symlink, as expected.<br><br> + Yet when I change<br><br> + the web page, the rendered page is unchanged. I've tried<br><br> + a hard reload,<br><br> + and clearing<br><br> + the cache.<br><br> +<br><br> + And, in case that wasn't annoying enough, even<br><br> + restarting the server<br><br> + isn't enough!<br><br> + Nor is running make again. In fact, the only way I've<br><br> + found of getting<br><br> + it to update,<br><br> + is to turn off dev mode, and build the release.<br><br> +<br><br> + Am I missing something really obvious? As far as I can<br><br> + tell from<br><br> + perusing the code,<br><br> + the cowboy static handler just serves the file directly<br><br> + from the file<br><br> + system.<br><br> +<br><br> + (P.S. I am using vagrant, but I would expect that to<br><br> + cause errors rather<br><br> + than this, if<br><br> + the symlink wasn't working.)<br><br> +<br><br> +<br><br> + _______________________________________________<br><br> + Extend mailing list<br></div></div><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><span class=""><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> + Author of The Erlanger Playbook,<br><br> + A book about software development using Erlang<br><br> +<br><br> +<br><br> +<br><br> +</span></blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150930/7f5e7422/attachment.html b/archives/extend/attachments/20150930/7f5e7422/attachment.html new file mode 100644 index 00000000..709f224f --- /dev/null +++ b/archives/extend/attachments/20150930/7f5e7422/attachment.html @@ -0,0 +1,101 @@ +<tt> +<div dir="ltr">Done.<div><br></div><div><a href="https://github.com/ninenines/cowboy/issues/897">https://github.com/ninenines/cowboy/issues/897</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 September 2015 at 18:03, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's not the first time I see this bug. Can you open a ticket on the Cowboy project so it gets documented in some kind of "gotchas" section?<span class=""><br><br> +<br><br> +On 09/30/2015 06:57 PM, Graham Hay wrote:<br><br> +</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br> +<a href="https://www.virtualbox.org/ticket/9069" rel="noreferrer" target="_blank">https://www.virtualbox.org/ticket/9069</a><br><br> +<br><br> +Opened 4 years ago :( Maybe I should give VMware some money.<br><br> +<br><br> +On 24 September 2015 at 15:57, Graham Hay <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><span class=""><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + Yeah, that's how I expected it to work. I'll see if I can identify<br><br> + how vagrant is causing me problems.<br><br> +<br><br> + Didn't know about "make run", thanks :)<br><br> +<br><br> + On 24 September 2015 at 15:39, Loïc Hoguin <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></span><div><div class="h5"><br> + <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> + Wait, I'm dumb. These steps also work:<br><br> +<br><br> + Running the release, opening the website and seeing ohai,<br><br> + editing the file with some extra text, reloading, seeing the<br><br> + extra text.<br><br> +<br><br> +<br><br> + On 09/24/2015 04:35 PM, Loïc Hoguin wrote:<br><br> +<br><br> + Running the release, stopping it, editing the file, running<br><br> + the release<br><br> + again works here. I suspect something related to Vagrant.<br><br> +<br><br> + Also I suggest 'make run' rather than your start.sh.<br><br> +<br><br> + On 09/23/2015 07:45 PM, Graham Hay wrote:<br><br> +<br><br> + I was fiddling with some js, and got tired of restarting<br><br> + the server. I<br><br> + was under the<br><br> + impression that using dev_mode with relx was the<br><br> + solution to this<br><br> + problem, but<br><br> + I can't seem to get it to work. I have an example here:<br><br> +<br><br> + <a href="https://github.com/grahamrhay/cowboy_devmode" rel="noreferrer" target="_blank">https://github.com/grahamrhay/cowboy_devmode</a><br><br> +<br><br> + If I look in _rel, the lib folder for my app is a<br><br> + symlink, as expected.<br><br> + Yet when I change<br><br> + the web page, the rendered page is unchanged. I've tried<br><br> + a hard reload,<br><br> + and clearing<br><br> + the cache.<br><br> +<br><br> + And, in case that wasn't annoying enough, even<br><br> + restarting the server<br><br> + isn't enough!<br><br> + Nor is running make again. In fact, the only way I've<br><br> + found of getting<br><br> + it to update,<br><br> + is to turn off dev mode, and build the release.<br><br> +<br><br> + Am I missing something really obvious? As far as I can<br><br> + tell from<br><br> + perusing the code,<br><br> + the cowboy static handler just serves the file directly<br><br> + from the file<br><br> + system.<br><br> +<br><br> + (P.S. I am using vagrant, but I would expect that to<br><br> + cause errors rather<br><br> + than this, if<br><br> + the symlink wasn't working.)<br><br> +<br><br> +<br><br> + _______________________________________________<br><br> + Extend mailing list<br></div></div><br> + <a href="mailto:[email protected]" target="_blank">[email protected]</a> <mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>><span class=""><br><br> + <a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +<br><br> +<br><br> + --<br><br> + Loïc Hoguin<br><br> + <a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> + Author of The Erlanger Playbook,<br><br> + A book about software development using Erlang<br><br> +<br><br> +<br><br> +<br><br> +</span></blockquote><div class="HOEnZb"><div class="h5"><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150930/ee98f926/attachment-0001.html b/archives/extend/attachments/20150930/ee98f926/attachment-0001.html new file mode 100644 index 00000000..b0b9bd2e --- /dev/null +++ b/archives/extend/attachments/20150930/ee98f926/attachment-0001.html @@ -0,0 +1,62 @@ +<tt> +<div dir="ltr"><a href="https://www.virtualbox.org/ticket/9069">https://www.virtualbox.org/ticket/9069</a><br><div><br></div><div>Opened 4 years ago :( Maybe I should give VMware some money.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 September 2015 at 15:57, Graham Hay <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yeah, that's how I expected it to work. I'll see if I can identify how vagrant is causing me problems.<div><br></div><div>Didn't know about "make run", thanks :)</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 24 September 2015 at 15:39, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wait, I'm dumb. These steps also work:<br><br> +<br><br> +Running the release, opening the website and seeing ohai, editing the file with some extra text, reloading, seeing the extra text.<div><div><br><br> +<br><br> +On 09/24/2015 04:35 PM, Loïc Hoguin wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Running the release, stopping it, editing the file, running the release<br><br> +again works here. I suspect something related to Vagrant.<br><br> +<br><br> +Also I suggest 'make run' rather than your start.sh.<br><br> +<br><br> +On 09/23/2015 07:45 PM, Graham Hay wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +I was fiddling with some js, and got tired of restarting the server. I<br><br> +was under the<br><br> +impression that using dev_mode with relx was the solution to this<br><br> +problem, but<br><br> +I can't seem to get it to work. I have an example here:<br><br> +<br><br> +<a href="https://github.com/grahamrhay/cowboy_devmode" rel="noreferrer" target="_blank">https://github.com/grahamrhay/cowboy_devmode</a><br><br> +<br><br> +If I look in _rel, the lib folder for my app is a symlink, as expected.<br><br> +Yet when I change<br><br> +the web page, the rendered page is unchanged. I've tried a hard reload,<br><br> +and clearing<br><br> +the cache.<br><br> +<br><br> +And, in case that wasn't annoying enough, even restarting the server<br><br> +isn't enough!<br><br> +Nor is running make again. In fact, the only way I've found of getting<br><br> +it to update,<br><br> +is to turn off dev mode, and build the release.<br><br> +<br><br> +Am I missing something really obvious? As far as I can tell from<br><br> +perusing the code,<br><br> +the cowboy static handler just serves the file directly from the file<br><br> +system.<br><br> +<br><br> +(P.S. I am using vagrant, but I would expect that to cause errors rather<br><br> +than this, if<br><br> +the symlink wasn't working.)<br><br> +<br><br> +<br><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +</blockquote><br> +<br><br> +</blockquote><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> +</div></div></blockquote></div><br></div><br> + +</tt> diff --git a/archives/extend/attachments/20150930/ee98f926/attachment.html b/archives/extend/attachments/20150930/ee98f926/attachment.html new file mode 100644 index 00000000..b0b9bd2e --- /dev/null +++ b/archives/extend/attachments/20150930/ee98f926/attachment.html @@ -0,0 +1,62 @@ +<tt> +<div dir="ltr"><a href="https://www.virtualbox.org/ticket/9069">https://www.virtualbox.org/ticket/9069</a><br><div><br></div><div>Opened 4 years ago :( Maybe I should give VMware some money.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 September 2015 at 15:57, Graham Hay <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yeah, that's how I expected it to work. I'll see if I can identify how vagrant is causing me problems.<div><br></div><div>Didn't know about "make run", thanks :)</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 24 September 2015 at 15:39, Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wait, I'm dumb. These steps also work:<br><br> +<br><br> +Running the release, opening the website and seeing ohai, editing the file with some extra text, reloading, seeing the extra text.<div><div><br><br> +<br><br> +On 09/24/2015 04:35 PM, Loïc Hoguin wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +Running the release, stopping it, editing the file, running the release<br><br> +again works here. I suspect something related to Vagrant.<br><br> +<br><br> +Also I suggest 'make run' rather than your start.sh.<br><br> +<br><br> +On 09/23/2015 07:45 PM, Graham Hay wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> +I was fiddling with some js, and got tired of restarting the server. I<br><br> +was under the<br><br> +impression that using dev_mode with relx was the solution to this<br><br> +problem, but<br><br> +I can't seem to get it to work. I have an example here:<br><br> +<br><br> +<a href="https://github.com/grahamrhay/cowboy_devmode" rel="noreferrer" target="_blank">https://github.com/grahamrhay/cowboy_devmode</a><br><br> +<br><br> +If I look in _rel, the lib folder for my app is a symlink, as expected.<br><br> +Yet when I change<br><br> +the web page, the rendered page is unchanged. I've tried a hard reload,<br><br> +and clearing<br><br> +the cache.<br><br> +<br><br> +And, in case that wasn't annoying enough, even restarting the server<br><br> +isn't enough!<br><br> +Nor is running make again. In fact, the only way I've found of getting<br><br> +it to update,<br><br> +is to turn off dev mode, and build the release.<br><br> +<br><br> +Am I missing something really obvious? As far as I can tell from<br><br> +perusing the code,<br><br> +the cowboy static handler just serves the file directly from the file<br><br> +system.<br><br> +<br><br> +(P.S. I am using vagrant, but I would expect that to cause errors rather<br><br> +than this, if<br><br> +the symlink wasn't working.)<br><br> +<br><br> +<br><br> +_______________________________________________<br><br> +Extend mailing list<br><br> +<a href="mailto:[email protected]" target="_blank">[email protected]</a><br><br> +<a href="https://lists.ninenines.eu/listinfo/extend" rel="noreferrer" target="_blank">https://lists.ninenines.eu/listinfo/extend</a><br><br> +<br><br> +</blockquote><br> +<br><br> +</blockquote><br> +<br><br> +-- <br><br> +Loïc Hoguin<br><br> +<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br><br> +Author of The Erlanger Playbook,<br><br> +A book about software development using Erlang<br><br> +</div></div></blockquote></div><br></div><br> +</div></div></blockquote></div><br></div><br> + +</tt> |