continue;
strcpy(pathptr, idx->name);
- if (!stat(path_phys, &s) && (s.st_mode & S_IFREG))
+ if (!stat(path_phys, &s) && (s.st_mode & S_IFREG)) {
+ memcpy(&p.stat, &s, sizeof(p.stat));
break;
+ }
*pathptr = 0;
}
return p.phys ? &p : NULL;
}
-#ifdef __APPLE__
-time_t timegm (struct tm *tm);
-#endif
-
static const char * uh_file_mime_lookup(const char *path)
{
struct mimetype *m = &uh_mime_types[0];
void uh_handle_request(struct client *cl)
{
struct dispatch_handler *d;
- const char *url = cl->request.url;
+ const char *url = blobmsg_data(blob_data(cl->hdr.head));;
d = dispatch_find(url, NULL);
if (d) {
__handle_file_request(cl, conf.error_handler))
return;
- uh_client_error(cl, 404, "Not Found", "The requested URL %s was not found on this server.", cl->request.url);
+ uh_client_error(cl, 404, "Not Found", "The requested URL %s was not found on this server.", url);
}