gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_2_11_6-364-gca41fc3


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_11_6-364-gca41fc3
Date: Mon, 04 Apr 2011 20:02:25 +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=ca41fc31917d97f4a6b9aa8323a1317c1657d9af

The branch, master has been updated
       via  ca41fc31917d97f4a6b9aa8323a1317c1657d9af (commit)
       via  47279574677fcd1612470604edf3909c7540c668 (commit)
      from  28b72bb6d213e5c1f142da713fb9bd5579e493f5 (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 ca41fc31917d97f4a6b9aa8323a1317c1657d9af
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Apr 4 22:01:29 2011 +0200

    Do not cleanup bufel after it has been inserted into buffer.

commit 47279574677fcd1612470604edf3909c7540c668
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Apr 4 21:51:59 2011 +0200

    Combined dequeue with remove_front() and pop_first().

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

Summary of changes:
 lib/gnutls_mbuffers.c |   35 +++++++++--------------------------
 lib/gnutls_record.c   |    6 ++----
 2 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/lib/gnutls_mbuffers.c b/lib/gnutls_mbuffers.c
index 2eff937..415658f 100644
--- a/lib/gnutls_mbuffers.c
+++ b/lib/gnutls_mbuffers.c
@@ -90,11 +90,11 @@ void
 _mbuffer_enqueue (mbuffer_head_st * buf, mbuffer_st * bufel)
 {
   bufel->next = NULL;
+  bufel->prev = buf->tail;
 
   buf->length++;
   buf->byte_length += bufel->msg.size - bufel->mark;
 
-  bufel->prev = buf->tail;
   if (buf->tail != NULL)
     buf->tail->next = bufel;
   else
@@ -122,6 +122,9 @@ mbuffer_st* ret = bufel->next;
   if (bufel->prev)
     bufel->prev->next = bufel->next;
 
+  if (bufel->next)
+    bufel->next->prev = NULL;
+
   buf->length--;
   buf->byte_length -= bufel->msg.size - bufel->mark;
   
@@ -145,15 +148,7 @@ _mbuffer_head_pop_first (mbuffer_head_st * buf)
   if (buf->head == NULL)
     return NULL;
 
-  buf->head = bufel->next;
-  if (bufel->next)
-    bufel->next->prev = NULL;
-
-  buf->byte_length -= (bufel->msg.size - bufel->mark);
-  buf->length -= 1;
-
-  if (!buf->head)
-    buf->tail = NULL;
+  _mbuffer_dequeue(buf, bufel);
     
   return bufel;
 }
@@ -222,22 +217,13 @@ _mbuffer_head_get_next (mbuffer_st * cur, gnutls_datum_t 
* msg)
 static inline void
 remove_front (mbuffer_head_st * buf)
 {
-  mbuffer_st *bufel;
+  mbuffer_st *bufel = buf->head;
 
-  if (!buf->head)
+  if (!bufel)
     return;
 
-  bufel = buf->head;
-  buf->head = bufel->next;
-  if (bufel->next)
-    bufel->next->prev = NULL;
-
-  buf->byte_length -= (bufel->msg.size - bufel->mark);
-  buf->length -= 1;
+  _mbuffer_dequeue(buf, bufel);
   gnutls_free (bufel);
-
-  if (!buf->head)
-    buf->tail = NULL;
 }
 
 /* Remove a specified number of bytes from the start of the buffer.
@@ -301,7 +287,7 @@ _mbuffer_alloc (size_t payload_size, size_t maximum_size)
 {
   mbuffer_st *st;
 
-  st = gnutls_malloc (maximum_size + sizeof (mbuffer_st));
+  st = gnutls_calloc (1, maximum_size + sizeof (mbuffer_st));
   if (st == NULL)
     {
       gnutls_assert ();
@@ -311,9 +297,6 @@ _mbuffer_alloc (size_t payload_size, size_t maximum_size)
   /* payload points after the mbuffer_st structure */
   st->msg.data = (opaque *) st + sizeof (mbuffer_st);
   st->msg.size = payload_size;
-  st->mark = 0;
-  st->user_mark = 0;
-  st->next = NULL;
   st->maximum_size = maximum_size;
 
   return st;
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 19f6aa3..8ec637a 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -690,13 +690,11 @@ record_add_to_buffers (gnutls_session_t session,
           if (type == GNUTLS_ALERT || (htype == GNUTLS_HANDSHAKE_CLIENT_HELLO
                                        && type == GNUTLS_HANDSHAKE))
             {
-              ret = gnutls_assert_val(GNUTLS_E_GOT_APPLICATION_DATA);
-              goto cleanup;
+              return gnutls_assert_val(GNUTLS_E_GOT_APPLICATION_DATA);
             }
           else
             {
-              ret = gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET);
-              goto cleanup;
+              return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET);
             }
 
           break;


hooks/post-receive
-- 
GNU gnutls



reply via email to

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