<div dir="ltr"><div>It's not just a reverse-endian'ed size...<br>458453399216374 = 0x'0001'A0F6'0001'A0F6 -- weird duplication...<br></div>(0x1A0F6 = 106742 = 104.2KB, so that part fits.)<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-05-13 1:10 GMT+02:00 Ahmad Baitalmal <span dir="ltr"><<a href="mailto:ahmad@bitbuilder.com" target="_blank">ahmad@bitbuilder.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks Loïc,<div><br></div><div>It now runs and I can connect. I thought I read somewhere that relx automatically started the related apps. I guess it doesn't always.<div><br></div><div>There is something wrong still, I'm getting this error for all files in the browser.</div>

<div><span style="color:rgb(255,0,0);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap">net::ERR_CONTENT_LENGTH_MISMATCH</span><br></div><div><br></div><div>I checked the headers and cowboy is reporting the header "<font color="#3d85c6"><b>Content-Length:</b></font> <font color="#b45f06">458453399216374</font>" for a file that is only 104K.<br>

</div></div><div><br></div><div>Could this be a problem with cowboy running on a little-endian machine (mipsel)?</div><div><br></div><div>Thanks,</div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">
On Sun, May 11, 2014 at 10:32 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You didn't start the cowboy dependencies, I'm not sure how it could have worked on your Mac. Cowboy requires crypto, cowlib and ranch to be started to run. Try application:ensure_all_<u></u>started(cowboy) instead and it'll do that for you.<div>

<div><br>
<br>
On 05/12/2014 02:20 AM, Ahmad Baitalmal wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
Hi,<br>
Im going crazy trying to solve this.<br>
<br>
Works on my Mac, but when I copy to a linux router (OpenWRT, R17, cowboy<br>
0.9.0) it give me the error below.<br>
Is this a cowboy or erlang gen_server issue?<br>
I tried http, same result. So it's not an ssl issue. I can't tell what<br>
the error is...<br>
<br>
<br>
% --------------------- This is my app code that starts cowboy<br>
-module(onion_app).<br>
-behavior(application).<br>
-export([start/2]).<br>
-export([stop/0]).<br>
-export([stop/1]).<br>
-include("common.hrl").<br>
<br>
start(_Type, _Args) -><br>
   application:start(cowboy),<br>
   Dispatch = cowboy_router:compile([<br>
     {'_', [<br>
       {"/",       cowboy_static,   {priv_file, onion ,"index.html"}},<br>
       {"/[...]",  cowboy_static,   {priv_dir, onion , ""}}<br>
     ]}<br>
   ]),<br>
   RootDir = code:root_dir(),<br>
   Port = 443,<br>
   cowboy:start_https(my_https_<u></u>listener, 10,[<br>
       {port, Port},<br>
       {certfile, RootDir ++ "/ssl/onion.crt"},<br>
       {keyfile, RootDir ++ "/ssl/onion.key"}<br>
     ],<br>
     [<br>
       {env, [{dispatch, Dispatch}]}<br>
     ]<br>
   )<br>
   onion_sup:start_link().<br>
stop(_State) -><br>
   ok.<br>
<br>
<br>
% --------------------- I'm getting this error :(<br>
Exec: /mnt/sda1/onion/erts-6.0/bin/<u></u>erlexec -boot<br>
/mnt/sda1/onion/releases/1/<u></u>onion -env ERL_LIBS<br>
/mnt/sda1/onion/releases/1/lib -config<br>
/mnt/sda1/onion/releases/1/<u></u>sys.config -args_file<br>
/mnt/sda1/onion/releases/1/vm.<u></u>args -- console<br>
<br>
=INFO REPORT==== 11-May-2014::03:45:55 ===<br>
     application: onion<br>
     exited: {bad_return,<br>
              {{onion_app,start,[normal,[]]}<u></u>,<br>
               {'EXIT',<br>
                {noproc,<br>
                 {gen_server,call,<br>
                  [ranch_sup,<br>
                   {start_child,<br>
                    {{ranch_listener_sup,my_https_<u></u>listener},<br>
                     {ranch_listener_sup,start_<u></u>link,<br>
                      [my_https_listener,10,ranch_<u></u>ssl,<br>
                       [{port,443},<br>
                        {certfile,"/mnt/sda1/onion/<u></u>ssl/onion.crt"},<br>
                        {keyfile,"/mnt/sda1/onion/ssl/<u></u>onion.key"}],<br>
                       cowboy_protocol,<br>
                       [{env,<br>
                         [{dispatch,<br>
                           [{'_',[],<br>
                             [{[],[],cowboy_static,<br>
                               {priv_file,onion,"index.html"}<u></u>},<br>
                              {[<<"tomato">>,'...'],[],<u></u>tomato,[tomato]},<br>
                              {['...'],<br>
                               [],cowboy_static,<br>
                               {priv_dir,onion,[]}}]}]}]}]]},<br>
                     permanent,5000,supervisor,<br>
                     [ranch_listener_sup]}},<br>
                   infinity]}}}}}<br>
     type: permanent<br>
Eshell V6.0  (abort with ^G)<br>
(onion@ROC)1> {"Kernel pid<br>
terminated",application_<u></u>controller,"{application_<u></u>start_failure,onion,{bad_<u></u>return,{{onion_app,start,[<u></u>normal,[]]},{'EXIT',{noproc,{<u></u>gen_server,call,[ranch_sup,{<u></u>start_child,{{ranch_listener_<u></u>sup,my_https_listener},{ranch_<u></u>listener_sup,start_link,[my_<u></u>https_listener,10,ranch_ssl,[{<u></u>port,443},{certfile,\"/mnt/<u></u>sda1/onion/ssl/onion.crt\"},{<u></u>keyfile,\"/mnt/sda1/onion/ssl/<u></u>onion.key\"}],cowboy_protocol,<u></u>[{env,[{dispatch,[{'_',[],[{[]<u></u>,[],cowboy_static,{priv_file,<u></u>onion,\"index.html\"}},{['...'<u></u>],[],cowboy_static,{priv_dir,<u></u>onion,[]}}]}]}]}]]},permanent,<u></u>5000,supervisor,[ranch_<u></u>listener_sup]}},infinity]}}}}}<u></u>}"}<br>


<br>
<br>
Thanks,<br>
<br>
--<br>
Ahmad<br>
___________<br>
<a href="tel:650.539.9395" value="+16505399395" target="_blank">650.539.9395</a><br>
<br>
Sent from my iPhon<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br>
<br><span><font color="#888888">
</font></span></blockquote><span><font color="#888888">
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div><div dir="ltr"><div>Ahmad</div><div>___________</div><div><a href="tel:650.539.9395" value="+16505399395" target="_blank">650.539.9395</a></div>
<div><br></div>Sent from my iPhone</div>
</div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>