libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Bug in largepost.c example


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Bug in largepost.c example
Date: Fri, 11 Dec 2015 23:32:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.4.0

Hi Anton,

I've "fixed" this in SVN 36758, even though I think this is the last
thing to be concerned about (as others have explained, this really does
not matter).

Looking over the example, it is clear that it could use quite a bit of
work (starting with adding comments...) to make it nicer.  I've started
a bit by introducing an "enum" for GET/POST and properly using MHD
#defines for "GET" and "POST" strings (and using strcasecmp instead of
strcmp).

So regardless, please treat all of these examples as starting points
that try to highlight at a very high level how to do something specific,
and not as overall beautiful code. There is more work there to be
done... ;-).

Happy hacking!

Christian

On 12/11/2015 08:51 AM, Anton Botvalde wrote:
> Hello,
> 
> In the largepost.c example the iterate_post callback has a bug in fwrite -
>   if (size > 0)
>     {
>       if (!fwrite (data, size, sizeof (char), con_info->fp))
>         return MHD_NO;
>     }
> 
> should be
> 
>   if (size > 0)
>     {
>       if (!fwrite (data, sizeof (char), size , con_info->fp))
>         return MHD_NO;
>     }
> 
> Kind regards,
> Anton Botvalde
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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