CA-39291: Work around firewalls which kill idle TCP connections by inserting a small empty block into an export every 5s or so.
CA-39291: Work around firewalls which kill idle TCP connections by inserting a small empty block into an export every 5s or so.

The failure happens whenever a disk has a lot of zeroes in it: the TCP connection goes idle while the server is scanning for the next non-zero block. Even setting SO_KEEPALIVE on the stunnel sockets and reducing the window probe interval down to 30s didn't fix it. We wish to keep the ability to have a basic client do an export via HTTP GET so we can't add application-level keepalives to the protocol... we must add them to the export itself.

Note this change is backwards compatible. The receiver code expects:
* a common prefix
* a monotonically increasing chunk number
* the first and last blocks to be the same size and included verbatim (even if all zeroes)
* blocks of zeroes the same size as the first block represented as gaps in the increasing chunk number sequence

Therefore including extra files of length 0 in the stream will be ignored provided they
* share the common prefix and chunk numbering scheme
* are not the first or last blocks

Signed-off-by: David Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@eu.citrix.com>

rafalmiel/xen-api,salvocambria/xen-api,Frezzle/xen-api,koushikcgit/xen-api,robertbreker/xen-api,simonjbeaumont/xen-api,huizh/xen-api,koushikcgit/xen-api,djs55/xen-api,Frezzle/xen-api,thomassa/xen-api,anoobs/xen-api,jjd27/xen-api,agimofcarmen/xen-api,djs55/xen-api,cheng-z/xen-api,thomassa/xen-api,agimofcarmen/xen-api,huizh/xen-api,anoobs/xen-api,djs55/xen-api,anoobs/xen-api,cheng-z/xen-api,cheng-z/xen-api,robertbreker/xen-api,agimofcarmen/xen-api,ravippandey/xen-api,anoobs/xen-api,koushikcgit/xen-api,ravippandey/xen-api,guard163/xen-api,cheng--zhang/xen-api,vasilenkomike/xen-api,rafalmiel/xen-api,srowe/xen-api,ravippandey/xen-api,cheng-z/xen-api,rafalmiel/xen-api,vasilenkomike/xen-api,robertbreker/xen-api,Frezzle/xen-api,huizh/xen-api,jjd27/xen-api,robertbreker/xen-api,vasilenkomike/xen-api,djs55/xen-api,huizh/xen-api,djs55/xen-api,euanh/xen-api,simonjbeaumont/xen-api,salvocambria/xen-api,cheng--zhang/xen-api,agimofcarmen/xen-api,ravippandey/xen-api,simonjbeaumont/xen-api,jjd27/xen-api,salvocambria/xen-api,cheng-z/xen-api,jjd27/xen-api,huizh/xen-api,thomassa/xen-api,vasilenkomike/xen-api,cheng--zhang/xen-api,guard163/xen-api,thomassa/xen-api,ravippandey/xen-api,simonjbeaumont/xen-api,jjd27/xen-api,Frezzle/xen-api,euanh/xen-api,rafalmiel/xen-api,srowe/xen-api,vasilenkomike/xen-api,rafalmiel/xen-api,salvocambria/xen-api,srowe/xen-api,ravippandey/xen-api,srowe/xen-api,simonjbeaumont/xen-api,anoobs/xen-api,cheng--zhang/xen-api,salvocambria/xen-api,Frezzle/xen-api,cheng-z/xen-api,vasilenkomike/xen-api,srowe/xen-api,agimofcarmen/xen-api,anoobs/xen-api,koushikcgit/xen-api,koushikcgit/xen-api,rafalmiel/xen-api,koushikcgit/xen-api,jjd27/xen-api,agimofcarmen/xen-api,guard163/xen-api,guard163/xen-api,cheng--zhang/xen-api,salvocambria/xen-api,guard163/xen-api,cheng-z/xen-api,cheng--zhang/xen-api,cheng--zhang/xen-api,euanh/xen-api,djs55/xen-api,simonjbeaumont/xen-api,robertbreker/xen-api,guard163/xen-api,robertbreker/xen-api,euanh/xen-api,euanh/xen-api,thomassa/xen-api,thomassa/xen-api,huizh/xen-api,euanh/xen-api