Fix compiler errors
This commit is contained in:
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <chttp.h>
|
||||
|
||||
// This is an example of how to use cHTTP to perform
|
||||
@@ -46,7 +47,7 @@ int main(void)
|
||||
);
|
||||
}
|
||||
|
||||
printf("body: %.*s\n", res->body.len, res->body.ptr);
|
||||
printf("body: %.*s\n", HTTP_UNPACK(res->body));
|
||||
|
||||
// When we are done reading from the response object
|
||||
// we must free the request's resources.
|
||||
|
||||
Binary file not shown.
@@ -1,8 +1,7 @@
|
||||
#include <http.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../http.h"
|
||||
#include <chttp.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc < 2) {
|
||||
|
||||
Binary file not shown.
@@ -2,9 +2,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <http.h>
|
||||
|
||||
#define COUNT(X) (sizeof(X) / sizeof((X)[0]))
|
||||
#include <chttp.h>
|
||||
|
||||
#define BLK "\e[0;30m"
|
||||
#define RED "\e[0;31m"
|
||||
@@ -149,7 +147,7 @@ int main(int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
http_request_line(req, HTTP_METHOD_GET, start_url);
|
||||
http_request_header(req, "User-Agent: Simple crawler", -1);
|
||||
http_request_header(req, HTTP_STR("User-Agent: Simple crawler"));
|
||||
http_request_submit(req);
|
||||
|
||||
for (;;) {
|
||||
@@ -188,7 +186,7 @@ int main(int argc, char **argv)
|
||||
continue;
|
||||
|
||||
http_request_line(req, HTTP_METHOD_GET, url);
|
||||
http_request_header(req, "User-Agent: Simple crawler", -1);
|
||||
http_request_header(req, HTTP_STR("User-Agent: Simple crawler"));
|
||||
http_request_submit(req);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user