Lines Matching +full:trace +full:- +full:buffer +full:- +full:extension

10 #include "../util-internal.h"
48 #include <event2/buffer.h>
84 const char *extension; member
112 /* Try to guess a good content-type for 'path' */
116 const char *last_period, *extension; in guess_content_type() local
121 extension = last_period + 1; in guess_content_type()
122 for (ent = &content_type_table[0]; ent->extension; ++ent) { in guess_content_type()
123 if (!evutil_ascii_strcasecmp(ent->extension, extension)) in guess_content_type()
124 return ent->content_type; in guess_content_type()
131 /* Callback used for the /dump URI, and for every non-GET request:
148 case EVHTTP_REQ_TRACE: cmdtype = "TRACE"; break; in dump_request_cb()
158 for (header = headers->tqh_first; header; in dump_request_cb()
159 header = header->next.tqe_next) { in dump_request_cb()
160 printf(" %s: %s\n", header->key, header->value); in dump_request_cb()
192 int fd = -1; in send_document_cb()
225 len = strlen(decoded_path)+strlen(o->docroot)+2; in send_document_cb()
230 evutil_snprintf(whole_path, len, "%s/%s", o->docroot, decoded_path); in send_document_cb()
253 if (!strlen(path) || path[strlen(path)-1] != '/') in send_document_cb()
275 " <meta charset='utf-8'>\n" in send_document_cb()
282 decoded_path, /* XXX html-escape this. */ in send_document_cb()
283 path, /* XXX html-escape this? */ in send_document_cb()
285 decoded_path /* XXX html-escape this */); in send_document_cb()
291 const char *name = ent->d_name; in send_document_cb()
308 "Content-Type", "text/html"); in send_document_cb()
310 /* Otherwise it's a file; add it to the buffer to get in send_document_cb()
325 "Content-Type", type); in send_document_cb()
351 " -p - port\n" in print_usage()
352 " -U - bind to unix socket\n" in print_usage()
353 " -u - unlink unix socket before bind\n" in print_usage()
354 " -I - IOCP\n" in print_usage()
355 " -v - verbosity, enables libevent debug logging too\n", prog); in print_usage()
366 while ((opt = getopt(argc, argv, "hp:U:uIv")) != -1) { in parse_opts()
378 if (optind >= argc || (argc - optind) > 1) { in parse_opts()
403 int got_port = -1; in display_listen_sock()
413 got_port = ntohs(((struct sockaddr_in*)&ss)->sin_port); in display_listen_sock()
414 inaddr = &((struct sockaddr_in*)&ss)->sin_addr; in display_listen_sock()
416 got_port = ntohs(((struct sockaddr_in6*)&ss)->sin6_port); in display_listen_sock()
417 inaddr = &((struct sockaddr_in6*)&ss)->sin6_addr; in display_listen_sock()
421 printf("Listening on <%s>\n", ((struct sockaddr_un*)&ss)->sun_path); in display_listen_sock()
525 LEV_OPT_CLOSE_ON_FREE, -1, in main()
540 fprintf(stderr, "-U is not supported on this platform. Exiting.\n"); in main()