Simplify print statements by using HTTP_UNPACK
This commit is contained in:
@@ -43,7 +43,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
printf("Status: %d\n", result->status);
|
||||
printf("Body: %.*s\n", (int)result->body.len, result->body.ptr);
|
||||
printf("Body: %.*s\n", HTTP_UNPACK(result->body));
|
||||
|
||||
http_request_free(reqs[i-1]);
|
||||
}
|
||||
|
||||
@@ -173,11 +173,11 @@ int main(int argc, char **argv)
|
||||
if (url.len == 0) break;
|
||||
|
||||
if (is_already_crawled(url)) {
|
||||
printf("Ignoring " RED "%.*s" RST "\n", (int) url.len, url.ptr);
|
||||
printf("Ignoring " RED "%.*s" RST "\n", HTTP_UNPACK(url));
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("Fetching " GRN "%.*s" RST "\n", (int) url.len, url.ptr);
|
||||
printf("Fetching " GRN "%.*s" RST "\n", HTTP_UNPACK(url));
|
||||
add_to_crawled_list(url);
|
||||
|
||||
HTTP_RequestHandle req;
|
||||
|
||||
Reference in New Issue
Block a user