From: Jan Pospíšil Date: Fri, 20 Jan 2006 10:33:32 +0000 (+0000) Subject: Really test if the connection to proxy is already open X-Git-Tag: glite-lb-client_R_2_1_2~3 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=039f45e242f1cd937bbc29d500e8237b15185ade;p=jra1mw.git Really test if the connection to proxy is already open --- diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index c681527..39359e5 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -204,12 +204,14 @@ int edg_wll_open_proxy(edg_wll_Context ctx) int flags; - if (!(ctx->connProxy->conn.sock == -1)) { - ctx->connProxy->conn.sock = socket(PF_UNIX, SOCK_STREAM, 0); - if (ctx->connProxy->conn.sock < 0) { - edg_wll_SetError(ctx, errno, "socket() error"); - goto err; - } + if (ctx->connProxy->conn.sock > -1) { + // XXX: test path socket here? + return edg_wll_Error(ctx,NULL,NULL); + } + ctx->connProxy->conn.sock = socket(PF_UNIX, SOCK_STREAM, 0); + if (ctx->connProxy->conn.sock < 0) { + edg_wll_SetError(ctx, errno, "socket() error"); + goto err; } memset(&saddr, 0, sizeof(saddr));