winix/core/data.cpp

45 lines
791 B
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "data.h"
Data::Data()
{
signal_hup = false;
stdout_is_closed = false;
how_many_logged = 0;
// the rest will be read from a config file
}
void Data::SetAdditionalVariables()
{
SetHttpHost(base_url, base_url_http_host);
SetHttpHost(base_url_auth, base_url_auth_http_host);
}
void Data::SetHttpHost(const std::string & in, std::string & out)
{
if( strncmp(in.c_str(), "http://", 7) == 0 )
out = in.substr(7);
else
if( strncmp(in.c_str(), "https://", 8) == 0 )
out = in.substr(8);
else
out.clear(); // if empty the RequestController::BaseUrlRedirect() returns false and no redirecting will be done
}