View Issue Details

IDProjectCategoryView StatusLast Update
0004058libmicrohttpdexternal APIpublic2016-05-02 09:16
Reportersdr Assigned ToChristian Grothoff  
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 09: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 11: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 Modified Username Field Change
2015-11-17 12:36 sdr New Issue
2015-11-20 09:40 sdr Note Added: 0009929
2015-11-21 11:14 Christian Grothoff Note Added: 0009937
2015-11-21 11:14 Christian Grothoff Assigned To => Christian Grothoff
2015-11-21 11:14 Christian Grothoff Status new => feedback
2016-05-02 09:16 Christian Grothoff Status feedback => closed
2016-05-02 09:16 Christian Grothoff Resolution open => won't fix
2016-05-02 09:16 Christian Grothoff Product Version => 0.9.46
2016-05-02 09:16 Christian Grothoff Fixed in Version => 0.9.46
2016-05-02 09:16 Christian Grothoff Target Version => 0.9.46
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API