libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] libmicrohttpd running into indefinite loops


From: Evgeny Grin
Subject: Re: [libmicrohttpd] libmicrohttpd running into indefinite loops
Date: Sun, 22 Jan 2017 16:17:05 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

Hi Alexander,

On 19.01.2017 19:02, Alexander Couzens wrote:
>> Looks like you are sending 4GiB-1 file on 32bit OS and sendfile failed
>> as mmap operations are not supported on such file.
>> Fallback to ordinal read()/send() should be fixed in
>> b3f1a958ce613f304234ecb6506976db26c117dc.
>> Could you retry with latest git version?
> Sorry, I couldn't do that, because I'vn't found a way to reproduce
> it in the same environment, but I found some part of the problem.
> 
> nodogsplash is giving a fd of a directory to libmicrohttpd and lseek()
> was used to define the size of the file without checking the return
> value resulting in the size = 4GiB-1.

FD of directory to create a response? It is not allowed, only file FD
can be used for response.
Anyway, MHD doesn't use lseek() to determine file size and all lseek()
results are checked against errors. Did you mean that lseek() is used
somewhere else without checking result?

> But anyway, mmap on a directory doesn't look like a good idea.
> 
> On my working machine a simple test is not going into a indef loop.
> Passing a directory resulting in a direct close of the connection (no
> headers, no data).

Correct. If callback is unable to provide any data - MHD close
connection directly.
In case of response with file FD - callback is file reader.

-- 
Best Wishes,
Evgeny Grin

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]