<commit_before>#include <assert.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <jansson.h>
#include <curl/curl.h>
#include <pthread.h>
#include <unistd.h>

#include "hashmap.h"
#include "lifoq.h"
#include "metrics.h"
#include "sink.h"
#include "strbuf.h"
#include "utils.h"

const useconds_t FAILURE_WAIT = 5000000; /* 5 seconds */
const int INITIAL_EXTRA_POST_BUFFER_SIZE = 128;

/* Twitter official recommended "Modern" cipher suite
 * Updated: 2019-09-20
 * go/ciphers
 */
const char* DEFAULT_CIPHERS_NSS = "ecdhe_ecdsa_aes_256_gcm_sha_384:ecdhe_rsa_aes_256_gcm_sha_384:ecdhe_ecdsa_aes_128_gcm_sha_256:ecdhe_rsa_aes_128_gcm_sha_256:ecdhe_ecdsa_aes_256_sha_384:ecdhe_rsa_aes_256_sha_384:ecdhe_ecdsa_aes_128_sha:ecdhe_rsa_aes_128_sha:aes_256_gcm_sha_384:aes_128_gcm_sha_256";
const char* DEFAULT_CIPHERS_OPENSSL = "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256";

const char* USERAGENT = "statsite-http/0";
const char* OAUTH2_GRANT = "grant_type=client_credentials";

char* DEFAULT_PARTITION = "";
const int PARTITION_DELIMITER = '?';

/*
 * Data from the HTTP sink.
 */
struct http_sink {
    sink sink;
    lifoq* queue;
    pthread_t worker;
    char* oauth_bearer;
};

/*
 * Data from the metrics_iter callback.
 */
struct metric_cb_info {
    /* Map from partition string to metrics json object */<commit_msg>Fix nss cipher suite to use commas<commit_after>#include <assert.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <jansson.h>
#include <curl/curl.h>
#include <pthread.h>
#include <unistd.h>

#include "hashmap.h"
#include "lifoq.h"
#include "metrics.h"
#include "sink.h"
#include "strbuf.h"
#include "utils.h"

const useconds_t FAILURE_WAIT = 5000000; /* 5 seconds */
const int INITIAL_EXTRA_POST_BUFFER_SIZE = 128;

/* Twitter official recommended "Modern" cipher suite
 * Updated: 2019-09-20
 * go/ciphers
 */
const char* DEFAULT_CIPHERS_NSS = "ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_aes_256_gcm_sha_384,ecdhe_rsa_aes_256_gcm_sha_384,ecdhe_ecdsa_aes_128_cbc_sha_256,ecdhe_rsa_aes_128_cbc_sha_256,ecdhe_ecdsa_aes_256_sha_384,ecdhe_rsa_aes_256_sha_384,ecdhe_ecdsa_aes_128_sha,ecdhe_rsa_aes_128_sha,ecdhe_ecdsa_aes_256_sha,ecdhe_rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,rsa_aes_256_gcm_sha_384,rsa_aes_128_cbc_sha_256,rsa_aes_256_cbc_sha_256,rsa_aes_128_sha,rsa_aes_256_sha";
const char* DEFAULT_CIPHERS_OPENSSL = "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256";

const char* USERAGENT = "statsite-http/0";
const char* OAUTH2_GRANT = "grant_type=client_credentials";

char* DEFAULT_PARTITION = "";
const int PARTITION_DELIMITER = '?';

/*
 * Data from the HTTP sink.
 */
struct http_sink {
    sink sink;
    lifoq* queue;
    pthread_t worker;
    char* oauth_bearer;
};

/*
 * Data from the metrics_iter callback.
 */
struct metric_cb_info {
    /* Map from partition string to metrics json object */
{'fraction_non_alphanumeric': 0.11701811701811701, 'fraction_numerical': 0.09801009801009801, 'mean_word_length': 6.4021978021978025, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '570516', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1460, 'n_words': 202}