diff options
author | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2001-01-19 12:39:37 +0000 |
---|---|---|
committer | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2001-01-19 12:39:37 +0000 |
commit | 299c6287735938bcdc8c59370562fe60316a9396 (patch) | |
tree | 2a229985a7c0427ca902d29a54d290ea2bd8bc9e /src/Sockets.c | |
parent | 8bd7c64bd7e9630f220e3b57277416814934f11d (diff) |
GetHostName() went into the flesh.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@115 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src/Sockets.c')
-rw-r--r-- | src/Sockets.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/src/Sockets.c b/src/Sockets.c index 5d93c77..367b439 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -11,6 +11,7 @@ @@*/ #include "cctk.h" +#include "util_Network.h" #include <stdio.h> #include <stdlib.h> @@ -93,8 +94,6 @@ static httpSocket *SocketCreate(unsigned long int filedes); static void SocketDestroy(httpSocket *this); static void SocketClose(httpSocket *this); -static void GetHostName(char *name, int length); - static int InitialiseTCP(void); /******************************************************************** @@ -154,7 +153,7 @@ int HTTP_SetupServer(int port, int queue_size, int hunt) } - GetHostName(hostname, 1024); + Util_GetHostName(hostname, 1024); httpport = hunt ? realport : port; @@ -696,50 +695,6 @@ static void SocketClose(httpSocket *this) } } - /*@@ - @routine GetHostName - @date Fri Oct 20 12:12:34 2000 - @author Tom Goodale - @desc - Gets the fully qualified name of this host if possible. - @enddesc - @calls - @calledby - @history - - @endhistory - @var name - @vdesc character buffer to store name in - @vtype char * - @vio out - @vcomment - - @endvar - @var length - @vdesc length of the character buffer - @vtype int - @vio in - @vcomment - - @endvar - -@@*/ -static void GetHostName(char *name, int length) -{ - gethostname(name, length); - - /* Does the name include the domain. */ - if(!strchr(name, '.')) - { -#ifdef HAVE_GETHOSTBYNAME - struct hostent *thishostent; - - thishostent = gethostbyname(name); - - strncpy(name, thishostent->h_name, length); -#endif - } -} /****************************************************************************** ****************************************************************************** |