All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit b013f46a authored by Mike Hibler's avatar Mike Hibler

remove static limit on number of agents (ReallyBigUn has over 1000 agents!)

parent 8b7b9b80
......@@ -41,14 +41,14 @@ static int debug;
static void cleanup(void);
static void quit(int);
#define MAXAGENTS 200
static struct {
struct agent {
char nodeid[TBDB_FLEN_NODEID];
char vnode[TBDB_FLEN_VNAME];
char objname[TBDB_FLEN_EVOBJNAME];
char objtype[TBDB_FLEN_EVOBJTYPE];
char ipaddr[32];
} agents[MAXAGENTS];
};
static struct agent *agents;
static int numagents;
void
......@@ -368,6 +368,12 @@ get_static_events(event_handle_t handle)
return 0;
}
nrows = mysql_num_rows(res);
agents = calloc(nrows, sizeof(struct agent));
if (agents == NULL) {
error("cannot allocate memory, too many agents (%d)\n", nrows);
return 0;
}
while (nrows--) {
row = mysql_fetch_row(res);
......@@ -406,9 +412,6 @@ get_static_events(event_handle_t handle)
strcpy(agents[numagents].ipaddr, ADDRESSTUPLE_ALL);
}
numagents++;
if (numagents >= MAXAGENTS) {
fatal("Too many agents!");
}
}
mysql_free_result(res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment