2e15b699069d147795f3b4bcdf50aa9d099be9ff max Thu Mar 6 02:31:47 2014 -0800 moving the phoneHome business into cgiApoptosis.c/.h to make it callablefrom cart.c. We need to call it from cart.c as otherwise cgiApoptosisSetup (originally: phoneHome) will be called after mysql connections are opened. This leads to "mysql server has gone away" if any CGI is not faster than the child process forked here. The child will close all mysql connections of the parent process. With the new setup, the childi is forked before any mysql connections are opened. Ideally this would be all done in cheapcgi, but cheapcgi is not in the hg/lib part of the code. diff --git src/hg/inc/cgiApoptosis.h src/hg/inc/cgiApoptosis.h new file mode 100644 index 0000000..52aa7ae --- /dev/null +++ src/hg/inc/cgiApoptosis.h @@ -0,0 +1,19 @@ +/* functions to auto-kill CGIs after a certain amount of time has passed */ + +#ifndef CGIAPOPTOSIS_H +#define CGIAPOPTOSIS_H + +#include +#include +#include +#include "geoMirror.h" +#include +#include "trackHub.h" + +void lazarusLives(unsigned long newExpireSeconds); +/* long running process requests more time */ + +void cgiApoptosisSetup(); +/* setting up cgi auto killing after x minutes */ + +#endif /* CGIAPOPTOSIS_H */