mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
improve tk_istream_read_len
This commit is contained in:
parent
b1a7e59a83
commit
bead56eb1d
@ -77,6 +77,11 @@ int32_t tk_istream_read_len(tk_istream_t* stream, uint8_t* buff, uint32_t max_si
|
||||
break;
|
||||
}
|
||||
|
||||
if (object_get_prop_bool(OBJECT(stream), TK_STREAM_PROP_IS_EOS, FALSE)) {
|
||||
log_debug("stream is end\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (errno == EAGAIN || errno == 0) {
|
||||
sleep_ms(10);
|
||||
continue;
|
||||
@ -93,6 +98,11 @@ int32_t tk_istream_read_len(tk_istream_t* stream, uint8_t* buff, uint32_t max_si
|
||||
break;
|
||||
}
|
||||
|
||||
if (object_get_prop_bool(OBJECT(stream), TK_STREAM_PROP_IS_EOS, FALSE)) {
|
||||
log_debug("stream is end\n");
|
||||
break;
|
||||
}
|
||||
|
||||
now = time_now_ms();
|
||||
if (now > end) {
|
||||
log_debug("read timeout\n");
|
||||
|
Loading…
Reference in New Issue
Block a user