Has anyone got this issue with MAX_ENTITY_SIZE? I am fighting with this for quite awhile now. I hope I am just doing something stupid or somebody found a solution for this.
I am using G-WAN 4.2.7 on Ubuntu 64bit latest version.
Here is a test case. Just paste any text on textarea then click submit. If its lesser than 4KB (Or less than 3.2KB) it will work fine. If its greater than 4KB it will return with a 404 not found but it should work since I set the MAX_ENTITY_SIZE to 200KB.
#include "gwan.h" // G-WAN exported functions
#include <string.h>
int main(int argc, char *argv[])
{
xbuf_t *reply = get_reply(argv);
int *entity = (int*)get_env(argv, MAX_ENTITY_SIZE);
char *text = NULL;
get_arg("stext=", &text, argc, argv);
if(text) // Check if text exist.
xbuf_xcat(reply, "Text: %s<br/><br/>%d", text, strlen(text));
static char form[] =
"<form method=\"post\">"
"<textarea name=\"stext\"></textarea><br/>"
"<input name=\"button\" type=\"submit\" value=\"Submit\" />"
"</form><br/>Entity Size: %d";
xbuf_xcat(reply, form, *entity);
return 200;
}
Dont forget to increase the MAX_ENTITY_SIZE limit:
int init(int argc, char *argv[])
{
int *entity = (int*)get_env(argv, MAX_ENTITY_SIZE);
*entity = 200 * 1024;
return 0;
}
UPDATE:
Tested on Ubuntu 10.10 with same issue.