'Generates data for a single chunk.'

def _GenerateChunk(self, length):

    while 1:
        to_read = min(length, self.RECV_BLOCK_SIZE)
        if (to_read == 0):
            return
        data = self.rfile.read(to_read)
        if (not data):
            return
        (yield data)
        length -= len(data)
