Bug 214854 - www/mini_httpd: Truncates file transfers to 1MB size
Summary: www/mini_httpd: Truncates file transfers to 1MB size
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
Keywords: needs-qa
Depends on: 214859
  Show dependency treegraph
Reported: 2016-11-26 16:22 UTC by Patrick Giblett
Modified: 2016-12-05 07:35 UTC (History)
3 users (show)

See Also:
vlad-fbsd: maintainer-feedback? (leres)
vlad-fbsd: merge-quarterly?


Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Giblett 2016-11-26 16:22:54 UTC
Any file down loaded from a site served by this httpd server is tuncated to a maximum length of 1 MB.

Ihave seen this on FBSB 10.3 I386 with mini_httpd 1.21 and
                on FBSB 10.3 AMD64 with mini_httpd 1.25

Modifing the soucre and changing the MAX_SEND_BUFFER_SIZE constant changes the size the truncation occurs at.
Comment 1 Jef Poskanzer 2016-11-26 17:37:12 UTC
Cannot reproduce.

% http_get https://acme.com/jef/tmp/a.txt > b.txt
% ls -l a.txt b.txt
-rw-r--r--  1 jef  acme  21233664 Nov 26 09:31 a.txt
-rw-r--r--  1 jef  www   21233664 Nov 26 09:32 b.txt
% cmp a.txt b.txt
Comment 2 Craig Leres freebsd_committer 2016-11-26 17:55:38 UTC
I'm also unable to reproduce on a 9.3 system running mini_httpd-1.25.
Comment 3 Patrick Giblett 2016-11-26 18:02:19 UTC
I was using fetch http://localhost/filepath.......... 

I did not use https
Comment 4 Jef Poskanzer 2016-11-26 18:36:38 UTC
Testing with http instead of https I do see the truncation as described! Thanks, I'll look into this.
Comment 5 Jef Poskanzer 2016-11-26 19:12:25 UTC
Ok, bug found and fixed. TL;DR I was an idiot calling sendfile. The bug didn't appear when using https because that uses write, not sendfile. And the bug only appeared under FreeBSD because Linux's sendfile is completely different.

New tarchive available at the mini_httpd web page: http://acme.com/software/mini_httpd/

Thanks again for the report.
Comment 6 Craig Leres freebsd_committer 2016-11-26 21:48:35 UTC
PR 214859 resolves this issue.
Comment 7 Emanuel Haupt freebsd_committer 2016-12-05 07:35:35 UTC
Resolved by #214859.