View Issue Details

IDProjectCategoryView StatusLast Update
0004058libmicrohttpdexternal APIpublic2016-05-02 07:16
Reportersdr Assigned ToChristian Grothoff Due Date
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionwon't fix 
Product Version0.9.46 
Target Version0.9.46Fixed in Version0.9.46 
Summary0004058: MHD_create_response_from_buffer switch from 'char *' to 'const char *'
DescriptionMHD_create_response_from_buffer uses char * argument which makes it harder to use it with string literals which are const char * If the contents of the buffer is not changed in the process of sending the request (it should not!) then it must be simple a change here-and-there to make the compiler happy
Steps To Reproduce#define RESP_NOTF "NOT FOUND!"
...
HD_create_response_from_buffer(sizeof(RESP_NOTF),RESP_NOTF,MHD_RESPMEM_PERSISTENT);
TagsNo tags attached.

Activities

sdr

2015-11-20 08:40

reporter   ~0009929

It turns out it is not trivial to switch to const * as the same buffer is used for file reading. Probably it will be best to provide MHD_create_response_from_const_buffer which will check the response structure and do the cast. This might be important for embeded developers as on some platforms .rodata realy might be RO :)

Christian Grothoff

2015-11-21 10:14

manager   ~0009937

Adding an extra symbol increases linker costs and object size for shared libraries. All we have here, as far as I can see, is that the developer may have to put an explicit cast to eliminate a compiler warning. Or is there more that I'm missing?

Issue History

Date ModifiedUsernameFieldChange
2015-11-17 11:36sdrNew Issue
2015-11-20 08:40sdrNote Added: 0009929
2015-11-21 10:14Christian GrothoffNote Added: 0009937
2015-11-21 10:14Christian GrothoffAssigned To => Christian Grothoff
2015-11-21 10:14Christian GrothoffStatusnew => feedback
2016-05-02 07:16Christian GrothoffStatusfeedback => closed
2016-05-02 07:16Christian GrothoffResolutionopen => won't fix
2016-05-02 07:16Christian GrothoffProduct Version => 0.9.46
2016-05-02 07:16Christian GrothoffFixed in Version => 0.9.46
2016-05-02 07:16Christian GrothoffTarget Version => 0.9.46
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API