From 039f45e242f1cd937bbc29d500e8237b15185ade Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Posp=C3=AD=C5=A1il?= Date: Fri, 20 Jan 2006 10:33:32 +0000 Subject: [PATCH] Really test if the connection to proxy is already open --- org.glite.lb.client/src/connection.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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)); -- 1.8.2.3