<commit_before>#include "cdpi_dns.hpp"

#include <mongo/client/dbclient.h>

#include <stdlib.h>
#include <unistd.h>

#include <arpa/inet.h>

#include <set>
#include <string>

#include <unbound.h>

using namespace std;

#define RESOLVE_MAX 4096

static const char *http_soa   = "HTTP.soa";
static char *dns_server = NULL;

mongo::DBClientConnection mongo_conn;

void get_epoch_millis(mongo::Date_t &date)
{
    struct timeval tv;

    gettimeofday(&tv, NULL);

    date.millis = ((unsigned long long)(tv.tv_sec) * 1000 +
                   (unsigned long long)(tv.tv_usec) / 1000);
}

void
ubcallback(void *mydata, int err, struct ub_result *result)
{
    int *resolving = (int*)mydata;<commit_msg>fixed a bug on src/cdpi_mongo_soa.cpp check error in unbound's callback function<commit_after>#include "cdpi_dns.hpp"

#include <mongo/client/dbclient.h>

#include <stdlib.h>
#include <unistd.h>

#include <arpa/inet.h>

#include <set>
#include <string>

#include <unbound.h>

using namespace std;

#define RESOLVE_MAX 4096

static const char *http_soa   = "HTTP.soa";
static char *dns_server = NULL;

mongo::DBClientConnection mongo_conn;

void get_epoch_millis(mongo::Date_t &date)
{
    struct timeval tv;

    gettimeofday(&tv, NULL);

    date.millis = ((unsigned long long)(tv.tv_sec) * 1000 +
                   (unsigned long long)(tv.tv_usec) / 1000);
}

void
ubcallback(void *mydata, int err, struct ub_result *result)
{
    if (err < 0)
        return;

    int *resolving = (int*)mydata;
{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.016722408026755852, 'mean_word_length': 4.003344481605351, 'pattern_counts': {'":': 0, '<': 18, '<?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': '6054256', 'n_tokens_mistral': 595, 'n_tokens_neox': 562, 'n_words': 135}