From 299c6287735938bcdc8c59370562fe60316a9396 Mon Sep 17 00:00:00 2001 From: tradke Date: Fri, 19 Jan 2001 12:39:37 +0000 Subject: GetHostName() went into the flesh. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@115 1faa4e14-9dd3-4be0-9f0e-ffe519881164 --- src/Sockets.c | 49 ++----------------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) (limited to 'src/Sockets.c') 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 #include @@ -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 - } -} /****************************************************************************** ****************************************************************************** -- cgit v1.2.3