From 25248090dba6b3121ee822594cc28d8ee18092e5 Mon Sep 17 00:00:00 2001 From: jshalf Date: Wed, 30 Jan 2002 19:48:56 +0000 Subject: Minor mods to announce selected http port number when hunting is on. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@152 1faa4e14-9dd3-4be0-9f0e-ffe519881164 --- src/Sockets.c | 2 +- src/Startup.c | 6 ++++-- src/httpd.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Sockets.c b/src/Sockets.c index 38a5ced..0eebf89 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -175,7 +175,7 @@ int HTTP_SetupServer(int port, int queue_size, int hunt) signal(SIGPIPE,SIG_IGN); #endif - return 0; + return httpport; /* return the actual port here */ } /*@@ diff --git a/src/Startup.c b/src/Startup.c index f29037a..5c2928f 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -83,12 +83,14 @@ static int thread_started = 0; @endhistory @@*/ + +static int http_actualport=5555; /* bad bad static var (should use GH) */ int HTTP_Startup(void) { DECLARE_CCTK_PARAMETERS httpState state; - + http_actualport=port; if(CCTK_MyProc(NULL) == 0) { /* Does the server provide any pages by default ? */ @@ -97,7 +99,7 @@ int HTTP_Startup(void) HTTP_RegisterPages(); } - HTTP_SetupServer(port, queue_length, hunt); + http_actualport = HTTP_SetupServer(port, queue_length, hunt); } /* Do we need to redirect to a master server ? */ diff --git a/src/httpd.h b/src/httpd.h index ccdb967..03a9fe6 100644 --- a/src/httpd.h +++ b/src/httpd.h @@ -21,6 +21,8 @@ typedef struct int timeout_seconds; int timeout_useconds; } httpState; + +extern int http_actualport; #ifdef __cplusplus extern "C" -- cgit v1.2.3