<commit_before>
/*
 * htppCommon.c
 *
 * (C) Copyright IBM Corp. 2005
 *
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 *
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Author:        <NAME> <<EMAIL>>
 *
 * Description:
 *
 * http common (http(https) support
 *
 */

#include "cmpidt.h"
#include "httpComm.h"

#if defined USE_SSL
void
handleSSLerror(const char *file, int lineno, const char *msg)
{
  mlogf(M_ERROR, M_SHOW, "\n*** %s:%i %s -- exiting\n", file, lineno, msg);
#ifdef SFCB_DEBUG
  ERR_print_errors_fp(stderr);
#endif
  exit(-1);
}
#endif

extern int      sfcbSSLMode;

void
commInit()
{
  _SFCB_ENTER(TRACE_HTTPDAEMON, "commInit");

#if defined USE_SSL
  if (sfcbSSLMode) {
    _SFCB_TRACE(1, ("--- SSL mode"));
    if (!SSL_library_init()) {
      mlogf(M_ERROR, M_SHOW, "** OpenSSL initialization failed!\n");
      exit(-1);
    }
    SSL_load_error_strings();
    RAND_load_file("/dev/urandom", 1024);
  }
#endif

  _SFCB_EXIT();
}

int<commit_msg>[ 2961422 ] Single HTTP Daemon<commit_after>
/*
 * htppCommon.c
 *
 * (C) Copyright IBM Corp. 2005
 *
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 *
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Author:        <NAME> <<EMAIL>>
 *
 * Description:
 *
 * http common (http(https) support
 *
 */

#include "cmpidt.h"
#include "httpComm.h"

#if defined USE_SSL
void
handleSSLerror(const char *file, int lineno, const char *msg)
{
  mlogf(M_ERROR, M_SHOW, "\n*** %s:%i %s -- exiting\n", file, lineno, msg);
#ifdef SFCB_DEBUG
  ERR_print_errors_fp(stderr);
#endif
  exit(-1);
}
#endif

extern int      sfcbSSLMode;

#if defined USE_SSL
void
commInit()
{
  _SFCB_ENTER(TRACE_HTTPDAEMON, "commInit");

  if (sfcbSSLMode) {
    _SFCB_TRACE(1, ("--- SSL mode"));
    if (!SSL_library_init()) {
      mlogf(M_ERROR, M_SHOW, "** OpenSSL initialization failed!\n");
      exit(-1);
    }
    SSL_load_error_strings();
    RAND_load_file("/dev/urandom", 1024);
  }

  _SFCB_EXIT();
}
#endif

int
{'fraction_non_alphanumeric': 0.1403071814030718, 'fraction_numerical': 0.0136986301369863, 'mean_word_length': 3.6525096525096523, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6554641', 'n_tokens_mistral': 952, 'n_tokens_neox': 904, 'n_words': 233}