From 036f4307271078c0c6d724110dbbddd0b0d02fc0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 8 Sep 2010 13:17:58 +0000 Subject: [PATCH] dest_url support in notification client. --- org.glite.lb.client/src/notification.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.client/src/notification.c b/org.glite.lb.client/src/notification.c index d4d69f4..f243aac 100644 --- a/org.glite.lb.client/src/notification.c +++ b/org.glite.lb.client/src/notification.c @@ -191,7 +191,15 @@ static int get_client_address( hints.ai_socktype = SOCK_STREAM; if (address_override) { - + // complete dest URL ==> pass the URL furhter without listening + if (strstr(address_override, "//")) { + // close the socket if opened + if (ctx->notifSock >= 0) { + close(ctx->notifSock); + ctx->notifSock = -1; + } + } else { + get_name_and_port(address_override, &name, &port); e = getaddrinfo((const char *) name, NULL, &hints, & ai); @@ -252,7 +260,8 @@ static int get_client_address( if (my_bind(ctx, name, port, &(ctx->notifSock))) goto err; } - + } // complete URL + *address = strdup(address_override); } else { // address_override == NULL -- 1.8.2.3