diff options
author | Jonathan Bastien-Filiatrault <joe@x2a.org> | 2009-08-09 14:30:54 -0400 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-06-03 19:37:54 +0200 |
commit | 5217d518cdbe3e9cf32c3d72514d0f15242d67c2 (patch) | |
tree | a9d1103be1dbca79c341d4799bc0e3920c8f3447 /lib/gnutls_mbuffers.c | |
parent | f816631c8cdf8c1117248593ce3f9e6e40dea009 (diff) | |
download | gnutls-5217d518cdbe3e9cf32c3d72514d0f15242d67c2.tar.gz |
Pass datums to mbuffers by address instead of by value.
Diffstat (limited to 'lib/gnutls_mbuffers.c')
-rw-r--r-- | lib/gnutls_mbuffers.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/gnutls_mbuffers.c b/lib/gnutls_mbuffers.c index b2db65b1d7..34c5e6cf4e 100644 --- a/lib/gnutls_mbuffers.c +++ b/lib/gnutls_mbuffers.c @@ -53,7 +53,7 @@ _gnutls_mbuffer_clear (mbuffer_head_st *buf) } int -_gnutls_mbuffer_enqueue (mbuffer_head_st *buf, gnutls_datum_t msg) +_gnutls_mbuffer_enqueue (mbuffer_head_st *buf, const gnutls_datum_t *msg) { mbuffer_st *bufel = gnutls_malloc (sizeof (mbuffer_st)); @@ -66,10 +66,10 @@ _gnutls_mbuffer_enqueue (mbuffer_head_st *buf, gnutls_datum_t msg) bufel->next = NULL; bufel->mark = 0; - bufel->msg = msg; + bufel->msg = *msg; buf->length++; - buf->byte_length += msg.size; + buf->byte_length += msg->size; *(buf->tail) = bufel; buf->tail = &bufel->next; @@ -78,11 +78,11 @@ _gnutls_mbuffer_enqueue (mbuffer_head_st *buf, gnutls_datum_t msg) } int -_gnutls_mbuffer_enqueue_copy (mbuffer_head_st *buf, gnutls_datum_t msg) +_gnutls_mbuffer_enqueue_copy (mbuffer_head_st *buf, const gnutls_datum_t *msg) { gnutls_datum_t msg_copy; - msg_copy.data = gnutls_malloc (msg.size); + msg_copy.data = gnutls_malloc (msg->size); if (msg_copy.data == NULL) { @@ -90,10 +90,10 @@ _gnutls_mbuffer_enqueue_copy (mbuffer_head_st *buf, gnutls_datum_t msg) return GNUTLS_E_MEMORY_ERROR; } - msg_copy.size = msg.size; - memcpy (msg_copy.data, msg.data, msg_copy.size); + msg_copy.size = msg->size; + memcpy (msg_copy.data, msg->data, msg_copy.size); - return _gnutls_mbuffer_enqueue (buf, msg_copy); + return _gnutls_mbuffer_enqueue (buf, &msg_copy); } void |