<commit_before>// Copyright 2009 <NAME>.
// This source comes from the XtreemFS project. It is licensed under the GPLv2 (see COPYING for terms and conditions).

#include "org/xtreemfs/client/proxy.h"
#include "policy_container.h"
#include "platform_exception_event.h"
using namespace org::xtreemfs::client;

#include "org/xtreemfs/interfaces/constants.h"

#include <algorithm>

#ifdef _WIN32
#include "yield/platform/windows.h"
#define ETIMEDOUT WSAETIMEDOUT
#else
#include <errno.h>
#endif


Proxy::Proxy( const YIELD::URI& uri, uint16_t default_oncrpc_port )
  : uri( uri )
{
  ssl_context = NULL;
  log = NULL;
  init( default_oncrpc_port );
}

Proxy::Proxy( const YIELD::URI& uri, YIELD::Log& log, uint16_t default_oncrpc_port )
  : uri( uri ), log( &log )
{
  ssl_context = NULL;
  init( default_oncrpc_port );
}

Proxy::Proxy( const YIELD::URI& uri, YIELD::SSLContext& ssl_context, uint16_t default_oncrpcs_port )
: uri( uri ), ssl_context( &ssl_context )
{
  log = NULL;
  init( default_oncrpcs_port );
}

Proxy::Proxy( const YIELD::URI& uri, YIELD::SSLContext& ssl_context, YIELD::Log& log, uint16_t default_oncrpcs_port )
: uri( uri ), ssl_context( &ssl_context ), log( &log )
{
  init( default_oncrpcs_port );
}

void Proxy::init( uint16_t default_port )
{
  peer_sockaddr = this->uri;

  if ( this->uri.get_port() == 0 )
    this->uri.set_port( default_port );

  policies = new PolicyContainer;

  flags = PROXY_DEFAULT_FLAGS;<commit_msg>client: Proxy: small bug fix<commit_after>// Copyright 2009 <NAME>.
// This source comes from the XtreemFS project. It is licensed under the GPLv2 (see COPYING for terms and conditions).

#include "org/xtreemfs/client/proxy.h"
#include "policy_container.h"
#include "platform_exception_event.h"
using namespace org::xtreemfs::client;

#include "org/xtreemfs/interfaces/constants.h"

#include <algorithm>

#ifdef _WIN32
#include "yield/platform/windows.h"
#define ETIMEDOUT WSAETIMEDOUT
#else
#include <errno.h>
#endif


Proxy::Proxy( const YIELD::URI& uri, uint16_t default_oncrpc_port )
  : uri( uri )
{
  ssl_context = NULL;
  log = NULL;
  init( default_oncrpc_port );
}

Proxy::Proxy( const YIELD::URI& uri, YIELD::Log& log, uint16_t default_oncrpc_port )
  : uri( uri ), log( &log )
{
  ssl_context = NULL;
  init( default_oncrpc_port );
}

Proxy::Proxy( const YIELD::URI& uri, YIELD::SSLContext& ssl_context, uint16_t default_oncrpcs_port )
: uri( uri ), ssl_context( &ssl_context )
{
  log = NULL;
  init( default_oncrpcs_port );
}

Proxy::Proxy( const YIELD::URI& uri, YIELD::SSLContext& ssl_context, YIELD::Log& log, uint16_t default_oncrpcs_port )
: uri( uri ), ssl_context( &ssl_context ), log( &log )
{
  init( default_oncrpcs_port );
}

void Proxy::init( uint16_t default_port )
{
  if ( this->uri.get_port() == 0 )
    this->uri.set_port( default_port );

  peer_sockaddr = this->uri;

  policies = new PolicyContainer;

  flags = PROXY_DEFAULT_FLAGS;
{'fraction_non_alphanumeric': 0.13104631217838766, 'fraction_numerical': 0.012349914236706689, 'mean_word_length': 5.037267080745342, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '4215615', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1104, 'n_words': 257}