git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed "using namespace std;" from stargazer.
[stg.git]
/
projects
/
stargazer
/
plugins
/
configuration
/
sgconfig
/
conn.h
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/conn.h
b/projects/stargazer/plugins/configuration/sgconfig/conn.h
index 7825d4f9ec2eb54711c4a38deff3db1622e933fb..fae0c4b2426d2c59f6296244e56ff4b7044caf9b 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/conn.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/conn.h
@@
-39,6
+39,7
@@
class USERS;
class TARIFFS;
class ADMIN;
class BASE_PARSER;
class TARIFFS;
class ADMIN;
class BASE_PARSER;
+class PLUGIN_LOGGER;
namespace STG
{
namespace STG
{
@@
-54,7
+55,8
@@
class Conn
};
Conn(const BASE_PARSER::REGISTRY & registry,
};
Conn(const BASE_PARSER::REGISTRY & registry,
- ADMINS & admins, int sock, const sockaddr_in& addr);
+ ADMINS & admins, int sock, const sockaddr_in& addr,
+ PLUGIN_LOGGER & logger);
~Conn();
int Sock() const { return m_sock; }
~Conn();
int Sock() const { return m_sock; }
@@
-67,6
+69,8
@@
class Conn
bool IsDone() const { return m_state == DONE; }
bool IsKeepAlive() const { return m_keepAlive; }
bool IsDone() const { return m_state == DONE; }
bool IsKeepAlive() const { return m_keepAlive; }
+ void SetKeepAlive() { m_keepAlive = true; }
+
private:
static const char STG_HEADER[5];
private:
static const char STG_HEADER[5];
@@
-95,11
+99,12
@@
class Conn
void * m_buffer;
size_t m_bufferSize;
void * m_buffer;
size_t m_bufferSize;
- char m_header[sizeof(STG_HEADER)
];
- char m_login[ADM_LOGIN_LEN
+ 1];
- char m_cryptoLogin[ADM_LOGIN_LEN
+ 1];
+ char m_header[sizeof(STG_HEADER)
- 1]; // Without \0
+ char m_login[ADM_LOGIN_LEN
]; // Without \0
+ char m_cryptoLogin[ADM_LOGIN_LEN
]; // Without \0
char m_data[1024];
STG::DECRYPT_STREAM * m_stream;
char m_data[1024];
STG::DECRYPT_STREAM * m_stream;
+ PLUGIN_LOGGER & m_logger;
BASE_PARSER * GetParser(const std::string & tag) const;
BASE_PARSER * GetParser(const std::string & tag) const;
@@
-113,6
+118,8
@@
class Conn
bool WriteAnswer(const void* buffer, size_t size);
bool WriteResponse();
bool WriteAnswer(const void* buffer, size_t size);
bool WriteResponse();
+ void Log(const char * file, const std::string & message);
+
struct DataState
{
DataState(bool f, Conn & c) : final(f), conn(c) {}
struct DataState
{
DataState(bool f, Conn & c) : final(f), conn(c) {}