[glib] Extend IO_ERROR enum for Proxy support



commit b304a23af73374857e6bb18fc636d83fe9ed58ea
Author: Nicolas Dufresne <nicolas dufresne collabora co uk>
Date:   Wed Apr 28 15:39:56 2010 -0400

    Extend IO_ERROR enum for Proxy support

 gio/gioenums.h |   17 ++++++++++++++++-
 gio/gioerror.c |   18 ++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/gio/gioenums.h b/gio/gioenums.h
index 8027cf6..967b061 100644
--- a/gio/gioenums.h
+++ b/gio/gioenums.h
@@ -436,6 +436,14 @@ typedef enum {
  *     domain. Use g_dbus_error_get_remote_error() to extract the D-Bus
  *     error name and g_dbus_error_strip_remote_error() to fix up the
  *     message so it matches what was received on the wire. Since 2.26.
+ * @G_IO_ERROR_HOST_UNREACHABLE: Host unreachable. Since 2.26
+ * @G_IO_ERROR_NETWORK_UNREACHABLE: Network unreachable. Since 2.26
+ * @G_IO_ERROR_CONNECTION_REFUSED: Connection refused. Since 2.26
+ * @G_IO_ERROR_PROXY_FAILED: Connection to proxy server failed. Since 2.26
+ * @G_IO_ERROR_PROXY_AUTH_FAILED: Proxy authentication failed. Since 2.26
+ * @G_IO_ERROR_PROXY_NEED_AUTH: Proxy server needs authentication. Since 2.26
+ * @G_IO_ERROR_PROXY_NOT_ALLOWED: Proxy connection is not allowed by ruleset.
+ *     Since 2.26
  *
  * Error codes returned by GIO functions.
  *
@@ -477,7 +485,14 @@ typedef enum {
   G_IO_ERROR_ADDRESS_IN_USE,
   G_IO_ERROR_PARTIAL_INPUT,
   G_IO_ERROR_INVALID_DATA,
-  G_IO_ERROR_DBUS_ERROR
+  G_IO_ERROR_DBUS_ERROR,
+  G_IO_ERROR_HOST_UNREACHABLE,
+  G_IO_ERROR_NETWORK_UNREACHABLE,
+  G_IO_ERROR_CONNECTION_REFUSED,
+  G_IO_ERROR_PROXY_FAILED,
+  G_IO_ERROR_PROXY_AUTH_FAILED,
+  G_IO_ERROR_PROXY_NEED_AUTH,
+  G_IO_ERROR_PROXY_NOT_ALLOWED
 } GIOErrorEnum;
 
 
diff --git a/gio/gioerror.c b/gio/gioerror.c
index 9bd4004..dda802d 100644
--- a/gio/gioerror.c
+++ b/gio/gioerror.c
@@ -199,6 +199,24 @@ g_io_error_from_errno (gint err_no)
       break;
 #endif
 
+#ifdef EHOSTUNREACH
+    case EHOSTUNREACH:
+      return G_IO_ERROR_HOST_UNREACHABLE;
+      break;
+#endif
+
+#ifdef ENETUNREACH
+    case ENETUNREACH:
+      return G_IO_ERROR_NETWORK_UNREACHABLE;
+      break;
+#endif
+
+#ifdef ECONNREFUSED
+    case ECONNREFUSED:
+      return G_IO_ERROR_CONNECTION_REFUSED;
+      break;
+#endif
+
     default:
       return G_IO_ERROR_FAILED;
       break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]