git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'github/master'
[stg.git]
/
projects
/
sgauth
/
main.cpp
diff --git
a/projects/sgauth/main.cpp
b/projects/sgauth/main.cpp
index b161a5f300ea275a98bf4bec2d884f06030a0477..3256ae52424c4e8d63e62abfb95772ca0428394a 100644
(file)
--- a/
projects/sgauth/main.cpp
+++ b/
projects/sgauth/main.cpp
@@
-35,8
+35,8
@@
#include <iostream>
#include <vector>
#include <iostream>
#include <vector>
-#include "
ia_auth_c
.h"
-#include "common.h"
+#include "
stg/ia
.h"
+#include "
stg/
common.h"
#include "web.h"
#include "settings_impl.h"
#include "web.h"
#include "settings_impl.h"
@@
-49,8
+49,6
@@
const int winKOI = 0;
IA_CLIENT_PROT * clnp;
WEB * web = NULL;
IA_CLIENT_PROT * clnp;
WEB * web = NULL;
-using namespace std;
-
time_t stgTime;
//-----------------------------------------------------------------------------
time_t stgTime;
//-----------------------------------------------------------------------------
@@
-61,13
+59,13
@@
void Usage()
printf("sgauth <path_to_config>\n");
}
//-----------------------------------------------------------------------------
printf("sgauth <path_to_config>\n");
}
//-----------------------------------------------------------------------------
-void SetDirName(const
vector<
string> & dn, void *)
+void SetDirName(const
std::vector<std::
string> & dn, void *)
{
for (int j = 0; j < DIR_NUM; j++)
{
if (winKOI)
{
{
for (int j = 0; j < DIR_NUM; j++)
{
if (winKOI)
{
- string dir;
+ st
d::st
ring dir;
KOIToWin(dn[j], &dir);
if (web)
web->SetDirName(dir, j);
KOIToWin(dn[j], &dir);
if (web)
web->SetDirName(dir, j);
@@
-90,13
+88,13
@@
void StatusChanged(int, void *)
{
}
//-----------------------------------------------------------------------------
{
}
//-----------------------------------------------------------------------------
-void ShowMessage(const string & message, int i, int, int, void *)
+void ShowMessage(const st
d::st
ring & message, int i, int, int, void *)
{
if (web)
web->AddMessage(message, i);
}
//-----------------------------------------------------------------------------
{
if (web)
web->AddMessage(message, i);
}
//-----------------------------------------------------------------------------
-void ShowError(const string & message, int, void *)
+void ShowError(const st
d::st
ring & message, int, void *)
{
if (web)
web->AddMessage(message, 0);
{
if (web)
web->AddMessage(message, 0);
@@
-106,20
+104,20
@@
void CatchUSR1(int)
{
if (clnp->GetAuthorized())
{
{
if (clnp->GetAuthorized())
{
-
cout << "Connect" <<
endl;
+
std::cout << "Connect" << std::
endl;
clnp->Connect();
}
}
//-----------------------------------------------------------------------------
void CatchUSR2(int)
{
clnp->Connect();
}
}
//-----------------------------------------------------------------------------
void CatchUSR2(int)
{
-
cout << "Disconnect" <<
endl;
+
std::cout << "Disconnect" << std::
endl;
clnp->Disconnect();
}
//-----------------------------------------------------------------------------
void CatchTERM(int)
{
clnp->Disconnect();
}
//-----------------------------------------------------------------------------
void CatchTERM(int)
{
-
cout << "Terminated" <<
endl;
+
std::cout << "Terminated" << std::
endl;
clnp->Disconnect();
sleep(2);
exit(0);
clnp->Disconnect();
sleep(2);
exit(0);
@@
-200,7
+198,7
@@
if (settings.GetDaemon())
}
}
}
}
-clnp = new IA_CLIENT_PROT(settings.GetServerName(), settings.GetServerPort(), settings.GetLocalPort());
+clnp = new IA_CLIENT_PROT(settings.GetServerName(), settings.GetServerPort(), settings.GetLocal
Name(), settings.GetLocal
Port());
if (!settings.GetNoWeb())
{
if (!settings.GetNoWeb())
{
@@
-239,7
+237,8
@@
clnp->Connect();
while (1)
{
while (1)
{
- usleep(200000);
+ struct timespec ts = {0, 200000000};
+ nanosleep(&ts, NULL);
char state[20];
char state[20];