Index: client/clinet.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/clinet.c,v retrieving revision 1.41 diff -u -r1.41 clinet.c --- client/clinet.c 2001/08/25 10:25:33 1.41 +++ client/clinet.c 2001/08/28 22:36:54 @@ -53,6 +53,10 @@ #include #endif +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif + #include "capstr.h" #include "fcintl.h" #include "game.h" @@ -312,6 +316,11 @@ char *server; int port; char str[512]; + char utsstring[128]; +#ifdef HAVE_SYS_UTSNAME_H + struct utsname un; + uname(&un); +#endif if ((proxy_url = getenv("http_proxy"))) { if (strncmp(proxy_url,"http://",strlen("http://"))) { @@ -378,13 +387,29 @@ my_closesocket(s); return NULL; } + +#ifdef HAVE_SYS_UTSNAME_H + my_snprintf(utsstring,sizeof(utsstring), + "%s %s [%s]", + un.sysname, + un.release, + un.machine); +#else /* ! HAVE_SYS_UTSNAME_H */ + /* Fill in here if you are making a binary without sys/utsname.h and know + the OS name, release number, and machine architechture */ + my_snprintf(utsstring,sizeof(utsstring), + "unknown unknown [unknown]"); +#endif /* HAVE_SYS_UTSNAME_H */ + my_snprintf(str,sizeof(str), - "GET %s%s%s HTTP/1.0\r\nUser-Agent: Freeciv/%s %s\r\n\r\n", + "GET %s%s%s HTTP/1.0\r\nUser-Agent: Freeciv/%s %s %s\r\n\r\n", proxy_url ? "" : "/", urlpath, proxy_url ? metaserver : "", VERSION_STRING, - client_string); + client_string, + utsstring); + #ifdef HAVE_FDOPEN f=fdopen(s,"r+"); fwrite(str,1,strlen(str),f);