From: Siegfried L. <si...@us...> - 2002-01-04 02:17:07
|
Update of /cvsroot/xine/xine-lib/src/input In directory usw-pr-cvs1:/tmp/cvs-serv1361 Modified Files: input_net.c Log Message: fixed read_block Index: input_net.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/input/input_net.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- input_net.c 2002/01/04 01:21:53 1.16 +++ input_net.c 2002/01/04 02:17:02 1.17 @@ -210,16 +210,25 @@ * */ static off_t net_plugin_read (input_plugin_t *this_gen, - char *buf, off_t nlen) { + char *buf, off_t len) { net_input_plugin_t *this = (net_input_plugin_t *) this_gen; - off_t n; + off_t n, total; - n = read (this->fh, buf, nlen); - - if (n > 0) - this->curpos += n; - - return n; + total=0; + while (total<len){ + n = read (this->fh, &buf[total], len-total); + /* + printf ("input_net: got %lld bytes (%lld/%lld bytes read)\n", + n,total,len); + */ + if (n > 0){ + this->curpos += n; + total += n; + } + else if (n<0 && errno!=EAGAIN) + return total; + } + return total; } static buf_element_t *net_plugin_read_block (input_plugin_t *this_gen, |