libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] MHD_lookup_connection_value returns boundary


From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD_lookup_connection_value returns boundary
Date: Wed, 23 May 2012 23:12:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 05/22/2012 10:45 PM, address@hidden wrote:
Hello,

Im using libmhd from a not so old svn version. When I do the
following:
                        
if(0 == strcmp(method, MHD_HTTP_METHOD_POST)){
   const char* content_t = MHD_lookup_connection_value(c,
     MHD_HEADER_KIND, "Content-Type");
   fprintf(stderr, "'%s'\n", content_t);
...

I get:
'multipart/form-data;
boundary=---------------------------3503486491459979781761840034'

 From my understanding, the MHD_lookup_connection_value should only
return a 'multipart/form-data' null terminated. If that is true, what
is going wrong?


Probably nothing. HTTP sends the boundary for the content as part of the header. Look at postprocessor.c:

     (0 == strncasecmp (pp->content_type,
                                 "multipart/mixed",
                                 strlen ("multipart/mixed"))))


As you can see, we specifically use strncasecmp, not strcasecmp.

Happy hacking,

Christian



reply via email to

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