From aa56f99ee28b3851434a6a7ff474b60243d67908 Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Sat, 18 Jun 2011 09:32:23 +0200 Subject: [PATCH] reset random seed on first python spooler job --- plugins/python/python_plugin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 9a1b3542..d1e159da 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -1000,9 +1000,15 @@ void uwsgi_python_add_item(char *key, uint16_t keylen, char *val, uint16_t valle int uwsgi_python_spooler(char *buf, uint16_t len) { + static int random_seed_reset = 0; PyObject *spool_dict = PyDict_New(); PyObject *spool_func, *pyargs, *ret; + if (!random_seed_reset) { + uwsgi_python_reset_random_seed(); + random_seed_reset = 1; + } + if (!up.embedded_dict) { // ignore return 0;