libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Advise about upgrade "facility"


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Advise about upgrade "facility"
Date: Fri, 16 Mar 2018 21:56:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/16/2018 03:40 PM, José Bollo wrote:
> Hi all,
> 
> I searched last two days a "double free" bug that appeared using latest
> master for my implementation of websockets using MHD upgrade "facility".
> 
> After bisecting, it appears that the commit 
> 
>>> commit 0ebdff94d461abd4328cf45a6281c15139a045eb
>>> Author: Christian Grothoff <address@hidden>
>>> Date:   Fri Mar 2 21:45:17 2018 +0100
>>>
>>>     fix test_upgrade transient failures (#5189)
> 
> introduces the change.
> 
> Before it, I had to free manually the resource attached to the
> connection. After it, freeing it in the MHD_OPTION_NOTIFY_COMPLETED
> callback "as usual" works (didn't work before). This lead in my code to
> a dual free of resources.

Yep, that's why it was a bug ;-).

> For me using the callback of MHD_OPTION_NOTIFY_COMPLETED in all cases
> (after upgrade or not) is produce the lightest code.
> 
> 2 questions:
> 
>  - is it possible to increase the version to 0x00095901 for testing the
>    case and adapt my code?
> 
> #define MHD_VERSION   0x00095901

Eh, the MHD_VERSION is already on 0x00095902, and yes, it should be safe
to teset for that increase.

>  - in my case, the resource is not used and was released in the upgrade
>    callback. Is there a way to force the con_cls of a connection? If
>    yes I can release the resources earlier.

This is not possible with the current API.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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