<commit_before>#include <curl/curl.h>
#include <string.h>

int main(int argc, char **argv) {
	CURL *handle = NULL;
	int rval = -1;
	FILE *file = NULL;

    if(argc == 2 && strcmp(argv[1], "-classad") == 0) {
		printf("%s",
			"PluginVersion = \"0.1\"\n"
			"PluginType = \"FileTransfer\"\n"
			"SupportedMethods = \"http,ftp,file\"\n"
			);

        return 0;
    }

	if(argc != 3) {
		return -1;
	}
	
	curl_global_init(CURL_GLOBAL_NOTHING);

	if((handle = curl_easy_init())) {
		if((file = fopen(argv[2], "w"))) {
			curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
			curl_easy_setopt(handle, CURLOPT_WRITEDATA, file);
			curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1);
			// Does curl protect against redirect loops otherwise?
			// curl_easy_setopt(handle, CURLOPT_MAXREDIRS, 1000);
			rval = curl_easy_perform(handle);
			fclose(file);

			if( rval == 0 ) {
				unsigned long httpCode = 0;
				rval = curl_easy_getinfo( handle, CURLINFO_RESPONSE_CODE, & httpCode );
				if( rval == 0 ) {
					if( httpCode != 200 ) { rval = 1; }
				}
			}
		}
		curl_easy_cleanup(handle);
	}
	curl_global_cleanup();
	
	return rval;	// 0 on success
}<commit_msg>(#3904)  Fix build on Fedora.<commit_after>#include <curl/curl.h>
#include <string.h>

int main(int argc, char **argv) {
	CURL *handle = NULL;
	int rval = -1;
	FILE *file = NULL;

	if(argc == 2 && strcmp(argv[1], "-classad") == 0) {
		printf("%s",
			"PluginVersion = \"0.1\"\n"
			"PluginType = \"FileTransfer\"\n"
			"SupportedMethods = \"http,ftp,file\"\n"
			);

		return 0;
	}

	if(argc != 3) {
		return -1;
	}

	curl_global_init(CURL_GLOBAL_NOTHING);

	if((handle = curl_easy_init())) {
		if((file = fopen(argv[2], "w"))) {
			curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
			curl_easy_setopt(handle, CURLOPT_WRITEDATA, file);
			curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1);
			// Does curl protect against redirect loops otherwise?
			// curl_easy_setopt(handle, CURLOPT_MAXREDIRS, 1000);
			rval = curl_easy_perform(handle);
			fclose(file);

			if( rval == 0 ) {
				long httpCode = 0;
				rval = curl_easy_getinfo( handle, CURLINFO_RESPONSE_CODE, & httpCode );
				if( rval == 0 ) {
					if( httpCode != 200 ) { rval = 1; }
				}
			}
		}
		curl_easy_cleanup(handle);
	}
	curl_global_cleanup();

	return rval;	// 0 on success
}
{'fraction_non_alphanumeric': 0.16427640156453716, 'fraction_numerical': 0.022598870056497175, 'mean_word_length': 3.4612403100775193, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5992016', 'n_tokens_mistral': 1098, 'n_tokens_neox': 897, 'n_words': 185}