[glib: 1/2] Fixing g_socket_send_message() documentation to make it clearer




commit 7e00091b6072df68c9fc9507f60c604e1a350f92
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Tue Jan 12 17:33:49 2021 +0100

    Fixing g_socket_send_message() documentation to make it clearer

 gio/gsocket.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gio/gsocket.c b/gio/gsocket.c
index b86eaab60..b203965b5 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -4754,9 +4754,9 @@ input_message_from_msghdr (const struct msghdr  *msg,
  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
  * very common due to the way the underlying APIs work.)
  *
- * Finally, it must be mentioned that the whole message buffer cannot
- * exceed %G_MAXSSIZE, if the message can be more than this, then it
- * is mandatory to use the g_socket_send_message_with_timeout()
+ * The sum of the sizes of each #GOutputVector in vectors must not be
+ * greater than %G_MAXSSIZE. If the message can be larger than this,
+ * then it is mandatory to use the g_socket_send_message_with_timeout()
  * function.
  *
  * On error -1 is returned and @error is set accordingly.
@@ -4788,18 +4788,19 @@ g_socket_send_message (GSocket                *socket,
         {
           g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                        _("Unable to send message: %s"),
-                       _("Message too large"));
+                       _("Message vectors too large"));
           return -1;
         }
 
       vectors_size += vectors[i].size;
     }
-  /* Check if vectors buffers are too big for gssize */
+
+  /* Check if vector's buffers are too big for gssize */
   if (vectors_size > G_MAXSSIZE)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                    _("Unable to send message: %s"),
-                   _("Message too large"));
+                   _("Message vectors too large"));
       return -1;
     }
 


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