diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-04-07 23:40:21 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-04-07 23:40:21 +0200 |
commit | 8abdca2c4b57e2eabcfd3e508975ec34d9dd33cd (patch) | |
tree | b63edffa231eec3fe148268dc964b9ebe6288bf9 /tests/eagain-common.h | |
parent | 5c6409196ed1ec61f1e218f7779086699e83d896 (diff) | |
download | gnutls-8abdca2c4b57e2eabcfd3e508975ec34d9dd33cd.tar.gz |
Avoid using gnutls_transport_set_global_errno() and use gnutls_transport_set_errno() instead.
Diffstat (limited to 'tests/eagain-common.h')
-rw-r--r-- | tests/eagain-common.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/eagain-common.h b/tests/eagain-common.h index 0cb76eeefe..473e236c21 100644 --- a/tests/eagain-common.h +++ b/tests/eagain-common.h @@ -93,22 +93,22 @@ static char to_client[64*1024]; static size_t to_client_len = 0; #ifdef RANDOMIZE -#define RETURN_RND_EAGAIN() \ +#define RETURN_RND_EAGAIN(session) \ static unsigned char rnd = 0; \ if (rnd++ % 2 == 0) \ { \ - gnutls_transport_set_global_errno (EAGAIN); \ + gnutls_transport_set_errno (session, EAGAIN); \ return -1; \ } #else -#define RETURN_RND_EAGAIN() +#define RETURN_RND_EAGAIN(session) #endif static ssize_t client_push (gnutls_transport_ptr_t tr, const void *data, size_t len) { size_t newlen; - RETURN_RND_EAGAIN(); + RETURN_RND_EAGAIN(tr); len = min(len, sizeof(to_server)-to_server_len); @@ -124,7 +124,7 @@ client_push (gnutls_transport_ptr_t tr, const void *data, size_t len) static ssize_t client_pull (gnutls_transport_ptr_t tr, void *data, size_t len) { - RETURN_RND_EAGAIN(); + RETURN_RND_EAGAIN(tr); if (to_client_len == 0) { @@ -151,7 +151,7 @@ static ssize_t server_pull (gnutls_transport_ptr_t tr, void *data, size_t len) { //success ("server_pull len %d has %d\n", len, to_server_len); - RETURN_RND_EAGAIN(); + RETURN_RND_EAGAIN(tr); if (to_server_len == 0) { @@ -178,7 +178,7 @@ static ssize_t server_push (gnutls_transport_ptr_t tr, const void *data, size_t len) { size_t newlen; - RETURN_RND_EAGAIN(); + RETURN_RND_EAGAIN(tr); // hexprint (data, len); |