gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, gnutls_3_0_x-2, updated. gnutls_3_0_20-19-g180f


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_3_0_x-2, updated. gnutls_3_0_20-19-g180f1b3
Date: Thu, 28 Jun 2012 19:22:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=180f1b31feeaa319c358be39f886b46a891749d9

The branch, gnutls_3_0_x-2 has been updated
       via  180f1b31feeaa319c358be39f886b46a891749d9 (commit)
      from  756cfa4f54c01e74425660f25ad99515bff91f48 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 180f1b31feeaa319c358be39f886b46a891749d9
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Jun 28 21:21:33 2012 +0200

    Return GNUTLS_E_LARGE_PACKET when errno is EMSGSIZE

-----------------------------------------------------------------------

Summary of changes:
 NEWS                  |    3 +++
 doc/cha-gtls-app.texi |    6 ++++--
 lib/gnutls_buffers.c  |   27 +++++++++++++--------------
 lib/gnutls_errors.c   |    4 ++--
 lib/gnutls_record.c   |    3 ++-
 lib/system.c          |    3 +++
 6 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/NEWS b/NEWS
index 0468c41..cae54d9 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@ as it has issues.
 ** libgnutls: Corrected bug that prevented resolving PKCS #11 URLs 
 if only the label is specified. Patch by David Woodhouse.
 
+** libgnutls: When EMSGSIZE errno is seen then GNUTLS_E_LARGE_PACKET
+is returned.
+
 ** API and ABI modifications:
 gnutls_session_set_premaster: Added
 
diff --git a/doc/cha-gtls-app.texi b/doc/cha-gtls-app.texi
index 35f705f..52f6126 100644
--- a/doc/cha-gtls-app.texi
+++ b/doc/cha-gtls-app.texi
@@ -595,15 +595,17 @@ value instead of setting @code{errno} directly.
 
 @showfuncdesc{gnutls_transport_set_errno}
 
address@hidden currently only interprets the EINTR and EAGAIN errno
address@hidden currently only interprets the EINTR, EAGAIN and EMSGSIZE errno
 values and returns the corresponding @acronym{GnuTLS} error codes:
 @itemize
 @item @code{GNUTLS_E_INTERRUPTED} 
 @item @code{GNUTLS_E_AGAIN}
address@hidden @code{GNUTLS_E_LARGE_PACKET}
 @end itemize
 The EINTR and EAGAIN values are returned by interrupted system calls, 
 or when non blocking IO is used.  All @acronym{GnuTLS} functions can be 
-resumed (called again), if any of the above error codes is returned.  
+resumed (called again), if any of the above error codes is returned. The
+EMSGSIZE value is returned when attempting to send a large datagram.
 
 In the case of DTLS it is also desirable to override the generic 
 transport functions with functions that emulate the operation
diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c
index 3ff364b..afa5d30 100644
--- a/lib/gnutls_buffers.c
+++ b/lib/gnutls_buffers.c
@@ -186,22 +186,21 @@ _gnutls_dgram_read (gnutls_session_t session, mbuffer_st 
**bufel,
       _gnutls_read_log ("READ: %d returned from %p, errno=%d gerrno=%d\n",
                        (int) i, fd, errno, session->internals.errnum);
 
-      if (err == EAGAIN)
-        {
-          ret = GNUTLS_E_AGAIN;
-          goto cleanup;
-        }
-      else if (err == EINTR)
+      switch(err)
         {
-          ret = GNUTLS_E_INTERRUPTED;
-          goto cleanup;
-        }
-      else
-        {
-          gnutls_assert ();
-          ret = GNUTLS_E_PULL_ERROR;
-          goto cleanup;
+          case EAGAIN:
+            ret = GNUTLS_E_AGAIN;
+            goto cleanup;
+          case EINTR:
+            ret = GNUTLS_E_INTERRUPTED;
+            goto cleanup;
+          case EMSGSIZE:
+            ret = GNUTLS_E_LARGE_PACKET;
+          default:
+            gnutls_assert ();
+            ret = GNUTLS_E_PULL_ERROR;
         }
+      goto cleanup;
     }
   else
     {
diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c
index c70b3bf..71b6e6a 100644
--- a/lib/gnutls_errors.c
+++ b/lib/gnutls_errors.c
@@ -64,8 +64,6 @@ static const gnutls_error_entry error_algorithms[] = {
 
   ERROR_ENTRY (N_("An algorithm that is not enabled was negotiated."),
                GNUTLS_E_UNWANTED_ALGORITHM, 1),
-  ERROR_ENTRY (N_("A large TLS record packet was received."),
-               GNUTLS_E_LARGE_PACKET, 1),
   ERROR_ENTRY (N_("A record packet with illegal version was received."),
                GNUTLS_E_UNSUPPORTED_VERSION_PACKET, 1),
   ERROR_ENTRY (N_
@@ -164,6 +162,8 @@ static const gnutls_error_entry error_algorithms[] = {
                GNUTLS_E_KEY_USAGE_VIOLATION, 1),
   ERROR_ENTRY (N_("Resource temporarily unavailable, try again."),
                GNUTLS_E_AGAIN, 0),
+  ERROR_ENTRY (N_("The transmitted packet is too large (EMSGSIZE)."),
+               GNUTLS_E_LARGE_PACKET, 0),
   ERROR_ENTRY (N_("Function was interrupted."), GNUTLS_E_INTERRUPTED, 0),
   ERROR_ENTRY (N_("Rehandshake was requested by the peer."),
                GNUTLS_E_REHANDSHAKE, 0),
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 01c4fb0..e6250f8 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -1226,7 +1226,8 @@ _gnutls_recv_int (gnutls_session_t session, 
content_type_t type,
  * %GNUTLS_E_INTERRUPTED or %GNUTLS_E_AGAIN is returned, you must
  * call this function again, with the same parameters; alternatively
  * you could provide a %NULL pointer for data, and 0 for
- * size. cf. gnutls_record_get_direction().
+ * size. cf. gnutls_record_get_direction(). The errno value EMSGSIZE
+ * maps to %GNUTLS_E_LARGE_PACKET.
  *
  * Returns: The number of bytes sent, or a negative error code.  The
  *   number of bytes sent might be less than @data_size.  The maximum
diff --git a/lib/system.c b/lib/system.c
index 679bb0a..d2ef259 100644
--- a/lib/system.c
+++ b/lib/system.c
@@ -70,6 +70,9 @@ system_errno (gnutls_transport_ptr p)
     case WSAEINTR:
       ret = EINTR;
       break;
+    case WSAEMSGSIZE:
+      ret = EMSGSIZE;
+      break;
     default:
       ret = EIO;
       break;


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]