Browse Source

ckdb - don't truncate large replies from cmd_userset()

master
kanoi 10 years ago
parent
commit
d0ccf22697
  1. 2
      src/ckdb.h
  2. 9
      src/ckdb_cmd.c

2
src/ckdb.h

@ -52,7 +52,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "0.9.6" #define DB_VERSION "0.9.6"
#define CKDB_VERSION DB_VERSION"-0.803" #define CKDB_VERSION DB_VERSION"-0.804"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

9
src/ckdb_cmd.c

@ -173,6 +173,7 @@ static char *cmd_userset(PGconn *conn, char *cmd, char *id,
USERS *users; USERS *users;
char *reason = NULL; char *reason = NULL;
char *answer = NULL; char *answer = NULL;
char *ret = NULL;
size_t len, off; size_t len, off;
int32_t ratio; int32_t ratio;
int rows, i; int rows, i;
@ -398,10 +399,12 @@ struckout:
LOGERR("%s.%s.%s", cmd, id, reply); LOGERR("%s.%s.%s", cmd, id, reply);
return strdup(reply); return strdup(reply);
} }
snprintf(reply, siz, "ok.%s", answer); APPEND_REALLOC_INIT(ret, off, len);
LOGDEBUG("%s.%s", id, answer); APPEND_REALLOC(ret, off, len, "ok.");
APPEND_REALLOC(ret, off, len, answer);
free(answer); free(answer);
return strdup(reply); LOGDEBUG("%s.%s", id, ret);
return ret;
} }
static char *cmd_workerset(PGconn *conn, char *cmd, char *id, tv_t *now, static char *cmd_workerset(PGconn *conn, char *cmd, char *id, tv_t *now,

Loading…
Cancel
Save