On 05/22/2012 10:45 PM, [email protected] 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