<commit_before>#include <stdlib.h>

#include "vrt.h"
#include "bin/varnishd/cache.h"

#include "vcc_if.h"

#include <sys/socket.h>
#include <netdb.h>

int
init_function(struct vmod_priv *priv, const struct VCL_conf *conf) {
	return (0);
}

int vmod_clientip(struct sess *sp, const char *ipstring) {
	struct addrinfo hints;
	struct addrinfo *rp;
	int s;

	memset(&hints, 0, sizeof(struct addrinfo));
	hints.ai_family = AF_UNSPEC;

	// Don't attempt DNS resolution.
	hints.ai_flags = AI_NUMERICHOST;
	hints.ai_protocol = 0;

	s = getaddrinfo(ipstring, NULL, &hints, &rp);
	if (s != 0) {
		VSL(SLT_Debug, 0, "ipcast: Unable to decode IP address '%s'", ipstring);
		VSL(SLT_Debug, 0, "ipcast: getaddrinfo(): %s", gai_strerror(s));
		return(s);
	}

	sp->sockaddrlen = rp->ai_addrlen;
	memcpy(sp->sockaddr, rp->ai_addr, sizeof(struct sockaddr_storage));

	freeaddrinfo(rp);
	return(0);
}
<commit_msg>Log with VCL_Log instead of Debug<commit_after>#include <stdlib.h>

#include "vrt.h"
#include "bin/varnishd/cache.h"

#include "vcc_if.h"

#include <sys/socket.h>
#include <netdb.h>

int
init_function(struct vmod_priv *priv, const struct VCL_conf *conf) {
	return (0);
}

int vmod_clientip(struct sess *sp, const char *ipstring) {
	struct addrinfo hints;
	struct addrinfo *rp;
	int s;

	memset(&hints, 0, sizeof(struct addrinfo));
	hints.ai_family = AF_UNSPEC;

	// Don't attempt DNS resolution.
	hints.ai_flags = AI_NUMERICHOST;
	hints.ai_protocol = 0;

	s = getaddrinfo(ipstring, NULL, &hints, &rp);
	if (s != 0) {
		VSL(SLT_VCL_Log, 0, "ipcast: Unable to decode IP address '%s'",
				ipstring);
		VSL(SLT_VCL_Log, 0, "ipcast: getaddrinfo(): %s", gai_strerror(s));
		return(s);
	}

	sp->sockaddrlen = rp->ai_addrlen;
	memcpy(sp->sockaddr, rp->ai_addr, sizeof(struct sockaddr_storage));

	freeaddrinfo(rp);
	return(0);
}

{'fraction_non_alphanumeric': 0.15418502202643172, 'fraction_numerical': 0.007709251101321586, 'mean_word_length': 4.937908496732026, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '1410393', 'n_tokens_mistral': 790, 'n_tokens_neox': 748, 'n_words': 173}