libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] [PATCH]: try_grow_read_buffer() failed


From: Evgeny Grin
Subject: Re: [libmicrohttpd] [PATCH]: try_grow_read_buffer() failed
Date: Fri, 17 Mar 2017 09:55:57 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 17.03.2017 4:31, Vitaliy T wrote:
> The question is not closed.
> 
> Applied to recent commits from
> a10c64c79337431924830db9e82f6c1c70994942 and early ones.
> 
> I have started deeper investigation of the problem. It leads to the
> MHD_pool_reallocate() function from src/microhttpd/memorypool.c
> 
> I have found that the next check is interpreted by MHD differently,
> depended on who or what is calling the function:
> 
>       273   if ((pool->pos + asize >= pool->pos) &&
>       274       (pool->pos + asize <= pool->end))
>       275     {
> 
> 1. Sometimes the same check is ignored by MHD.
> 2. And if MHD_pool_reallocate() was called by try_grow_read_buffer()
> the INTERNAL_ERROR will be send.
> 
> For example, I got next values:
>   pool: 0x0x8001dd50
>   pool->pos: 66565
>   asize: 67376
>   pool->end: 130976
> 
> First time this "error" was ingored, and later the same pool address
> became "bad".
> 
> Can't say which function is exactly ignores that MHD_pool_reallocate()
> was "failed". All I know that it is not fatal for the server. Am I
> right? :)

No, it's not correct.
It's not fatal as long as buffer for incoming data still have some space
(even if failed to grow) or MHD do not need to read data from remote any
more.
It's fatal if MHD need to read remote data and no space left in buffer.
Pretty simple.


> So, either we need to fix MHD_pool_reallocate(), either to fix
> try_grow_read_buffer() or even fix the problem differently.
> 

Will answer to your next email.

-- 
Best Wishes,
Evgeny Grin



reply via email to

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