Skip to content

Commit 86c3b29

Browse files
committed
properly cancel calls with timeouts
1 parent 275452f commit 86c3b29

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rfccal.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,14 +712,18 @@ int __call_with_timeout(long timeout, RFC_HANDLE handle, rfc_char_t *function, R
712712
}
713713
} while ( (now < until) && (rfc_rc == RFC_RETRY) );
714714

715-
if( rfc_rc != RFC_OK ){
715+
if( rfc_rc == RFC_RETRY ){
716+
rfc_rc = RfcCancel(handle, RFC_CANCEL_CLOSE);
716717
return PHP_RFC_TIMEOUT_EXPIRED;
717718
}
718719
}
719-
rfc_rc = RfcReceive(handle, importing, tables, exception);
720+
if (rfc_rc == RFC_OK)
721+
rfc_rc = RfcReceive(handle, importing, tables, exception);
722+
720723
}else{
721724
exception = NULL;
722725
}
726+
723727
return rfc_rc;
724728
}
725729

0 commit comments

Comments
 (0)