* Returns 1 if we should disconnect
*
*/
-static void
+static int
http_exec(http_connection_t *hc, http_path_t *hp, char *remain)
{
int err;
else
err = hp->hp_callback(hc, remain, hp->hp_opaque);
+ if(err == -1)
+ return 1;
+
if(err)
http_error(hc, err);
+ return 0;
}
if(args != NULL)
http_parse_get_args(hc, args);
- http_exec(hc, hp, remain);
- return 0;
+ return http_exec(hc, hp, remain);
}
http_error(hc, HTTP_STATUS_NOT_FOUND);
return 0;
}
- http_exec(hc, hp, remain);
- return 0;
+ return http_exec(hc, hp, remain);
}
const struct filebundle *fb = opaque;
const struct filebundle_entry *fbe;
const char *content = NULL, *postfix;
- int n;
if(remain == NULL)
return 404;
fbe->original_size == -1 ? NULL : "gzip", NULL, 10, 0,
NULL);
/* ignore return value */
- n = write(hc->hc_fd, fbe->data, fbe->size);
+ if(write(hc->hc_fd, fbe->data, fbe->size) != fbe->size)
+ return -1;
return 0;
}
}