1
0
mirror of https://github.com/wg/wrk synced 2025-02-09 11:32:52 +08:00

set default request path to /

This commit is contained in:
Will 2013-02-16 11:38:37 +09:00
parent 54a623bd25
commit c00e9470e0
2 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
obj/*
wrk

View File

@ -83,7 +83,11 @@ int main(int argc, char **argv) {
char *host = extract_url_part(url, &parser_url, UF_HOST);
char *port = extract_url_part(url, &parser_url, UF_PORT);
char *service = port ? port : extract_url_part(url, &parser_url, UF_SCHEMA);
char *path = &url[parser_url.field_data[UF_PATH].off];
char *path = "/";
if (parser_url.field_set & (1 << UF_PATH)) {
path = &url[parser_url.field_data[UF_PATH].off];
}
struct addrinfo hints = {
.ai_family = AF_UNSPEC,
@ -134,7 +138,7 @@ int main(int argc, char **argv) {
if (pthread_create(&t->thread, NULL, &thread_main, t)) {
char *msg = strerror(errno);
fprintf(stderr, "unable to create thread %zu %s\n", i, msg);
fprintf(stderr, "unable to create thread %"PRIu64" %s\n", i, msg);
exit(2);
}
}