Skip to content

Instantly share code, notes, and snippets.

@azat
Created September 18, 2012 07:58
Show Gist options
  • Select an option

  • Save azat/3741897 to your computer and use it in GitHub Desktop.

Select an option

Save azat/3741897 to your computer and use it in GitHub Desktop.
// url
fwrite(currentThread->task.url, strlen(currentThread->task.url), 1, f);
fwrite("\n", 1, 1, f);
// IP
curl_easy_getinfo(curlPage.pcHandle, CURLINFO_PRIMARY_IP, &buffer);
if (!buffer) {
vFprintf("Thread %i: '%s' malformed IP\n", currentThread->thread.internalId, currentThread->task.url);
} else {
fwrite(buffer, strlen(buffer), 1, f);
fwrite("\n", 1, 1, f);
}
// timestamp (TODO: we don't need this, if we crawl only, because we have mtime)
ull2str(strULL, time(NULL));
fwrite(strULL, strlen(strULL), 1, f);
fwrite("\n\n", 2, 1, f);
fwrite(curlPage.pcContainer, strlen(curlPage.pcContainer), 1, f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment