protocol: allow explicitly polling for a single packet

When using *blocking* I/O wait_for_* functions need to be
able to not read past their awaited packet.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2019-03-07 13:50:41 +01:00
parent 4932843923
commit e402769332
4 changed files with 31 additions and 23 deletions

View File

@ -273,7 +273,7 @@ pub extern "C" fn proxmox_backup_continue_upload(me: *mut CClient) -> c_int {
#[no_mangle]
pub extern "C" fn proxmox_backup_poll_read(me: *mut CClient) -> c_int {
let me = unsafe { &mut *me };
match me.client.poll_read() {
match me.client.poll_read(false) {
Ok(_) => 0,
Err(e) => me.set_error(e),
}