예제 #1
0
tofu_rep_t *handler(tofu_req_t *req, void *argp) {
	tofu_rep_t *rep = tofu_rep_init();

	tofu_status(rep, 418);

	return rep;
}
예제 #2
0
파일: status.c 프로젝트: jackey/Tofu
tofu_rep_t *status_simple(tofu_req_t *req, void *argp) {
	tofu_rep_t *rep = tofu_rep_init();

	tofu_status(rep, 418);

	return rep;
}
예제 #3
0
tofu_rep_t *error_418(tofu_req_t *req) {
	tofu_rep_t *rep = tofu_rep_init();

	tofu_status(rep, 418);
	tofu_head(rep, "Content-Type", "text/html");
	tofu_write(rep, "<!DOCTYPE html>\n<head><title>I'm a teapot</title></head><body><h1>418 - Sorry, I'm just a teapot!</h1></body>\n");

	return rep;
}
예제 #4
0
tofu_rep_t *handler_root(tofu_req_t *req) {
	tofu_rep_t *rep = tofu_rep_init();

	tofu_head(rep, "Content-Type", "text/html");

	/* some random error occurred here */

	tofu_status(rep, 500);

	return rep;
}