From: Daniel KouĊ™il Date: Sat, 3 May 2008 22:11:20 +0000 (+0000) Subject: Better error handling. Fixes bug #35118. X-Git-Tag: merge_313_4_src~6 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=346eee4eec34bf40be692422e1707eff834f90b8;p=jra1mw.git Better error handling. Fixes bug #35118. --- diff --git a/org.glite.lb.client/src/notification.c b/org.glite.lb.client/src/notification.c index 2d91207..ecf380c 100644 --- a/org.glite.lb.client/src/notification.c +++ b/org.glite.lb.client/src/notification.c @@ -783,11 +783,27 @@ select: ret = edg_wll_gss_accept(ctx->connPoolNotif[0].gsiCred, recv_sock, &tv, &ctx->connPoolNotif[0].gss,&gss_code); - if (ret) { - edg_wll_SetError(ctx, errno, "GSS authentication failed."); - goto err; + + switch (ret) { + case EDG_WLL_GSS_OK: + break; + case EDG_WLL_GSS_ERROR_ERRNO: + edg_wll_SetError(ctx,errno,"failed to receive notification"); + goto err; + case EDG_WLL_GSS_ERROR_GSS: + edg_wll_SetErrorGss(ctx, "failed to authenticate sender", &gss_code); + goto err; + case EDG_WLL_GSS_ERROR_EOF: + edg_wll_SetError(ctx,ECONNREFUSED,"sender closed the connection"); + goto err; + case EDG_WLL_GSS_ERROR_TIMEOUT: + edg_wll_SetError(ctx,ETIMEDOUT,"accepting notification"); + goto err; + default: + edg_wll_SetError(ctx, ENOTCONN, "failed to accept notification"); + goto err; } - + /* check time */ gettimeofday(&check_time,0); if (decrement_timeout(&tv, start_time, check_time)) {