summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2007-05-02 02:38:38 +0000
committerJames Bursa <james@netsurf-browser.org>2007-05-02 02:38:38 +0000
commit05474225342b64a751b1cc8bc61e81e8803b7079 (patch)
treef185f2b0d34d385f7d3ffa928b0424f3116abcb6 /utils
parent6e6d397e9d002a397103a3ec12cf1d1de4932028 (diff)
downloadnetsurf-05474225342b64a751b1cc8bc61e81e8803b7079.tar.gz
netsurf-05474225342b64a751b1cc8bc61e81e8803b7079.tar.bz2
Move user-agent generation into fetch.c and simplify.
svn path=/trunk/netsurf/; revision=3260
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.c32
-rw-r--r--utils/utils.h1
2 files changed, 0 insertions, 33 deletions
diff --git a/utils/utils.c b/utils/utils.c
index 54a3020ae..cfd7d68aa 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -16,7 +16,6 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <sys/utsname.h>
#include <sys/time.h>
#include <regex.h>
#include <time.h>
@@ -26,7 +25,6 @@
#include "netsurf/utils/messages.h"
#include "netsurf/utils/utf8.h"
#include "netsurf/utils/utils.h"
-#include "netsurf/desktop/netsurf.h"
char * strip(char * const s)
@@ -258,36 +256,6 @@ unsigned int wallclock(void)
return ((tv.tv_sec * 100) + (tv.tv_usec / 10000));
}
-/** Generate a string suitable for use as a user agent in HTTP requests.
- *
- * \return heap-allocated result string, or NULL if the allocation failed.
- */
-#define UA_BUF_SIZE 128
-char *make_useragent(void)
-{
- struct utsname un;
- char ua_name[UA_BUF_SIZE];
- char ua_machine[UA_BUF_SIZE];
- char *r;
-
- snprintf(ua_name, UA_BUF_SIZE, "NetSurf/%d.%d",
- netsurf_version_major,
- netsurf_version_minor);
-
- if (uname(&un) != 0) {
- strncpy(ua_machine, "unknown machine", UA_BUF_SIZE);
- } else {
- snprintf(ua_machine, UA_BUF_SIZE, "(%s; %s)", un.sysname,
- un.machine);
- }
-
- if ((r = malloc(strlen(ua_name) + strlen(ua_machine) + 2)) == NULL)
- return NULL;
-
- sprintf(r, "%s %s", ua_name, ua_machine);
-
- return r;
-}
#ifdef __FreeBSD__
diff --git a/utils/utils.h b/utils/utils.h
index bd7ab166e..d080bd018 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -59,7 +59,6 @@ const char *rfc1123_date(time_t t);
char *strcasestr(const char *haystack, const char *needle);
#endif
unsigned int wallclock(void);
-char *make_useragent(void);
#ifdef __FreeBSD__
/* FreeBSD lacks strndup */
char *strndup(const char *s, size_t n);