//-----------------------------------------------------------------------------
int CONFIGPROTO::Prepare()
{
//-----------------------------------------------------------------------------
int CONFIGPROTO::Prepare()
{
sigset_t sigmask, oldmask;
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGINT);
sigset_t sigmask, oldmask;
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGINT);
listenAddr.sin_family = PF_INET;
listenAddr.sin_port = htons(port);
listenAddr.sin_addr.s_addr = inet_addr("0.0.0.0");
listenAddr.sin_family = PF_INET;
listenAddr.sin_port = htons(port);
listenAddr.sin_addr.s_addr = inet_addr("0.0.0.0");
{
errorStr = "Bind admin socket failed";
logger("Cannot bind the socket: %s", strerror(errno));
return -1;
}
{
errorStr = "Bind admin socket failed";
logger("Cannot bind the socket: %s", strerror(errno));
return -1;
}
{
errorStr = "Listen admin socket failed";
logger("Cannot listen the socket: %s", strerror(errno));
{
errorStr = "Listen admin socket failed";
logger("Cannot listen the socket: %s", strerror(errno));
addr.sin_family = PF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
addr.sin_family = PF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
-addrLen = sizeof(addr);
-sock = socket(PF_INET, SOCK_STREAM, 0);
+socklen_t addrLen = sizeof(addr);
+int sock = socket(PF_INET, SOCK_STREAM, 0);
WriteLogAccessFailed(adminIP);
if (SendHdrAnswer(outerSocket, ans_err) < 0)
{
WriteLogAccessFailed(adminIP);
if (SendHdrAnswer(outerSocket, ans_err) < 0)
{
WriteLogAccessFailed(adminIP);
}
printfd(__FILE__, "Successfull connection from %s\n", inet_ntostring(outerAddr.sin_addr.s_addr).c_str());
WriteLogAccessFailed(adminIP);
}
printfd(__FILE__, "Successfull connection from %s\n", inet_ntostring(outerAddr.sin_addr.s_addr).c_str());