<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"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-2"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.StylE-mailovZprvy17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=CS link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal>I discovered a bug in EmbeddedPerlImageResize module code at the website <a href="http://wiki.nginx.org/EmbeddedPerlImageResize">http://wiki.nginx.org/EmbeddedPerlImageResize</a>.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>If I send an image file to user only by statement<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>    $r-&gt;sendfile($dest_file);<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>and look to incoming HTTP header, there are Unknown Content-Type and Content-Length fields. So browser (or wget) download this file immediatelly, but<o:p></o:p></p><p class=MsoNormal>then wait for about 12-14 seconds.. If I set request Content-Type and Content-Length fields, it works okay.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Example:<o:p></o:p></p><p class=MsoNormal>    my $filesize = -s $ dest_file;<o:p></o:p></p><p class=MsoNormal>    $request-&gt;header_out(&quot;Content-Length&quot;, $filesize);<o:p></o:p></p><p class=MsoNormal>    $request-&gt;send_http_header(&quot;image/jpeg&quot;);<o:p></o:p></p><p class=MsoNormal>    $request-&gt;sendfile($dest_file);<o:p></o:p></p><p class=MsoNormal>    $request-&gt;rflush;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Sir.Jackal<o:p></o:p></p></div></body></html>