[Top][All Lists]
[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-20-g744d
From: |
Nikos Mavrogiannopoulos |
Subject: |
[SCM] GNU gnutls branch, gnutls_3_0_x-2, updated. gnutls_3_0_20-20-g744d5c8 |
Date: |
Fri, 29 Jun 2012 14:43:11 +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=744d5c815bd4fb0386bb945b77589f0b89167045
The branch, gnutls_3_0_x-2 has been updated
via 744d5c815bd4fb0386bb945b77589f0b89167045 (commit)
from 180f1b31feeaa319c358be39f886b46a891749d9 (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 744d5c815bd4fb0386bb945b77589f0b89167045
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Fri Jun 29 16:40:30 2012 +0200
cleaned up errno handling.
-----------------------------------------------------------------------
Summary of changes:
lib/gnutls_buffers.c | 55 ++++++++++++++++++++++++++-----------------------
1 files changed, 29 insertions(+), 26 deletions(-)
diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c
index afa5d30..74e2d92 100644
--- a/lib/gnutls_buffers.c
+++ b/lib/gnutls_buffers.c
@@ -155,6 +155,23 @@ int ret;
return ret;
}
+inline static
+int errno_to_gerr(int err)
+{
+ switch(err)
+ {
+ case EAGAIN:
+ return GNUTLS_E_AGAIN;
+ case EINTR:
+ return GNUTLS_E_INTERRUPTED;
+ case EMSGSIZE:
+ return GNUTLS_E_LARGE_PACKET;
+ default:
+ gnutls_assert ();
+ return GNUTLS_E_PUSH_ERROR;
+ }
+}
+
static ssize_t
_gnutls_dgram_read (gnutls_session_t session, mbuffer_st **bufel,
gnutls_pull_func pull_func)
@@ -186,20 +203,7 @@ _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);
- switch(err)
- {
- 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;
- }
+ ret = errno_to_gerr(err);
goto cleanup;
}
else
@@ -271,9 +275,7 @@ _gnutls_stream_read (gnutls_session_t session, mbuffer_st
**bufel,
goto finish;
}
- if (err == EAGAIN)
- return GNUTLS_E_AGAIN;
- return GNUTLS_E_INTERRUPTED;
+ return errno_to_gerr(err);
}
else
{
@@ -346,6 +348,7 @@ _gnutls_writev_emu (gnutls_session_t session,
gnutls_transport_ptr_t fd, const g
return ret;
}
+
static ssize_t
_gnutls_writev (gnutls_session_t session, const giovec_t * giovec,
int giovec_cnt)
@@ -364,15 +367,8 @@ _gnutls_writev (gnutls_session_t session, const giovec_t *
giovec,
{
int err = get_errno (session);
_gnutls_debug_log ("errno: %d\n", err);
- if (err == EAGAIN)
- return GNUTLS_E_AGAIN;
- else if (err == EINTR)
- return GNUTLS_E_INTERRUPTED;
- else
- {
- gnutls_assert ();
- return GNUTLS_E_PUSH_ERROR;
- }
+
+ return errno_to_gerr(err);
}
return i;
}
@@ -590,6 +586,13 @@ _gnutls_io_write_flush (gnutls_session_t session)
(int) send_buffer->byte_length);
return ret;
}
+ else if (ret == GNUTLS_E_LARGE_PACKET)
+ {
+ _mbuffer_head_remove_bytes (send_buffer, tosend);
+ _gnutls_write_log ("WRITE cannot send large packet (%u bytes).\n",
+ (unsigned int) tosend);
+ return ret;
+ }
else
{
_gnutls_write_log ("WRITE error: code %d, %d bytes left.\n",
hooks/post-receive
--
GNU gnutls
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU gnutls branch, gnutls_3_0_x-2, updated. gnutls_3_0_20-20-g744d5c8,
Nikos Mavrogiannopoulos <=