View Issue Details

IDProjectCategoryView StatusLast Update
0010333libmicrohttpddocumentationpublic2025-09-07 01:10
Reporterxtforever Assigned ToChristian Grothoff  
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.0.0 
Fixed in VersionGit master 
Summary0010333: example/simplepost.c not working
Descriptioniterate_post should return MHD_YES
Steps To Reproducerun examples/samplepost

TagsNo tags attached.

Activities

xtforever

2025-09-02 21:58

reporter   ~0025790

Working version:

static enum MHD_Result
iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key,
              const char *filename, const char *content_type,
              const char *transfer_encoding, const char *data, uint64_t off,
              size_t size)
{
  struct connection_info_struct *con_info = coninfo_cls;
  (void) kind; /* Unused. Silent compiler warning. */
  (void) filename; /* Unused. Silent compiler warning. */
  (void) content_type; /* Unused. Silent compiler warning. */
  (void) transfer_encoding; /* Unused. Silent compiler warning. */
  (void) off; /* Unused. Silent compiler warning. */

  if ( strcmp (key, "name") ) return MHD_YES;
  if( size < 0) return MHD_NO;
  if( size > MAXNAMESIZE ) return MHD_NO;
  asprintf (&con_info->answerstring, GREETINGPAGE, data);
  return MHD_YES;
}

Christian Grothoff

2025-09-07 01:10

manager   ~0025849

Yeah, bad example. I've cleaned it up a bit more in 0db39f45..1fd9b377. Still not perfect, but should now at least work... (I'm not using asprintf as that's less portable, btw.).

Issue History

Date Modified Username Field Change
2025-09-02 21:57 xtforever New Issue
2025-09-02 21:58 xtforever Note Added: 0025790
2025-09-07 01:10 Christian Grothoff Note Added: 0025849
2025-09-07 01:10 Christian Grothoff Assigned To => Christian Grothoff
2025-09-07 01:10 Christian Grothoff Status new => resolved
2025-09-07 01:10 Christian Grothoff Resolution open => fixed
2025-09-07 01:10 Christian Grothoff Fixed in Version => Git master