-
Notifications
You must be signed in to change notification settings - Fork 443
/
Accessdb.h
53 lines (35 loc) · 870 Bytes
/
Accessdb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// Author: Matt Wells
//
// Rdb to store the access log
#ifndef _ACCESSDB_H_
#define _ACCESSDB_H_
bool sendPageAccount ( class TcpSocket *s , class HttpRequest *r ) ;
#include "Rdb.h"
#include "Msg4.h"
class AccessRec {
public:
key128_t m_key128;
int32_t m_ip;
int64_t m_fbId; // facebook id, 0 if none
};
class Accessdb {
public:
// reset m_rdb
void reset() { m_rdb.reset(); };
// initialize m_rdb
bool init( );
bool addColl ( char *coll, bool doVerify = false );
Rdb *getRdb() { return &m_rdb; }
key128_t makeKey1 ( int64_t now, int64_t widgetId64 ) ;
key128_t makeKey2 ( int64_t now, int64_t widgetId64 ) ;
bool addAccess ( class HttpRequest *r , int32_t ip );
bool registerHandler ( ) ;
Rdb m_rdb;
int32_t m_niceness;
AccessRec m_arec[2];
Msg4 m_msg4;
bool m_msg4InUse;
};
extern class Accessdb g_accessdb;
#endif