When using the code below, the handler will not recognize non file requests (e.g. the request has to contain a file in the www folder). With all other requests main isn't even called, and I have no idea why this is.
int init(int argc, char *argv[])
{
printf("init\n");
*(u32 *)get_env(argv, US_HANDLER_STATES) = (1L << HDL_AFTER_ACCEPT) | (1L << HDL_AFTER_READ) | (1L << HDL_BEFORE_WRITE);
return 0;
}
void clean(int argc, char *argv[])
{
printf("clean\n");
}
int main(int argc, char *argv[])
{
printf("%s\n", (char *)get_env(argv, REQUEST));
return 255;
}
Request: 127.0.0.1/index.html
Prints: GET /index.html
Request: 127.0.0.1/favicon.ico
Prints: GET /favicon.ico
Request: 127.0.0.1/index
Prints: N/A
Thanks for any assistance.