From: Zdeněk Salvet Date: Wed, 22 Aug 2007 11:13:48 +0000 (+0000) Subject: Pull EOF fix to this branch, workaround Globus problem by clearing X-Git-Tag: glite-security-gsoap-plugin_R_1_5_0_1~5 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=de819d9ab296230cc74368b25c0ccff7f7475481;p=jra1mw.git Pull EOF fix to this branch, workaround Globus problem by clearing SSL error stack before gss_unwrap() call. --- 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);