Update of /cvsroot/xine/xine-lib/src/input
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv32296
Modified Files:
input_http.c
Log Message:
Return a different code for every possible output, makes simpler to debug what
caused the failure.
Index: input_http.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/input/input_http.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -r1.123 -r1.124
--- input_http.c 13 Sep 2006 23:28:22 -0000 1.123
+++ input_http.c 30 Nov 2006 10:54:18 -0000 1.124
@@ -709,7 +709,7 @@
this->curpos = 0;
if (this->fh == -1)
- return -1;
+ return -2;
{
uint32_t timeout, progress;
@@ -729,7 +729,7 @@
if (res != XIO_READY) {
_x_message(this->stream, XINE_MSG_NETWORK_UNREACHABLE, this->mrl, NULL);
- return -1;
+ return -3;
}
}
@@ -777,7 +777,7 @@
if (_x_io_tcp_write (this->stream, this->fh, this->buf, buflen) != buflen) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "couldn't send
request", NULL);
xprintf(this_class->xine, XINE_VERBOSITY_DEBUG, "input_http: couldn't send
request\n");
- return -1;
+ return -4;
}
lprintf ("request sent: >%s<\n", this->buf);
@@ -787,13 +787,10 @@
this->contentlength = 0;
while (!done) {
-
- /*
- printf ("input_http: read...\n");
- */
+ /* fprintf (stderr, "input_http: read...\n"); */
if (_x_io_tcp_read (this->stream, this->fh, &this->buf[len], 1) <= 0) {
- return -1;
+ return -5;
}
if (this->buf[len] == '\012') {
@@ -822,7 +819,7 @@
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "invalid http
answer", NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: invalid http answer\n"));
- return -1;
+ return -6;
}
}
@@ -835,20 +832,20 @@
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: http status not 2xx: >%d %s<\n"),
httpcode, httpstatus);
- return -1;
+ return -7;
} else if (httpcode == 403) {
_x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: http status not 2xx: >%d %s<\n"),
httpcode, httpstatus);
- return -1;
+ return -8;
} else if (httpcode < 200 || httpcode >= 300) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "http status
not 2xx: ",
httpstatus, NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: http status not 2xx: >%d %s<\n"),
httpcode, httpstatus);
- return -1;
+ return -9;
}
} else {
if (this->contentlength == 0) {
@@ -926,7 +923,7 @@
_x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL);
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: buffer exhausted after %d bytes."), BUFSIZE);
- return -1;
+ return -10;
}
}
@@ -938,7 +935,7 @@
this->preview_size = MAX_PREVIEW_SIZE;
if (this->is_nsv) {
if (!resync_nsv(this))
- return -1;
+ return -11;
/* the first 3 chars are "NSV" */
this->preview_size = http_plugin_read_int (this, this->preview + 3,
MAX_PREVIEW_SIZE - 3);
@@ -947,7 +944,7 @@
}
if (this->preview_size < 0) {
xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: read error
%d\n"), errno);
- return -1;
+ return -12;
}
lprintf("preview_size=%lld\n", this->preview_size);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog