Overhaul of ClientPrefs extension (bug 5538, r=asherkin).

This commit is contained in:
Kyle Sanderson
2013-02-28 21:51:49 +00:00
parent 6b07625192
commit 5d942265f9
9 changed files with 325 additions and 359 deletions
+9 -9
View File
@@ -54,11 +54,10 @@ struct CookieData
{
CookieData(const char *value)
{
strncpy(this->value, value, MAX_VALUE_LENGTH);
this->value[MAX_VALUE_LENGTH-1] = '\0';
UTIL_strncpy(this->value, value, MAX_VALUE_LENGTH);
}
char value[MAX_VALUE_LENGTH];
char value[MAX_VALUE_LENGTH+1];
bool changed;
time_t timestamp;
Cookie *parent;
@@ -68,10 +67,8 @@ struct Cookie
{
Cookie(const char *name, const char *description, CookieAccess access)
{
strncpy(this->name, name, MAX_NAME_LENGTH);
this->name[MAX_NAME_LENGTH-1] = '\0';
strncpy(this->description, description, MAX_DESC_LENGTH);
this->description[MAX_DESC_LENGTH-1] = '\0';
UTIL_strncpy(this->name, name, MAX_NAME_LENGTH);
UTIL_strncpy(this->description, description, MAX_DESC_LENGTH);
this->access = access;
@@ -97,8 +94,8 @@ struct Cookie
}
}
char name[MAX_NAME_LENGTH];
char description[MAX_DESC_LENGTH];
char name[MAX_NAME_LENGTH+1];
char description[MAX_DESC_LENGTH+1];
int dbid;
CookieData *data[MAXCLIENTS+1];
CookieAccess access;
@@ -133,6 +130,8 @@ public:
bool AreClientCookiesCached(int client);
void OnPluginDestroyed(IPlugin *plugin);
bool AreClientCookiesPening(int client);
public:
IForward *cookieDataLoadedForward;
@@ -145,6 +144,7 @@ private:
bool connected[MAXCLIENTS+1];
bool statsLoaded[MAXCLIENTS+1];
bool statsPending[MAXCLIENTS+1];
};
extern CookieManager g_CookieManager;