<div dir="ltr">Björn,<div>What kind of arch are you running on?</div><div><br></div><div>I'm running on a Ralink RT3052 (MIPS 24KEc V4.12). </div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 13, 2014 at 5:36 PM, Björn-Egil Dahlberg <span dir="ltr"><<a href="mailto:wallentin.dahlberg@gmail.com" target="_blank">wallentin.dahlberg@gmail.com</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">Oh no .. trouble in paradise.<div><br></div><div>I see the same duplication problem here (nice catch Erik),</div>
<div><div><br></div><div>1> <<I1:32,I2:32>> = <<15990163246731:64>>, {I1,I2}.</div>
<div>{3723,3723}</div></div><div><br></div><div>Which leads me to think there is a problem in int efile_fileinfo(...) with the highs and lows.</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-05-14 0:02 GMT+02:00 Ahmad Baitalmal <span dir="ltr"><<a href="mailto:ahmad@bitbuilder.com" target="_blank">ahmad@bitbuilder.com</a>></span>:<div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Thanks Erik,<div><br></div><div>I did a bit more digging, The call for file:read_file_info in cowboy_static.erl is returning this:<div><br><div><font face="Monaco" style="font-size:14px">{ok,{file_info,<font color="#b51a00">15990163246731</font>,regular,read_write,<br>
{{2014,5,13},{20,51,46}},<br> {{2014,5,9},{19,57,47}},<br> {{2014,5,13},{19,46,18}},<br> 33188,1,2049,0,1704124,0,0}}</font></div><div><br></div><div>The file is only <font color="#b51a00">3723</font> bytes. I verified this also on an erl shell. Same result. </div>
<div><br></div><div>So it looks like something is up in kernel-3.0/file.erl when running on a mipsel chip.</div><div><br></div><div>Everything else is working, except for this file size issue. Oh and the body is empty. </div>
<div><br></div><div>For now, I plan on using an onresponse hook to load up the file and fix the content-length as it goes out. :( Not ideal...</div><div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:'Helvetica Neue';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="font-family:Calibri,sans-serif;margin:0in 0in 0.0001pt;font-size:11pt"><font color="#4dacff">_</font>_<font color="#4dacff">_</font>_<font color="#4dacff">_</font>_<font color="#4dacff">_</font>_<font color="#4dacff">_</font>_<font color="#4dacff">_</font>_<font color="#4dacff" style="text-align:-webkit-auto">_</font><span style="text-align:-webkit-auto">_</span></div>
<span><font color="#888888"><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;margin:0in 0in 0.0001pt;font-size:17px"><b><span style="font-size:15px"><font color="#223269">Ahmad Baitalmal</font></span></b></div>
<div style="font-family:Calibri,sans-serif;margin:0in 0in 0.0001pt;font-size:11pt"><b><span style="font-size:10pt"><font color="#2e84e6">CEO & Co-Founder</font></span></b></div><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;margin:0in 0in 0.0001pt;font-size:11pt">
<b><span style="font-size:10pt"><font color="#223269"><a href="http://BitBuilder.com" target="_blank">BitBuilder.com</a></font></span></b></div><div style="font-family:Calibri,sans-serif;margin:0in 0in 0.0001pt;font-size:11pt">
<span style="font-size:13px"><font color="#9ca7cb"><a href="tel:650.539.9401" value="+16505399401" target="_blank">650.539.9401</a></font></span></div></font></span></div></div></div></div>
</div><div><div>
<br><div><div>On May 13, 2014, at 1:13 AM, Erik Søe Sørensen <<a href="mailto:eriksoe@gmail.com" target="_blank">eriksoe@gmail.com</a>> wrote:</div><br><blockquote type="cite"><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><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>
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>
______________________________<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" target="_blank">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>
</blockquote></div><br></div></div></div></div></div></div><br>_______________________________________________<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/listinfo/erlang-questions</a><br>
<br></blockquote></div></div></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Ahmad</div><div>___________</div><div>650.539.9395</div><div><br></div>Sent from my iPhone</div>
</div>