snapshot.cgi: introduce pause before response
commit43ebfd41cc29d04443cb4af86fd5f1190d534418
authorKyle J. McKay <mackyle@gmail.com>
Thu, 29 Dec 2016 08:10:47 +0000 (29 00:10 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Thu, 29 Dec 2016 08:10:47 +0000 (29 00:10 -0800)
tree1629a7f5e9206e947a1944e6fa566523b427f285
parentfeb10cc876fa0c4b512aab47a0636b4a7f1a6527
snapshot.cgi: introduce pause before response

Add a pause before responding with snapshot data.  It's only a few
seconds and will not therefore adversely affect any legitimate clients.

However, 'bots and such that cannot afford to spend several seconds
per link are most likely to just give up and go away and cause the
connection to be killed.

To facilitate this, after the pause snapshot.cgi attempts to write
a generic header assuming that if the server has killed the connection
this will cause a SIGPIPE and kill the script.

This shouldn't be necessary to get the script killed early, but is
simply an added feature to assist with the process.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
cgi/snapshot.cgi