From bd0ef1fcd22c96596d8a442b79c62e40e884b578 Mon Sep 17 00:00:00 2001 From: Alex Graveley Date: Tue, 2 Oct 2001 00:52:54 +0000 Subject: [PATCH] Add defines for SOUP_PTRACE_ATTACH and SOUP_PTRACE_DETACH to remove 2001-10-01 Alex Graveley * src/libsoup/soup-socket-unix.c (soup_address_new): Add defines for SOUP_PTRACE_ATTACH and SOUP_PTRACE_DETACH to remove architecture incompatibilities for ptrace() arguments. * configure.in: Add libdl to OpenSSL LDFLAGS. Fix NSS header paths. Define HAVE_OPENSSL and HAVE_NSS if the libraries are found successfully. * src/libsoup/soup-socket.h: Remove soup_gethostbyname and soup_gethostbyaddr, and move to: * src/libsoup/soup-private.h: here. --- ChangeLog | 14 ++++++++++++++ configure.in | 11 +++++++---- libsoup/soup-private.h | 10 ++++++++++ libsoup/soup-socket-unix.c | 20 +++++++++++++++----- libsoup/soup-socket.h | 18 +----------------- 5 files changed, 47 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7afd307..3bec1e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2001-10-01 Alex Graveley + + * src/libsoup/soup-socket-unix.c (soup_address_new): Add defines + for SOUP_PTRACE_ATTACH and SOUP_PTRACE_DETACH to remove + architecture incompatibilities for ptrace() arguments. + + * configure.in: Add libdl to OpenSSL LDFLAGS. Fix NSS header + paths. Define HAVE_OPENSSL and HAVE_NSS if the libraries are + found successfully. + + * src/libsoup/soup-socket.h: Remove soup_gethostbyname and + soup_gethostbyaddr, and move to: + * src/libsoup/soup-private.h: here. + 2001-09-28 Alex Graveley * src/libsoup/soup-ntlm.c: Remove redundant alloca define. diff --git a/configure.in b/configure.in index 6b41246..868d291 100644 --- a/configure.in +++ b/configure.in @@ -320,9 +320,11 @@ enable_nss="no" if test "x$enable_ssl" = xyes; then save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$openssl_inc_prefix" + AC_CHECK_LIB(dl, dlopen, DL_LDFLAGS="-ldl", DL_LDFLAGS="") AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h, [OPENSSL_CFLAGS="$CPPFLAGS" - OPENSSL_LIBS="$openssl_prefix -lssl -lcrypto" + OPENSSL_LIBS="$openssl_prefix -lssl -lcrypto $DL_LDFLAGS" + AC_DEFINE(HAVE_OPENSSL) enable_openssl="yes"], [OPENSSL_CFLAGS="" OPENSSL_LIBS="" @@ -334,9 +336,10 @@ if test "x$enable_ssl" = xyes; then save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$nspr_inc_prefix $nss_inc_prefix" - AC_CHECK_HEADERS(prthread.h security/ssl.h security/pk11func.h, + AC_CHECK_HEADERS(nss.h ssl.h pk11func.h, [NSS_CFLAGS="$CPPFLAGS" NSS_LIBS="-lpthread $nspr_prefix -lnspr4 $nss_prefix -lnss3 -lssl3" + AC_DEFINE(HAVE_NSS) enable_nss="yes"], [NSS_CFLAGS="" NSS_LIBS="" @@ -376,7 +379,7 @@ dnl ********************************************* dnl *** Checks for gtk-doc (lifted from glib) *** dnl ********************************************* -AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) +AC_ARG_WITH(html-dir, [ --with-html-dir=PATH Path to installed docs ]) if test "x$with_html_dir" = "x" ; then HTML_DIR='${datadir}/gtk-doc/html' @@ -395,7 +398,7 @@ AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) dnl Let people disable the gtk-doc stuff. AC_ARG_ENABLE(gtk-doc, - [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], + [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) diff --git a/libsoup/soup-private.h b/libsoup/soup-private.h index 28ce0c9..2ec6f58 100644 --- a/libsoup/soup-private.h +++ b/libsoup/soup-private.h @@ -147,6 +147,16 @@ gint soup_substring_index (gchar *str, gchar *soup_base64_encode (const gchar *text, gint len); +/* from soup-socket.c */ + +gboolean soup_gethostbyname (const gchar *hostname, + struct sockaddr_in *sa, + gchar **nicename); + +gchar *soup_gethostbyaddr (const gchar *addr, + size_t length, + int type); + #ifdef __cplusplus } #endif diff --git a/libsoup/soup-socket-unix.c b/libsoup/soup-socket-unix.c index 95b6d5b..2854759 100644 --- a/libsoup/soup-socket-unix.c +++ b/libsoup/soup-socket-unix.c @@ -54,6 +54,16 @@ #include #endif +#ifndef PTRACE_ATTACH +# ifdef PT_ATTACH +# define SOUP_PTRACE_ATTACH PT_ATTACH +# define SOUP_PTRACE_DETACH PT_DETACH +# endif +#else +# define SOUP_PTRACE_ATTACH PTRACE_ATTACH +# define SOUP_PTRACE_DETACH PTRACE_DETACH +#endif + #ifndef socklen_t #define socklen_t size_t #endif @@ -673,10 +683,10 @@ soup_address_new (const gchar* name, case 0: close (pipes [0]); -#ifdef PTRACE_ATTACH +#ifdef SOUP_PTRACE_ATTACH signal (SIGCHLD, SIG_IGN); - if (ptrace (PTRACE_ATTACH, getppid (), NULL, NULL) == -1) { + if (ptrace (SOUP_PTRACE_ATTACH, getppid (), NULL, NULL) == -1) { /* * Attach failed; it's probably already being * debugged. @@ -687,19 +697,19 @@ soup_address_new (const gchar* name, _exit (1); } - + /* * Wait for the SIGSTOP from PTRACE_ATTACH to arrive at the * parent. */ waitpid (getppid (), NULL, 0); - if (ptrace (PTRACE_DETACH, getppid (), NULL, NULL) == -1) + if (ptrace (SOUP_PTRACE_DETACH, getppid (), NULL, NULL) == -1) g_warning ("ptrace: Detach failed: %s", strerror(errno)); kill (getppid(), SIGCONT); -#endif +#endif /*SOUP_PTRACE_ATTACH*/ /* * Try to get the host by name (ie, DNS) diff --git a/libsoup/soup-socket.h b/libsoup/soup-socket.h index dac4457..c1a6e5e 100644 --- a/libsoup/soup-socket.h +++ b/libsoup/soup-socket.h @@ -13,24 +13,8 @@ #ifndef SOUP_SOCKET_H #define SOUP_SOCKET_H 1 - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -#ifdef SOUP_WIN32 -#include -#endif - -#include - -gboolean soup_gethostbyname (const gchar *hostname, - struct sockaddr_in *sa, - gchar **nicename); -gchar *soup_gethostbyaddr (const gchar *addr, - size_t length, - int type); +#include typedef struct _SoupAddress SoupAddress; -- 2.7.4