

/*Test for unsetting WRITEFUNCTION*/
#include <curl/curl.h>
#include <stdio.h>

size_t cb (char* buffer, size_t size, size_t nitems, void* nothing) {
	printf ("Downloading..\n");
	return nitems*size;
}


int main()
{
	CURL* handle;
	FILE * f;
	f = fopen ("test.txt","w");
	handle = curl_easy_init ();
	curl_easy_setopt (handle, CURLOPT_URL, "http://www.apache.org");
	curl_easy_perform (handle);
	curl_easy_setopt (handle,CURLOPT_WRITEFUNCTION, cb);
	curl_easy_perform (handle);
	curl_easy_setopt (handle, CURLOPT_WRITEDATA, f);
	curl_easy_setopt (handle, CURLOPT_WRITEFUNCTION, NULL);
	curl_easy_perform (handle);
	return 0;
}

