ZungBang/burp — pull request #1 by ZungBang (2013-01-28 23:45:50+00:00)
Title: win32: prevent system from entering sleep when idle timer expires

I was recently hit by backup failures on a win7 laptop . It took a while to figure out: the client would enter sleep during the backup process - the burp server does not notice the problem, and the client aborts the backup after the laptop wakes up.

I should have suspected this, as I've been hit by [a similar problem](http://www.mail-archive.com/bacula-devel@lists.sourceforge.net/msg06855.html) a long while ago when I was using bacula :-(

The fix is to use [``SetThreadExecutionState``](http://msdn.microsoft.com/en-us/library/windows/desktop/aa373208%28v=vs.85%29.aspx) Windows API function to prevent the system from entering sleep when the idle timer expires, during any long running operation (not just backup).

Please review and pull.