summaryrefslogtreecommitdiff
path: root/src/input/input_net.c
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-01-05 00:44:49 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-01-05 00:44:49 +0100
commitc81c9deccc79646bd7ac3f1759a4a3e4fb8a88af (patch)
treeb39027bf19757a904f9d306085d8744046f24a1f /src/input/input_net.c
parent119076c9300e2e2a816dc1a6ca32ba77f338b20c (diff)
parenta2a95425350da93551388acdca8a00818a34c317 (diff)
downloadxine-lib-c81c9deccc79646bd7ac3f1759a4a3e4fb8a88af.tar.gz
xine-lib-c81c9deccc79646bd7ac3f1759a4a3e4fb8a88af.tar.bz2
Merge from 1.2.
Diffstat (limited to 'src/input/input_net.c')
-rw-r--r--src/input/input_net.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 1d7288f41..8a4874203 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -412,6 +412,8 @@ static int net_plugin_open (input_plugin_t *this_gen ) {
char *filename;
char *pptr;
int port = 7658;
+ int toread = MAX_PREVIEW_SIZE;
+ int trycount = 0;
filename = this->host_port;
pptr=strrchr(filename, ':');
@@ -430,11 +432,15 @@ static int net_plugin_open (input_plugin_t *this_gen ) {
/*
* fill preview buffer
*/
+ while ((toread > 0) && (trycount < 10)) {
#ifndef WIN32
- this->preview_size = read (this->fh, this->preview, MAX_PREVIEW_SIZE);
+ this->preview_size += read (this->fh, this->preview + this->preview_size, toread);
#else
- this->preview_size = recv (this->fh, this->preview, MAX_PREVIEW_SIZE, 0);
+ this->preview_size += recv (this->fh, this->preview + this->preview_size, toread, 0);
#endif
+ trycount++;
+ toread = MAX_PREVIEW_SIZE - this->preview_size;
+ }
this->curpos = 0;