retry_transfer_wrapper(): check for interrupt before operation

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Andrey Utkin 2013-07-11 00:19:05 +03:00 committed by Michael Niedermayer
parent 1e85b5e077
commit 34fd21120d
1 changed files with 2 additions and 2 deletions

View File

@ -273,6 +273,8 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
len = 0;
while (len < size_min) {
if (ff_check_interrupt(&h->interrupt_callback))
return AVERROR_EXIT;
ret = transfer_func(h, buf+len, size-len);
if (ret == AVERROR(EINTR))
continue;
@ -296,8 +298,6 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
if (ret)
fast_retries = FFMAX(fast_retries, 2);
len += ret;
if (len < size && ff_check_interrupt(&h->interrupt_callback))
return AVERROR_EXIT;
}
return len;
}