gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, gnutls_3_1_x, updated. gnutls_3_1_0-42-gcf897b1


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_3_1_x, updated. gnutls_3_1_0-42-gcf897b1
Date: Sun, 02 Sep 2012 09:01:22 +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=cf897b154ec929335cb377b0556330cc60e72882

The branch, gnutls_3_1_x has been updated
       via  cf897b154ec929335cb377b0556330cc60e72882 (commit)
       via  870b155536759c0330978d20795a822703cfaace (commit)
       via  13d7771506712a3fb6ccee60228426b05a55be9f (commit)
       via  b92636e1ae9d3bd59f3b13cef449894c96c03050 (commit)
      from  f7ea065e5e35dfe615905926293888af7af8ae8e (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 cf897b154ec929335cb377b0556330cc60e72882
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Sep 2 10:59:16 2012 +0200

    dump the errno received by select

commit 870b155536759c0330978d20795a822703cfaace
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Sep 2 10:36:12 2012 +0200

    use errno_to_gerr() in _gnutls_io_check_recv().

commit 13d7771506712a3fb6ccee60228426b05a55be9f
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Sep 2 11:00:02 2012 +0200

    increased timeouts

commit b92636e1ae9d3bd59f3b13cef449894c96c03050
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Sep 2 10:25:52 2012 +0200

    Do not repeatedly set timeout

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

Summary of changes:
 lib/gnutls_buffers.c           |   14 ++++++------
 lib/gnutls_handshake.c         |    3 +-
 lib/gnutls_state.c             |    2 +
 tests/mini-handshake-timeout.c |   43 ++++++++++++---------------------------
 4 files changed, 24 insertions(+), 38 deletions(-)

diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c
index 973fb1c..ff0f82a 100644
--- a/lib/gnutls_buffers.c
+++ b/lib/gnutls_buffers.c
@@ -663,13 +663,13 @@ _gnutls_io_check_recv (gnutls_session_t session, unsigned 
int ms)
   ret = session->internals.pull_timeout_func(fd, ms);
 
   err = get_errno (session);
-  if (ret == -1 && err == EINTR)
-    return GNUTLS_E_INTERRUPTED;
-  else if (ret == -1 && err == EAGAIN)
-    return GNUTLS_E_AGAIN;
-  else if (ret == -1)
-    return gnutls_assert_val(GNUTLS_E_PULL_ERROR);
-  
+  if (ret == -1)
+    {
+      _gnutls_read_log ("READ_TIMEOUT: %d returned from %p, errno=%d (timeout: 
%u)\n",
+                       (int) ret, fd, err, ms);
+      return errno_to_gerr(err);
+    }
+
   if (ret > 0)
     return 0;
   else return GNUTLS_E_TIMEDOUT;
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 343cfb0..edb736b 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -2372,7 +2372,8 @@ gnutls_handshake (gnutls_session_t session)
   if (session->internals.priorities.protocol.algorithms == 0)
     return gnutls_assert_val(GNUTLS_E_NO_PRIORITIES_WERE_SET);
 
-  if (session->internals.handshake_timeout_ms)
+  if (session->internals.handshake_timeout_ms && 
+      session->internals.handshake_endtime == 0)
     session->internals.handshake_endtime = gnutls_time(0) + 
       session->internals.handshake_timeout_ms / 1000;
 
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index c868d48..32ed927 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -275,6 +275,8 @@ _gnutls_handshake_internal_state_clear (gnutls_session_t 
session)
   deinit_internal_params (session);
   
   _gnutls_epoch_gc(session);
+
+  session->internals.handshake_endtime = 0;
 }
 
 #define MIN_DH_BITS 727
diff --git a/tests/mini-handshake-timeout.c b/tests/mini-handshake-timeout.c
index d6a1501..ee4541b 100644
--- a/tests/mini-handshake-timeout.c
+++ b/tests/mini-handshake-timeout.c
@@ -67,14 +67,12 @@ client_log_func (int level, const char *str)
 /* A very basic TLS client, with anonymous authentication.
  */
 
-static int counter;
-gnutls_session_t session;
-
 static void
 client (int fd, int wait)
 {
   int ret;
   gnutls_anon_client_credentials_t anoncred;
+  gnutls_session_t session;
   /* Need to enable anonymous KX specifically. */
 
   gnutls_global_init ();
@@ -90,7 +88,7 @@ client (int fd, int wait)
   /* Initialize TLS session
    */
   gnutls_init (&session, GNUTLS_CLIENT);
-  gnutls_handshake_set_timeout( session, 10*1000);
+  gnutls_handshake_set_timeout( session, 20*1000);
 
   /* Use default priorities */
   gnutls_priority_set_direct (session, "NORMAL:+ANON-ECDH", NULL);
@@ -99,8 +97,6 @@ client (int fd, int wait)
    */
   gnutls_credentials_set (session, GNUTLS_CRD_ANON, anoncred);
 
-  counter = 0;
-
   gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) fd);
 
   /* Perform the TLS handshake
@@ -138,32 +134,24 @@ client (int fd, int wait)
   exit(0);
 }
 
-
-/* These are global */
-gnutls_anon_server_credentials_t anoncred;
-pid_t child;
-
-static gnutls_session_t
-initialize_tls_session (void)
+static void
+initialize_tls_session (gnutls_session_t * session)
 {
-  gnutls_session_t session;
-
-  gnutls_init (&session, GNUTLS_SERVER);
+  gnutls_init (session, GNUTLS_SERVER);
 
   /* avoid calling all the priority functions, since the defaults
    * are adequate.
    */
-  gnutls_priority_set_direct (session, "NORMAL:+ANON-ECDH", NULL);
-
-  gnutls_credentials_set (session, GNUTLS_CRD_ANON, anoncred);
-
-  return session;
+  gnutls_priority_set_direct (*session, "NORMAL:+ANON-ECDH", NULL);
 }
 
 static void
 server (int fd, int wait)
 {
 int ret;
+gnutls_session_t session;
+gnutls_anon_server_credentials_t anoncred;
+
   /* this must be called once in the program
    */
   gnutls_global_init ();
@@ -176,13 +164,12 @@ int ret;
 
   gnutls_anon_allocate_server_credentials (&anoncred);
 
-  session = initialize_tls_session ();
-
-  counter = 0;
+  initialize_tls_session (&session);
+  gnutls_credentials_set (session, GNUTLS_CRD_ANON, anoncred);
 
   gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) fd);
 
-  if (wait) sleep(15);
+  if (wait) sleep(25);
   else do 
     {
       ret = gnutls_handshake (session);
@@ -192,17 +179,13 @@ int ret;
   gnutls_deinit (session);
   gnutls_anon_free_server_credentials(anoncred);
   gnutls_global_deinit();
-
-  if (ret < 0)
-    {
-      return;
-    }
 }
 
 static void start (int wait)
 {
   int fd[2];
   int ret;
+  pid_t child;
   
   if (debug && wait)
     fprintf(stderr, "\nWill test timeout\n");


hooks/post-receive
-- 
GNU gnutls



reply via email to

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