return NULL;
if (!init) {
- srand(now_ms);
+ srand(now_ms * pid);
init = 1;
}
return 0;
}
+/* Initializes the SPOE filter for a proxy for a specific thread.
+ * Returns a negative value if an error occurs. */
+static int
+spoe_init_per_thread(struct proxy *p, struct flt_conf *fconf)
+{
+ struct spoe_config *conf = fconf->conf;
+ struct spoe_agent *agent = conf->agent;
+
+ if (agent->engine_id == NULL) {
+ agent->engine_id = generate_pseudo_uuid();
+ if (agent->engine_id == NULL)
+ return -1;
+ }
+ return 0;
+}
+
/**************************************************************************
* Hooks attached to a stream
*************************************************************************/
.init = spoe_init,
.deinit = spoe_deinit,
.check = spoe_check,
+ .init_per_thread = spoe_init_per_thread,
/* Handle start/stop of SPOE */
.attach = spoe_start,
}
curagent->var_pfx = strdup(curagent->id);
}
- if (curagent->engine_id == NULL)
- curagent->engine_id = generate_pseudo_uuid();
if (curagent->var_on_error) {
struct arg arg;