Exemplo n.º 1
0
/* zsync_receive_data(self, buf[], offset, buflen)
 * Passes data received from the source URL at the given offset; 
 * data is buflen bytes in buf[].
 * Returns 0 unless there's an error (e.g. the submitted data doesn't match the
 * expected checksum for the corresponding blocks)
 */
int zsync_receive_data(struct zsync_receiver *zr, const unsigned char *buf,
                       off_t offset, size_t len) {
    if (zr->url_type == 1) {
        return zsync_receive_data_compressed(zr, buf, offset, len);
    }
    else {
        return zsync_receive_data_uncompressed(zr, buf, offset, len);
    }
}
Exemplo n.º 2
0
/* zsync_receive_data(self, buf[], offset, buflen)
 * Passes data received from the source URL at the given offset; 
 * data is buflen bytes in buf[].
 * Returns 0 unless there's an error (e.g. the submitted data doesn't match the
 * expected checksum for the corresponding blocks)
 */
int zsync_receive_data(struct zsync_receiver *zr, const unsigned char *buf, off_t offset, size_t len)
{
#if SUPPORT_GZIP_STREAM
    if (zr->url_type == 1) {
        return zsync_receive_data_compressed(zr, buf, offset, len);
    }
    else
#endif
    {
        return zsync_receive_data_uncompressed(zr, buf, offset, len);
    }
}