diff options
Diffstat (limited to 'src/Sockets.c')
-rw-r--r-- | src/Sockets.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/Sockets.c b/src/Sockets.c index 729e323..38a5ced 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -11,7 +11,6 @@ @@*/ #include "cctk.h" -#include "cctk_Parameters.h" #include "util_Network.h" #include <stdio.h> @@ -77,10 +76,6 @@ CCTK_FILEVERSION(CactusConnect_HTTPD_Sockets_c) #define MSG_NOSIGNAL 0 #endif -/* HTML filename to take the server URL */ -#define SERVER_URL_FILENAME "server_url.html" - - typedef enum {closed, open} httpSocketState; typedef struct HTTPSocket @@ -141,18 +136,16 @@ static unsigned long int httpport = 0; @endhistory @@*/ -int HTTP_SetupServer(int which_port, int queue_size, int which_hunt) +int HTTP_SetupServer(int port, int queue_size, int hunt) { char hostname[1025]; int realport; - DECLARE_CCTK_PARAMETERS - /* Some systems need special logic for starting up TCP. */ InitialiseTCP(); /* Create the socket and set it up to accept connections. */ - sock = HTTP_MakeSocket (which_port, which_hunt ? &realport : NULL); + sock = HTTP_MakeSocket (port, hunt ? &realport : NULL); if (ERROR_CHECK(listen (sock, queue_size))) { @@ -163,27 +156,9 @@ int HTTP_SetupServer(int which_port, int queue_size, int which_hunt) Util_GetHostName(hostname, 1024); - httpport = which_hunt ? realport : which_port; + httpport = hunt ? realport : port; printf("Server started on http://%s:%lu/\n", hostname, httpport); - if (announce_server_url) - { - char *filename; - FILE *file; - - - CCTK_CreateDirectory (0755, announce_server_url_outdir); - filename = (char *) malloc (strlen (announce_server_url_outdir) + 20); - sprintf (filename, "%s/%s", announce_server_url_outdir, SERVER_URL_FILENAME); - file = fopen (filename, "w"); - if (file) - { - fprintf (file, "HTTPD server started on <A HREF=\"http://%s:%lu\">http://%s:%lu</A>", - HTTP_Master (), (unsigned int) HTTP_Port (), HTTP_Master (), (unsigned int) HTTP_Port ()); - fclose (file); - } - free (filename); - } minsock = sock; maxsock = sock; |