From de819d9ab296230cc74368b25c0ccff7f7475481 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20Salvet?= Date: Wed, 22 Aug 2007 11:13:48 +0000 Subject: [PATCH] Pull EOF fix to this branch, workaround Globus problem by clearing SSL error stack before gss_unwrap() call. --- org.glite.security.gsoap-plugin/interface/glite_gss.h | 1 + org.glite.security.gsoap-plugin/src/glite_gss.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/org.glite.security.gsoap-plugin/interface/glite_gss.h b/org.glite.security.gsoap-plugin/interface/glite_gss.h index 3dd4903..fd1739a 100644 --- a/org.glite.security.gsoap-plugin/interface/glite_gss.h +++ b/org.glite.security.gsoap-plugin/interface/glite_gss.h @@ -4,6 +4,7 @@ #ident "$Header$" #include +#include #ifdef __cplusplus extern "C" { diff --git a/org.glite.security.gsoap-plugin/src/glite_gss.c b/org.glite.security.gsoap-plugin/src/glite_gss.c index 1bf7fd3..d158ff3 100644 --- a/org.glite.security.gsoap-plugin/src/glite_gss.c +++ b/org.glite.security.gsoap-plugin/src/glite_gss.c @@ -366,8 +366,12 @@ recv_token(int sock, void **token, size_t *token_length, struct timeval *to) goto end; } } - if (count == 0 && tl == 0 && errno == 0) - return EDG_WLL_GSS_ERROR_EOF; + + if (count==0) { + if (tl==0) + return EDG_WLL_GSS_ERROR_EOF; + else goto end; + } tmp=realloc(t, tl + count); if (tmp == NULL) { errno = ENOMEM; @@ -867,6 +871,7 @@ edg_wll_gss_read(edg_wll_GssConnection *connection, void *buf, size_t bufsize, /* XXX cleanup */ return ret; + ERR_clear_error(); maj_stat = gss_unwrap(&min_stat, connection->context, &input_token, &output_token, NULL, NULL); gss_release_buffer(&min_stat, &input_token); -- 1.8.2.3