diff options
author | Tor Lillqvist <tml@novell.com> | 2005-04-19 06:21:32 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-04-19 06:21:32 +0000 |
commit | a18fd89f6c9db048bdee8e9f8ccb506d0c7152d7 (patch) | |
tree | 632fbc7d0b5d57be5f3264dc7951900d8bcc85b5 /libsoup/soup-auth-digest.c | |
parent | c1c9e22042e1a4f8bfbdbb85ce91b6bcab00af52 (diff) | |
download | libsoup-a18fd89f6c9db048bdee8e9f8ccb506d0c7152d7.tar.gz |
Call AC_LIBTOOL_WIN32_DLL. Check for Win32, set Automake conditional
2005-04-18 Tor Lillqvist <tml@novell.com>
* configure.in: Call AC_LIBTOOL_WIN32_DLL. Check for Win32, set
Automake conditional OS_WIN32. Pre-cache information that we do
have getaddrinfo(), getnameinfo(), and IPv6 on Win32. (The tests
wouldn't notice as they don't include the necessary headers or
link with -lws2_32. Easiest to just pre-cache it.)
* libsoup-zip.in: New file, to build zipfile-based distribution of
libsoup for Win32.
* Makefile.am (EXTRA_DIST)
* configure.in (AC_OUTPUT): Add libsoup-zip(.in).
* libsoup/Makefile.am: Use -no-undefined on Win32. Link with
WinSock library -lws2_32.
* libsoup/soup-portability.h: New file. On Unix it includes the
traditional BSD socket etc headers. On Win32 it includes
winsock2.h and ws2tcpip.h.
* libsoup/*.c
* libsoup/*.h: Correspondingly, don't include the BSD socket API
headers directly.
* libsoup/soup-address.h
* libsoup/soup-dns.h: Include soup-portability.h
* libsoup/soup-address.c (soup_address_class_init): This function
should get called before libsoup uses the WinSock API, so this is
a good place to call WSAStartup().
* libsoup/soup-auth-digest.c (get_protection_space): Use
g_strsplit() instead of the relatively unportable strtok_r().
* libsoup/soun-dns.c: Remove unused headers. Implement
inet_pton() and inet_ntop() on Win32 using WSAStringToAddress()
and WSAAddressToString().
* libsoup/soup-socket.c (SOUP_CLOSE_SOCKET, SOUP_IS_SOCKET_ERROR,
SOUP_IS_INVALID_SOCKET, SOUP_IS_CONNECT_STATUS_INPROGRESS):
Portability macros.
(soup_socket_class_init): Call soup_address_get_type() to make
sure WSAStartup() gets called (through soup_address_class_init()).
(update_fdflags): Use ioctlsocket(FIONBIO) on Win32.
(soup_socket_write): Conditionalize SIGPIPE use.
* tests/get.c: mkdir() is different in Microsoft's C library.
* tests/simple-httpd.c: Rename TRY_AGAIN label to AGAIN to avoid
some clash with winsock2.h (which includes windows.h). The Win32
headers pollute the namespace wildly.
Diffstat (limited to 'libsoup/soup-auth-digest.c')
-rw-r--r-- | libsoup/soup-auth-digest.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libsoup/soup-auth-digest.c b/libsoup/soup-auth-digest.c index e54c262c..0397a280 100644 --- a/libsoup/soup-auth-digest.c +++ b/libsoup/soup-auth-digest.c @@ -196,7 +196,8 @@ get_protection_space (SoupAuth *auth, const SoupUri *source_uri) SoupAuthDigestPrivate *priv = SOUP_AUTH_DIGEST_GET_PRIVATE (auth); GSList *space = NULL; SoupUri *uri; - char *domain, *d, *lasts, *dir, *slash; + char **dvec, *d, *dir, *slash; + int dix; if (!priv->domain || !*priv->domain) { /* If no domain directive, the protection space is the @@ -205,8 +206,9 @@ get_protection_space (SoupAuth *auth, const SoupUri *source_uri) return g_slist_prepend (NULL, g_strdup ("")); } - domain = g_strdup (priv->domain); - for (d = strtok_r (domain, " ", &lasts); d; d = strtok_r (NULL, " ", &lasts)) { + dvec = g_strsplit (priv->domain, " ", 0); + for (dix = 0; dvec[dix] != NULL; dix++) { + d = dvec[dix]; if (*d == '/') dir = g_strdup (d); else { @@ -229,7 +231,7 @@ get_protection_space (SoupAuth *auth, const SoupUri *source_uri) space = g_slist_prepend (space, dir); } } - g_free (domain); + g_strfreev (dvec); return space; } |