rename static buffer

This commit is contained in:
z3APA3A 2018-04-21 01:45:09 +03:00
parent 83441eebc7
commit b76b3b49fa
2 changed files with 9 additions and 8 deletions

View File

@ -1402,6 +1402,8 @@ void sqlerr (char *buf){
pthread_mutex_unlock(&log_mutex);
}
unsigned char statbuf[8192];
void logsql(struct clientparam * param, const unsigned char *s) {
SQLRETURN ret;
int len;
@ -1409,35 +1411,35 @@ void logsql(struct clientparam * param, const unsigned char *s) {
if(param->nolog) return;
pthread_mutex_lock(&log_mutex);
len = dobuf(param, tmpbuf, s, (unsigned char *)"\'");
len = dobuf(param, statbuf, s, (unsigned char *)"\'");
if(attempt > 5){
time_t t;
t = time(0);
if (t - attempt_time < 180){
sqlerr((char *)tmpbuf);
sqlerr((char *)statbuf);
return;
}
}
if(!hstmt){
if(!init_sql(sqlstring)) {
sqlerr((char *)tmpbuf);
sqlerr((char *)statbuf);
return;
}
}
if(hstmt){
ret = SQLExecDirect(hstmt, (SQLCHAR *)tmpbuf, (SQLINTEGER)len);
ret = SQLExecDirect(hstmt, (SQLCHAR *)statbuf, (SQLINTEGER)len);
if(ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO){
close_sql();
if(!init_sql(sqlstring)){
sqlerr((char *)tmpbuf);
sqlerr((char *)statbuf);
return;
}
if(hstmt) {
ret = SQLExecDirect(hstmt, (SQLCHAR *)tmpbuf, (SQLINTEGER)len);
ret = SQLExecDirect(hstmt, (SQLCHAR *)statbuf, (SQLINTEGER)len);
if(ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO){
sqlerr((char *)tmpbuf);
sqlerr((char *)statbuf);
return;
}
attempt = 0;

View File

@ -311,7 +311,6 @@ struct datatype;
struct dictionary;
struct node;
struct property;
extern unsigned char tmpbuf[8192];
extern pthread_mutex_t config_mutex;
extern pthread_mutex_t bandlim_mutex;
extern pthread_mutex_t connlim_mutex;