[glib] gio: Add G_IO_ERROR_MESSAGE_TOO_LARGE



commit be732677f56f4da48f737dc7edd821ec1928515c
Author: Olivier CrĂȘte <olivier crete collabora com>
Date:   Thu Jul 2 11:32:34 2015 +0100

    gio: Add G_IO_ERROR_MESSAGE_TOO_LARGE
    
    Corresponding to EMSGSIZE, for when UDP datagrams are rejected due to
    being too big.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752240

 gio/gioenums.h |    4 +++-
 gio/gioerror.c |    9 +++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gio/gioenums.h b/gio/gioenums.h
index 24e7d65..30d863d 100644
--- a/gio/gioenums.h
+++ b/gio/gioenums.h
@@ -495,6 +495,7 @@ typedef enum {
  *     returned %G_IO_ERROR_FAILED. Now they should all return the same
  *     value, which has this more logical name. Since 2.44.
  * @G_IO_ERROR_NOT_CONNECTED: Transport endpoint is not connected. Since 2.44
+ * @G_IO_ERROR_MESSAGE_TOO_LARGE: Message too large. Since 2.48.
  *
  * Error codes returned by GIO functions.
  *
@@ -559,7 +560,8 @@ typedef enum {
   G_IO_ERROR_PROXY_NOT_ALLOWED,
   G_IO_ERROR_BROKEN_PIPE,
   G_IO_ERROR_CONNECTION_CLOSED = G_IO_ERROR_BROKEN_PIPE,
-  G_IO_ERROR_NOT_CONNECTED
+  G_IO_ERROR_NOT_CONNECTED,
+  G_IO_ERROR_MESSAGE_TOO_LARGE,
 } GIOErrorEnum;
 
 
diff --git a/gio/gioerror.c b/gio/gioerror.c
index c069347..c2efa20 100644
--- a/gio/gioerror.c
+++ b/gio/gioerror.c
@@ -254,6 +254,12 @@ g_io_error_from_errno (gint err_no)
       break;
 #endif
 
+#ifdef EMSGSIZE
+    case EMSGSIZE:
+      return G_IO_ERROR_MESSAGE_TOO_LARGE;
+      break;
+#endif
+
     default:
       return G_IO_ERROR_FAILED;
       break;
@@ -337,6 +343,9 @@ g_io_error_from_win32_error (gint error_code)
     case ERROR_PIPE_LISTENING:
       return G_IO_ERROR_NOT_CONNECTED;
 
+    case WSAEMSGSIZE:
+      return G_IO_ERROR_MESSAGE_TOO_LARGE;
+
     default:
       return G_IO_ERROR_FAILED;
     }


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