summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@users.sourceforge.net>2004-04-15 00:14:56 +0000
committerBastien Nocera <hadess@users.sourceforge.net>2004-04-15 00:14:56 +0000
commit5419e144c8c5dfef7f9b43cb2c28b86d64e7b648 (patch)
tree7cd9ea4abf5ad1fc65ab8a321e24b381c62a2d54
parent00512219b700c8f0a6bfc3598804c72b0c984f0c (diff)
downloadxine-lib-5419e144c8c5dfef7f9b43cb2c28b86d64e7b648.tar.gz
xine-lib-5419e144c8c5dfef7f9b43cb2c28b86d64e7b648.tar.bz2
- generate events for "Permission denied" and "File not found" in the http and file plugins
CVS patchset: 6404 CVS date: 2004/04/15 00:14:56
-rw-r--r--ChangeLog2
-rw-r--r--include/xine.h.in3
-rw-r--r--src/input/input_file.c15
-rw-r--r--src/input/input_http.c14
4 files changed, 30 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 588039238..fd4df9ca8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@ xine-lib (1-rc4)
* build improvements - different source and build directory, translations
* avoid deadlock with raw AC3 streams and visualization
* fix 24 bpp RGB output - may affect some users of xshm and fb
+ * generate events for "Permission denied" and "File not found" in the
+ http and file plugins
xine-lib (1-rc3c)
* fix the deadlock with non-seekable input plugins
diff --git a/include/xine.h.in b/include/xine.h.in
index 50c624df1..58c347c07 100644
--- a/include/xine.h.in
+++ b/include/xine.h.in
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.h.in,v 1.119 2004/04/09 14:46:02 miguelfreitas Exp $
+ * $Id: xine.h.in,v 1.120 2004/04/15 00:14:56 hadess Exp $
*
* public xine-lib (libxine) interface and documentation
*
@@ -1652,6 +1652,7 @@ typedef struct {
#define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */
#define XINE_MSG_SECURITY 10 /* (security message) */
#define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */
+#define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */
/* opaque xine_event_queue_t */
typedef struct xine_event_queue_s xine_event_queue_t;
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 8a6b1bfbf..c04a79d76 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_file.c,v 1.90 2004/04/10 15:45:11 mroi Exp $
+ * $Id: input_file.c,v 1.91 2004/04/15 00:14:57 hadess Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -261,8 +261,19 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
else
this->fh = open(this->mrl, O_RDONLY|O_BINARY);
- if (this->fh == -1)
+ if (this->fh == -1) {
+ if (errno == EACCES) {
+ _x_message(this->stream, XINE_MSG_PERMISSION_ERROR, this->mrl, NULL);
+ xine_log (this->stream->xine, XINE_LOG_MSG,
+ _("input_file: Permission denied: >%s<\n"), this->mrl);
+ } else if (errno == ENOENT) {
+ _x_message(this->stream, XINE_MSG_FILE_NOT_FOUND, this->mrl, NULL);
+ xine_log (this->stream->xine, XINE_LOG_MSG,
+ _("input_file: File not found: >%s<\n"), this->mrl);
+ }
+
return 0;
+ }
}
return 1;
diff --git a/src/input/input_http.c b/src/input/input_http.c
index d6afd9511..c7e426a2e 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -19,7 +19,7 @@
*
* input plugin for http network streams
*
- * $Id: input_http.c,v 1.85 2004/04/10 15:45:11 mroi Exp $
+ * $Id: input_http.c,v 1.86 2004/04/15 00:14:57 hadess Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -790,6 +790,18 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_http: 3xx redirection: >%d %s<\n"),
httpcode, httpstatus);
+ } else if (httpcode == 404) {
+ _x_message(this->stream, XINE_MSG_FILE_NOT_FOUND, this->mrl, NULL);
+ xine_log (this->stream->xine, XINE_LOG_MSG,
+ _("input_http: http status not 2xx: >%d %s<\n"),
+ httpcode, httpstatus);
+ return 0;
+ } 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 0;
} else if (httpcode < 200 || httpcode >= 300) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "http status not 2xx: ",
httpstatus, NULL);