Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <curl/curl.h>
- int main(int argc, char* argv[])
- {
- int i = 0;
- CURL *hnd = NULL;
- FILE *header;
- FILE *body;
- if(argc < 2)
- {
- printf("Wat?\n");
- return 1;
- }
- curl_global_init(CURL_GLOBAL_ALL);
- hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_INTERFACE, "lo");
- while(1)
- {
- printf("Round %d\n", ++i);
- curl_easy_setopt(hnd, CURLOPT_URL, argv[1]);
- header = fopen("/dev/null", "w+");
- body = fopen("/dev/null", "w+");
- curl_easy_setopt(hnd, CURLOPT_WRITEHEADER, header);
- curl_easy_setopt(hnd, CURLOPT_WRITEDATA, body);
- curl_easy_perform(hnd);
- fclose(header);
- fclose(body);
- if(i == 10)
- {
- curl_easy_cleanup(hnd);
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement