Move RESPONSE_BLOCK_SIZE #define here from soup-private.h
authorDan Winship <danw@src.gnome.org>
Mon, 22 Sep 2003 20:10:45 +0000 (20:10 +0000)
committerDan Winship <danw@src.gnome.org>
Mon, 22 Sep 2003 20:10:45 +0000 (20:10 +0000)
* libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here
from soup-private.h

* libsoup/soup-misc.c (soup_load_config, etc): Remove all this.
(soup_set_security_policy, soup_get_security_policy): Remove,
since the GNUTLS backend doesn't actually implement it.
(soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise

* libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra
stuff.

* libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from
soup-private.h

* libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and
soup_ssl_get_server_iochannel into a single function that takes a
SoupSSLType.

* libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference.
(soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel.
(soup_gnutls_set_security_policy): Gone

* libsoup/soup-gnutls.h
* libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for
soup-gnutls.c now

* libsoup/soup-socket.c: Move soup_sockaddr_max
#define here from soup-private.h
(soup_socket_start_ssl): Update for new soup_ssl_get_iochannel
prototype.

* libsoup/soup-private.h: Gone

* libsoup/soup-address.c: Fix #includes for soup-private.h and
soup-misc.h changes
* libsoup/soup-auth-digest.c: Likewise
* libsoup/soup-auth.c: Likewise
* libsoup/soup-connection-ntlm.c: Likewise
* libsoup/soup-connection.c: Likewise
* libsoup/soup-dns.c: Likewise
* libsoup/soup-gnutls.c: Likewise
* libsoup/soup-headers.c: Likewise
* libsoup/soup-message-client-io.c: Likewise
* libsoup/soup-message-handlers.c: Likewise
* libsoup/soup-message-io.c: Likewise
* libsoup/soup-message-server-io.c: Likewise
* libsoup/soup-message.c: Likewise
* libsoup/soup-server-message.c: Likewise
* libsoup/soup-server.c: Likewise
* libsoup/soup-session.c: Likewise
* libsoup/soup-socket.c: Likewise
* tests/auth-test.c: Likewise

30 files changed:
ChangeLog
libsoup/Makefile.am
libsoup/soup-address.c
libsoup/soup-auth-basic.c
libsoup/soup-auth-digest.c
libsoup/soup-auth.c
libsoup/soup-connection-ntlm.c
libsoup/soup-connection.c
libsoup/soup-dns.c
libsoup/soup-gnutls.c
libsoup/soup-gnutls.h [deleted file]
libsoup/soup-headers.c
libsoup/soup-message-client-io.c
libsoup/soup-message-handlers.c
libsoup/soup-message-io.c
libsoup/soup-message-server-io.c
libsoup/soup-message.c
libsoup/soup-method.c
libsoup/soup-method.h
libsoup/soup-misc.c
libsoup/soup-misc.h
libsoup/soup-private.h [deleted file]
libsoup/soup-server-message.c
libsoup/soup-server.c
libsoup/soup-session.c
libsoup/soup-socket.c
libsoup/soup-ssl.c [deleted file]
libsoup/soup-ssl.h
libsoup/soup-types.h
tests/auth-test.c

index 0ab1cc9..0848ad4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,58 @@
+2003-09-22  Dan Winship  <danw@ximian.com>
+
+       * libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here
+       from soup-private.h
+
+       * libsoup/soup-misc.c (soup_load_config, etc): Remove all this.
+       (soup_set_security_policy, soup_get_security_policy): Remove,
+       since the GNUTLS backend doesn't actually implement it.
+       (soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise
+
+       * libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra
+       stuff.
+
+       * libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from
+       soup-private.h
+
+       * libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and
+       soup_ssl_get_server_iochannel into a single function that takes a
+       SoupSSLType.
+
+       * libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference.
+       (soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel.
+       (soup_gnutls_set_security_policy): Gone
+
+       * libsoup/soup-gnutls.h
+       * libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for
+       soup-gnutls.c now
+
+       * libsoup/soup-socket.c: Move soup_sockaddr_max
+       #define here from soup-private.h
+       (soup_socket_start_ssl): Update for new soup_ssl_get_iochannel
+       prototype.
+
+       * libsoup/soup-private.h: Gone
+       
+       * libsoup/soup-address.c: Fix #includes for soup-private.h and
+       soup-misc.h changes
+       * libsoup/soup-auth-digest.c: Likewise
+       * libsoup/soup-auth.c: Likewise
+       * libsoup/soup-connection-ntlm.c: Likewise
+       * libsoup/soup-connection.c: Likewise
+       * libsoup/soup-dns.c: Likewise
+       * libsoup/soup-gnutls.c: Likewise
+       * libsoup/soup-headers.c: Likewise
+       * libsoup/soup-message-client-io.c: Likewise
+       * libsoup/soup-message-handlers.c: Likewise
+       * libsoup/soup-message-io.c: Likewise
+       * libsoup/soup-message-server-io.c: Likewise
+       * libsoup/soup-message.c: Likewise
+       * libsoup/soup-server-message.c: Likewise
+       * libsoup/soup-server.c: Likewise
+       * libsoup/soup-session.c: Likewise
+       * libsoup/soup-socket.c: Likewise
+       * tests/auth-test.c: Likewise
+
 2003-09-19  Dan Winship  <danw@ximian.com>
 
        * libsoup/soup-address.c (update_address_from_entry): free the
index 48e34ce..735047f 100644 (file)
@@ -67,7 +67,6 @@ libsoup_2_2_la_SOURCES =              \
        soup-connection-ntlm.c          \
        soup-dns.h                      \
        soup-dns.c                      \
-       soup-gnutls.h                   \
        soup-gnutls.c                   \
        soup-headers.c                  \
        soup-md5-utils.h                \
@@ -82,14 +81,12 @@ libsoup_2_2_la_SOURCES =            \
        soup-message-server-io.c        \
        soup-method.c                   \
        soup-misc.c                     \
-       soup-private.h                  \
        soup-server.c                   \
        soup-server-auth.c              \
        soup-server-message.c           \
        soup-session.c                  \
        soup-socket.c                   \
        soup-ssl.h                      \
-       soup-ssl.c                      \
        soup-status.c                   \
        soup-uri.c
 
index 1570834..86c8db2 100644 (file)
 #include <netdb.h>
 #include <netinet/in.h>
 
-#include "soup-private.h"
 #include "soup-address.h"
 #include "soup-dns.h"
 #include "soup-marshal.h"
+#include "soup-misc.h"
 
 #include <unistd.h>
 #ifndef socklen_t
index a256fc5..68755aa 100644 (file)
@@ -15,7 +15,6 @@
 #include "soup-headers.h"
 #include "soup-message.h"
 #include "soup-misc.h"
-#include "soup-private.h"
 #include "soup-uri.h"
 
 static void construct (SoupAuth *auth, const char *header);
index c36cb2f..a125d12 100644 (file)
@@ -19,7 +19,6 @@
 #include "soup-md5-utils.h"
 #include "soup-message.h"
 #include "soup-misc.h"
-#include "soup-private.h"
 #include "soup-uri.h"
 
 static void construct (SoupAuth *auth, const char *header);
index 1f308b0..245c4a6 100644 (file)
@@ -14,7 +14,6 @@
 #include "soup-auth.h"
 #include "soup-auth-basic.h"
 #include "soup-auth-digest.h"
-#include "soup-private.h"
 
 #define PARENT_TYPE G_TYPE_OBJECT
 static GObjectClass *parent_class;
index e62b4e0..6724343 100644 (file)
@@ -13,7 +13,8 @@
 #include <string.h>
 
 #include "soup-connection-ntlm.h"
-#include "soup-private.h"
+#include "soup-message.h"
+#include "soup-misc.h"
 #include "soup-uri.h"
 
 void send_request (SoupConnection *conn, SoupMessage *req);
index 074fd7a..f6c2acb 100644 (file)
 #include <netinet/in.h>
 
 #include "soup-connection.h"
-#include "soup-private.h"
 #include "soup-marshal.h"
+#include "soup-message.h"
 #include "soup-misc.h"
 #include "soup-socket.h"
 #include "soup-ssl.h"
+#include "soup-uri.h"
 
 struct SoupConnectionPrivate {
        SoupSocket  *socket;
index 1c24548..710b9de 100644 (file)
@@ -23,7 +23,7 @@
 #include <netinet/in.h>
 
 #include "soup-dns.h"
-#include "soup-private.h"
+#include "soup-misc.h"
 
 #ifndef socklen_t
 #  define socklen_t int
index c037778..3f751ef 100644 (file)
@@ -21,7 +21,8 @@
 
 #include <gnutls/gnutls.h>
 
-#include "soup-gnutls.h"
+#include "soup-misc.h"
+#include "soup-ssl.h"
 
 #define DH_BITS 1024
 
@@ -374,9 +375,6 @@ get_credentials (SoupSSLType type)
                                           "(%s).", soup_get_ssl_ca_file ());
                                goto THROW_CREATE_ERROR;
                        }
-
-               if (soup_get_ssl_ca_dir ())
-                       g_warning ("CA directory not supported.");
        } else {
                const char *cert_file, *key_file;
 
@@ -423,7 +421,7 @@ get_credentials (SoupSSLType type)
 }
 
 GIOChannel *
-soup_gnutls_get_iochannel (GIOChannel *sock, SoupSSLType type)
+soup_ssl_get_iochannel (GIOChannel *sock, SoupSSLType type)
 {
        static gboolean initialized = FALSE;
        SoupGNUTLSChannel *chan = NULL;
@@ -522,17 +520,4 @@ soup_gnutls_get_iochannel (GIOChannel *sock, SoupSSLType type)
        return NULL;
 }
 
-void
-soup_gnutls_set_security_policy (SoupSecurityPolicy policy)
-{
-       switch (policy) {
-       case SOUP_SECURITY_DOMESTIC:
-               break;
-       case SOUP_SECURITY_EXPORT:
-               break;
-       case SOUP_SECURITY_FRANCE:
-               break;
-       }
-}
-
 #endif /* HAVE_GNUTLS_GNUTLS_H */
diff --git a/libsoup/soup-gnutls.h b/libsoup/soup-gnutls.h
deleted file mode 100644 (file)
index 8fbef14..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * soup-gnutls.h
- *
- * Authors:
- *      Ian Peters <itp@ximian.com>
- *
- * Copyright (C) 2003, Ximian, Inc.
- */
-
-#ifndef SOUP_GNUTLS_H
-#define SOUP_GNUTLS_H
-
-#include <glib.h>
-#include <libsoup/soup-ssl.h>
-#include <libsoup/soup-misc.h>
-
-GIOChannel *soup_gnutls_get_iochannel        (GIOChannel *sock,
-                                             SoupSSLType type);
-
-void        soup_gnutls_set_security_policy  (SoupSecurityPolicy policy);
-
-#endif /* SOUP_GNUTLS_H */
index 89a71d7..ee03aa9 100644 (file)
@@ -10,7 +10,7 @@
 #include <ctype.h>
 
 #include "soup-headers.h"
-#include "soup-private.h"
+#include "soup-misc.h"
 
 /*
  * "HTTP/1.1 200 OK\r\nContent-Length: 1234\r\n          567\r\n\r\n"
index 39cc728..ca5fdd7 100644 (file)
@@ -15,8 +15,7 @@
 #include "soup-message-private.h"
 #include "soup-auth.h"
 #include "soup-headers.h"
-#include "soup-misc.h"
-#include "soup-private.h"
+#include "soup-uri.h"
 
 static guint
 parse_response_headers (SoupMessage *req,
index 23b3558..b784028 100644 (file)
@@ -11,8 +11,6 @@
 
 #include "soup-message.h"
 #include "soup-message-private.h"
-#include "soup-misc.h"
-#include "soup-private.h"
 
 typedef enum {
        SOUP_HANDLER_HEADER = 1,
index 95766ca..770c3c2 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "soup-message.h"
 #include "soup-message-private.h"
-#include "soup-misc.h"
-#include "soup-private.h"
 #include "soup-socket.h"
 
 typedef enum {
@@ -68,6 +66,8 @@ typedef struct {
 #define SOUP_MESSAGE_IO_RETURN_IF_CANCELLED_OR_PAUSED cancelled = (msg->priv->io_data != io); g_object_unref (msg); if (cancelled || !io->read_tag || !io->write_tag) return; }
 #define SOUP_MESSAGE_IO_RETURN_VAL_IF_CANCELLED_OR_PAUSED(val) cancelled = (msg->priv->io_data != io); g_object_unref (msg); if (cancelled || !io->read_tag || !io->write_tag) return val; }
 
+#define RESPONSE_BLOCK_SIZE 8192
+
 void
 soup_message_io_cancel (SoupMessage *msg)
 {
index 64ffd7d..8a11442 100644 (file)
@@ -16,8 +16,6 @@
 #include "soup-address.h"
 #include "soup-auth.h"
 #include "soup-headers.h"
-#include "soup-misc.h"
-#include "soup-private.h"
 #include "soup-server-message.h"
 #include "soup-server.h"
 #include "soup-socket.h"
index 5db903d..ced536f 100644 (file)
@@ -12,7 +12,7 @@
 #include "soup-message.h"
 #include "soup-message-private.h"
 #include "soup-misc.h"
-#include "soup-private.h"
+#include "soup-uri.h"
 
 #define PARENT_TYPE G_TYPE_OBJECT
 static GObjectClass *parent_class;
index 06fe386..74af5f0 100644 (file)
@@ -2,9 +2,6 @@
 /*
  * soup-method.c: HTTP Method related processing.
  *
- * Authors:
- *      Alex Graveley (alex@ximian.com)
- *
  * Copyright (C) 2001-2002, Ximian, Inc.
  */
 
index 93a9c8d..0d0eff2 100644 (file)
@@ -1,10 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * soup-method.h: HTTP Method defines and related processing.
- *
- * Authors:
- *      Alex Graveley (alex@ximian.com)
- *
  * Copyright (C) 2001-2002, Ximian, Inc.
  */
 
index b5e81fb..63b77f6 100644 (file)
@@ -1,47 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * soup-misc.c: Miscellaneous settings and configuration file handling.
+ * soup-misc.c: Miscellaneous functions
 
  * Copyright (C) 2000-2003, Ximian, Inc.
  */
 
 #include <ctype.h>
 #include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
 
 #include "soup-misc.h"
-#include "soup-private.h"
-
-gboolean soup_initialized = FALSE;
-
-static SoupSecurityPolicy ssl_security_level = SOUP_SECURITY_DOMESTIC;
-
-/**
- * soup_set_security_policy:
- * @policy: the %SoupSecurityPolicy to use.
- *
- * Set the security policy for all secure SSL connections. The security policy
- * dictates which algorithms and encryption levels can be used in order to
- * conform to your country's security legislation.
- */
-void
-soup_set_security_policy (SoupSecurityPolicy policy)
-{
-       ssl_security_level = policy;
-}
-
-/**
- * soup_get_security_policy:
- *
- * Return value: The security policy to use for secure SSL connections.
- */
-SoupSecurityPolicy
-soup_get_security_policy (void)
-{
-       return ssl_security_level;
-}
-
 
 guint
 soup_str_case_hash (gconstpointer key)
@@ -60,8 +27,8 @@ gboolean
 soup_str_case_equal (gconstpointer v1,
                     gconstpointer v2)
 {
-       const gchar *string1 = v1;
-       const gchar *string2 = v2;
+       const char *string1 = v1;
+       const char *string2 = v2;
 
        return g_strcasecmp (string1, string2) == 0;
 }
@@ -229,8 +196,8 @@ soup_base64_encode_step (const guchar  *in,
  *
  * Return value: The Base-64 encoded string representing @text.
  */
-gchar *
-soup_base64_encode (const gchar *text, gint inlen)
+char *
+soup_base64_encode (const char *text, int inlen)
 {
         unsigned char *out;
         int state = 0, outlen;
@@ -330,12 +297,12 @@ soup_base64_decode_step (const guchar  *in,
        return outptr - out;
 }
 
-gchar *
-soup_base64_decode (const gchar   *text,
-                   gint          *out_len)
+char *
+soup_base64_decode (const char   *text,
+                   int          *out_len)
 {
-       gchar *ret;
-       gint inlen, state = 0, save = 0;
+       char *ret;
+       int inlen, state = 0, save = 0;
 
        inlen = strlen (text);
        ret = g_malloc0 (inlen);
@@ -345,238 +312,7 @@ soup_base64_decode (const gchar   *text,
        return ret; 
 }
 
-#define ALLOW_UNLESS_DENIED TRUE
-#define DENY_UNLESS_ALLOWED FALSE
-
-static gboolean allow_policy = ALLOW_UNLESS_DENIED;
-static GSList *allow_tokens = NULL;
-static GSList *deny_tokens = NULL;
-
-static void
-soup_config_security_policy (gchar *key, gchar *value)
-{
-       switch (toupper (value [0])) {
-       case 'D':
-               if (!g_strcasecmp (&value [1], "OMESTIC"))
-                       soup_set_security_policy (SOUP_SECURITY_DOMESTIC);
-               break;
-       case 'E':
-               if (!g_strcasecmp (&value [1], "XPORT"))
-                       soup_set_security_policy (SOUP_SECURITY_EXPORT);
-               break;
-       case 'F':
-               if (!g_strcasecmp (&value [1], "RANCE"))
-                       soup_set_security_policy (SOUP_SECURITY_FRANCE);
-               break;
-       }
-}
-
-static void
-soup_config_ssl_ca_file (gchar *key, gchar *value)
-{
-       soup_set_ssl_ca_file (value);
-}
-
-static void
-soup_config_ssl_ca_directory (gchar *key, gchar *value)
-{
-       soup_set_ssl_ca_dir (value);
-}
-
-static void
-soup_config_ssl_certificate (gchar *key, gchar *value)
-{
-       gint idx;
-
-       idx = strcspn (value, " \t");
-       if (!idx) return;
-       
-       value [idx] = '\0';
-
-       idx += strspn (value + idx + 1, " \t");
-       if (!idx) return;
-
-       soup_set_ssl_cert_files (value, value + idx);
-}
-
-typedef void (*SoupConfigFunc) (gchar *key, gchar *value);
-
-struct SoupConfigFuncs {
-       gchar          *key;
-       SoupConfigFunc  func;
-} soup_config_funcs [] = {
-       { "security-policy",  soup_config_security_policy },
-       { "ssl-ca-file",      soup_config_ssl_ca_file },
-       { "ssl-ca-directory", soup_config_ssl_ca_directory },
-       { "ssl-certificate",  soup_config_ssl_certificate },
-       { NULL }
-};
-
-static void
-soup_config_reset_allow_deny (void)
-{
-       GSList *iter;
-
-       for (iter = allow_tokens; iter; iter = iter->next) g_free (iter->data);
-       for (iter = deny_tokens; iter; iter = iter->next) g_free (iter->data);
-
-       g_slist_free (allow_tokens);
-       g_slist_free (deny_tokens);
-
-       allow_tokens = deny_tokens = NULL;
-}
-
-static gboolean
-soup_config_allow_deny (gchar *key)
-{
-       GSList **list;
-       gchar **iter, **split;
-
-       key = g_strchomp (key);
-
-       if (!g_strncasecmp (key, "allow", 5)) list = &allow_tokens;
-       else if (!g_strncasecmp (key, "deny", 4)) list = &deny_tokens;
-       else return FALSE;
-
-       iter = split = g_strsplit (key, " ", 0);
-       if (!split || !split [1]) return TRUE;
-
-       while (*(++iter)) {
-               if (!g_strcasecmp (iter [0], "all")) {
-                       GSList *iter;
-                       allow_policy = (*list == allow_tokens);
-                       for (iter = *list; iter; iter = iter->next)
-                               g_free (iter->data);
-                       g_slist_free (*list);
-                       *list = NULL;
-                       *list = g_slist_prepend (*list, NULL);
-                       break;
-               }
-
-               *list = g_slist_prepend (*list, g_strdup (iter [0]));
-       }
-
-       g_strfreev (split);
-       return TRUE;
-}
-
-static gboolean
-soup_config_token_allowed (gchar *key)
-{
-       gboolean allow;
-       GSList *list;
-
-       list = (allow_policy == ALLOW_UNLESS_DENIED) ? deny_tokens:allow_tokens;
-       allow = (allow_policy == ALLOW_UNLESS_DENIED) ? TRUE : FALSE;
-
-       if (!list) return allow;
-
-       for (; list; list = list->next)
-               if (!list->data ||
-                   !g_strncasecmp (key,
-                                   (gchar *) list->data,
-                                   strlen ((gchar *) list->data)))
-                       return !allow;
-
-       return allow;
-}
-
-static void
-soup_load_config_internal (gchar *config_file, gboolean admin)
-{
-       struct SoupConfigFuncs *funcs;
-       FILE *cfg;
-       char buf[128];
-
-       cfg = fopen (config_file, "r");
-       if (!cfg) return;
-
-       if (admin) soup_config_reset_allow_deny();
-
-       while (fgets (buf, sizeof (buf), cfg)) {
-               char *key, *value, *iter, *iter2, **split;
-
-               iter = g_strstrip (buf);
-               if (!*iter || *iter == '#') continue;
-
-               iter2 = strchr (iter, '#');
-               if (iter2) *iter2 = '\0';
-
-               if (admin && soup_config_allow_deny (iter)) continue;
-
-               if (!admin && !soup_config_token_allowed (iter)) {
-                       g_warning ("Configuration item \"%s\" in file \"%s\" "
-                                  "disallowed by system configuration.\n",
-                                  iter,
-                                  config_file);
-                       continue;
-               }
-
-               split = g_strsplit (g_strchomp (iter), "=", 2);
-
-               if (!split) continue;
-               if (!split[1] || split[2]) {
-                       g_strfreev (split);
-                       continue;
-               }
-
-               key = g_strchomp (split[0]);
-               value = g_strchug (split[1]);
-
-               for (funcs = soup_config_funcs; funcs && funcs->key; funcs++)
-                       if (!g_strcasecmp (key, funcs->key)) {
-                               funcs->func (key, value);
-                               break;
-                       }
-
-               g_strfreev (split);
-       }
-}
-
-/**
- * soup_load_config:
- * @config_file: The file to load configuration from. If NULL, load from .souprc
- * in user's home directory.
- *
- * Load the Soup configuration from file. First attempt to load the system
- * configuration from SYSCONFDIR/souprc, then from either the config file name
- * passed in config_file, or from .souprc in the user's home directory.
- *
- * The first time a message is sent using Soup, the configuration is loaded from
- * the system souprc file, and the user's souprc file.
- *
- * soup_load_config can be called multiple times. Each time settings will be
- * reset and reread from scratch.
- */
-void
-soup_load_config (gchar *config_file)
-{
-       /* Reset values */
-       if (soup_initialized) {
-               soup_set_security_policy (SOUP_SECURITY_DOMESTIC);
-       }
-
-#ifdef SYSCONFDIR
-       /* Load system global config */
-       soup_load_config_internal (SYSCONFDIR G_DIR_SEPARATOR_S "souprc",
-                                  TRUE);
-#endif
-
-       /* Load requested file or user local config */
-       if (!config_file) {
-               gchar *dfile = g_strconcat (g_get_home_dir(),
-                                           G_DIR_SEPARATOR_S ".souprc",
-                                           NULL);
-               soup_load_config_internal (dfile, FALSE);
-               g_free (dfile);
-       } else
-               soup_load_config_internal (config_file, FALSE);
-
-       soup_initialized = TRUE;
-}
-
 static char *ssl_ca_file   = NULL;
-static char *ssl_ca_dir    = NULL;
 static char *ssl_cert_file = NULL;
 static char *ssl_key_file  = NULL;
 
@@ -588,7 +324,7 @@ static char *ssl_key_file  = NULL;
  * peers.
  */
 void
-soup_set_ssl_ca_file (const gchar *ca_file)
+soup_set_ssl_ca_file (const char *ca_file)
 {
        g_free (ssl_ca_file);
 
@@ -596,21 +332,6 @@ soup_set_ssl_ca_file (const gchar *ca_file)
 }
 
 /**
- * soup_set_ca_dir
- * @ca_dir: the directory containing CA certificate files
- *
- * Specify a directory containing CA certificates to be used to verify
- * peers.
- */
-void
-soup_set_ssl_ca_dir (const gchar *ca_dir)
-{
-       g_free (ssl_ca_dir);
-
-       ssl_ca_dir = g_strdup (ca_dir);
-}
-
-/**
  * soup_set_ssl_cert_files
  * @cert_file: the file containing the SSL client certificate
  * @key_file: the file containing the SSL private key
@@ -619,7 +340,7 @@ soup_set_ssl_ca_dir (const gchar *ca_dir)
  * authentication with the HTTP server
  */
 void
-soup_set_ssl_cert_files (const gchar *cert_file, const gchar *key_file)
+soup_set_ssl_cert_files (const char *cert_file, const char *key_file)
 {
        g_free (ssl_cert_file);
        g_free (ssl_key_file);
@@ -641,18 +362,6 @@ soup_get_ssl_ca_file (void)
 }
 
 /**
- * soup_get_ca_dir
- *
- * Return value: A directory containing CA certificates to be used to verify
- * peers.
- */
-const char *
-soup_get_ssl_ca_dir (void)
-{
-       return ssl_ca_dir;
-}
-
-/**
  * soup_get_ssl_cert_files
  * @cert_file: the file containing the SSL client certificate
  * @key_file: the file containing the SSL private key
@@ -661,7 +370,7 @@ soup_get_ssl_ca_dir (void)
  * authentication with the HTTP server
  */
 void
-soup_get_ssl_cert_files (const gchar **cert_file, const gchar **key_file)
+soup_get_ssl_cert_files (const char **cert_file, const char **key_file)
 {
        if (cert_file)
                *cert_file = ssl_cert_file;
index e67d409..5855ddd 100644 (file)
@@ -6,77 +6,56 @@
 #ifndef SOUP_MISC_H
 #define SOUP_MISC_H 1
 
-#include <glib.h>
-#include <libsoup/soup-message.h>
-#include <libsoup/soup-uri.h>
-
-/* Configuration routines */
-
-void               soup_load_config          (gchar       *config_file);
-
-typedef enum {
-       SOUP_SECURITY_DOMESTIC = 1,
-       SOUP_SECURITY_EXPORT   = 2,
-       SOUP_SECURITY_FRANCE   = 3
-} SoupSecurityPolicy;
-
-void               soup_set_security_policy  (SoupSecurityPolicy policy);
-
-SoupSecurityPolicy soup_get_security_policy  (void);
+#include <glib-object.h>
 
 /* SSL setup routines */
 
-void               soup_set_ssl_ca_file      (const gchar *ca_file);
-
-void               soup_set_ssl_ca_dir       (const gchar *ca_dir);
+void               soup_set_ssl_ca_file      (const char   *ca_file);
 
-void               soup_set_ssl_cert_files   (const gchar *cert_file, 
-                                             const gchar *key_file);
+void               soup_set_ssl_cert_files   (const char   *cert_file, 
+                                             const char   *key_file);
 
 const char        *soup_get_ssl_ca_file      (void);
-const char        *soup_get_ssl_ca_dir       (void);
-void               soup_get_ssl_cert_files   (const gchar **cert_file,
-                                             const gchar **key_file);
+void               soup_get_ssl_cert_files   (const char  **cert_file,
+                                             const char  **key_file);
 
 /* Base64 encoding/decoding */
 
-gchar             *soup_base64_encode          (const gchar    *text,
-                                               gint            len);
+char              *soup_base64_encode        (const char   *text,
+                                             int           len);
 
-int                soup_base64_encode_close    (const guchar   *in, 
-                                               int             inlen, 
-                                               gboolean        break_lines, 
-                                               guchar         *out, 
-                                               int            *state, 
-                                               int            *save);
+int                soup_base64_encode_close  (const guchar *in, 
+                                             int           inlen, 
+                                             gboolean      break_lines, 
+                                             guchar       *out, 
+                                             int          *state, 
+                                             int          *save);
 
-int                soup_base64_encode_step     (const guchar   *in, 
-                                               int             len, 
-                                               gboolean        break_lines, 
-                                               guchar         *out, 
-                                               int            *state, 
-                                               int            *save);
+int                soup_base64_encode_step   (const guchar *in, 
+                                             int           len, 
+                                             gboolean      break_lines, 
+                                             guchar       *out, 
+                                             int          *state, 
+                                             int          *save);
 
-gchar             *soup_base64_decode          (const gchar    *text,
-                                               gint           *out_len);
+char              *soup_base64_decode        (const gchar  *text,
+                                             int          *out_len);
 
-int                soup_base64_decode_step     (const guchar   *in, 
-                                               int             len, 
-                                               guchar         *out, 
-                                               int            *state, 
-                                               guint          *save);
+int                soup_base64_decode_step   (const guchar *in, 
+                                             int           len, 
+                                             guchar       *out, 
+                                             int          *state, 
+                                             guint        *save);
 
 /* Misc utils */
 
-guint              soup_signal_connect_once   (gpointer         instance,
-                                              const char *     signal,
-                                              GCallback        c_handler,
-                                              gpointer         data);
-
-/* Useful debugging routines */
-
-void               soup_debug_print_headers  (SoupMessage *req);
+guint              soup_signal_connect_once  (gpointer      instance,
+                                             const char   *signal,
+                                             GCallback     c_handler,
+                                             gpointer      data);
 
-void               soup_debug_print_uri      (SoupUri     *uri);
+guint              soup_str_case_hash        (gconstpointer key);
+gboolean           soup_str_case_equal       (gconstpointer v1,
+                                             gconstpointer v2);
 
 #endif /* SOUP_MISC_H */
diff --git a/libsoup/soup-private.h b/libsoup/soup-private.h
deleted file mode 100644 (file)
index 32ce8da..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2000-2003, Ximian, Inc.
- */
-
-#ifndef SOUP_PRIVATE_H
-#define SOUP_PRIVATE_H 1
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <libsoup/soup-types.h>
-#include <libsoup/soup-auth.h>
-#include <libsoup/soup-misc.h>
-
-#define RESPONSE_BLOCK_SIZE 8192
-
-extern gboolean    soup_initialized;
-
-#ifdef HAVE_IPV6
-#define soup_sockaddr_max sockaddr_in6
-#else
-#define soup_sockaddr_max sockaddr_in
-#endif
-
-/* from soup-misc.c */
-
-guint     soup_str_case_hash   (gconstpointer  key);
-gboolean  soup_str_case_equal  (gconstpointer  v1,
-                               gconstpointer  v2);
-
-#define SOUP_MAKE_TYPE(l,t,ci,i,parent) \
-GType l##_get_type(void)\
-{\
-       static GType type = 0;                          \
-       if (!type){                                     \
-               static GTypeInfo const object_info = {  \
-                       sizeof (t##Class),              \
-                                                       \
-                       (GBaseInitFunc) NULL,           \
-                       (GBaseFinalizeFunc) NULL,       \
-                                                       \
-                       (GClassInitFunc) ci,            \
-                       (GClassFinalizeFunc) NULL,      \
-                       NULL,   /* class_data */        \
-                                                       \
-                       sizeof (t),                     \
-                       0,      /* n_preallocs */       \
-                       (GInstanceInitFunc) i,          \
-               };                                      \
-               type = g_type_register_static (parent, #t, &object_info, 0); \
-       }                                               \
-       return type;                                    \
-}
-
-#endif /*SOUP_PRIVATE_H*/
index f55e680..24bb959 100644 (file)
@@ -15,7 +15,6 @@
 #include <unistd.h>
 
 #include "soup-server-message.h"
-#include "soup-private.h"
 #include "soup-server.h"
 
 struct SoupServerMessagePrivate {
index 3ce34d6..b3b4475 100644 (file)
@@ -21,7 +21,6 @@
 #include "soup-server.h"
 #include "soup-address.h"
 #include "soup-headers.h"
-#include "soup-private.h"
 #include "soup-server-auth.h"
 #include "soup-server-message.h"
 #include "soup-socket.h"
index 88c9d58..2e0e978 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
+#include "soup-auth.h"
 #include "soup-session.h"
 #include "soup-connection.h"
 #include "soup-connection-ntlm.h"
 #include "soup-marshal.h"
 #include "soup-message-queue.h"
-#include "soup-private.h"
+#include "soup-uri.h"
 
 typedef struct {
        SoupUri    *root_uri;
index c93a93f..8939ff2 100644 (file)
@@ -16,9 +16,9 @@
 #include <unistd.h>
 
 #include "soup-address.h"
-#include "soup-private.h"
 #include "soup-socket.h"
 #include "soup-marshal.h"
+#include "soup-misc.h"
 #include "soup-ssl.h"
 
 #include <sys/types.h>
@@ -58,6 +58,12 @@ struct SoupSocketPrivate {
 #define SOUP_SOCKET_CLEAR_FLAG(sock, flag) (sock)->priv->flags &= ~(flag)
 #define SOUP_SOCKET_CHECK_FLAG(sock, flag) ((sock)->priv->flags & (flag))
 
+#ifdef HAVE_IPV6
+#define soup_sockaddr_max sockaddr_in6
+#else
+#define soup_sockaddr_max sockaddr_in
+#endif
+
 static void
 init (GObject *object)
 {
@@ -481,10 +487,10 @@ soup_socket_start_ssl (SoupSocket *sock)
        GIOChannel *chan;
 
        chan = get_iochannel (sock);
-       sock->priv->iochannel =
+       sock->priv->iochannel = soup_ssl_get_iochannel (
+               sock->priv->iochannel,
                SOUP_SOCKET_CHECK_FLAG (sock, SOUP_SOCKET_FLAG_SERVER) ?
-               soup_ssl_get_server_iochannel (chan) :
-               soup_ssl_get_iochannel (chan);
+               SOUP_SSL_TYPE_SERVER : SOUP_SSL_TYPE_CLIENT);
        SOUP_SOCKET_SET_FLAG (sock, SOUP_SOCKET_FLAG_SSL);
 }
        
diff --git a/libsoup/soup-ssl.c b/libsoup/soup-ssl.c
deleted file mode 100644 (file)
index 27c11e5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * soup-queue.c: Asyncronous Callback-based HTTP Request Queue.
- *
- * Authors:
- *      Alex Graveley (alex@ximian.com)
- *
- * Copyright (C) 2001-2002, Ximian, Inc.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "soup-gnutls.h"
-#include "soup-ssl.h"
-
-#ifdef HAVE_SSL
-GIOChannel *
-soup_ssl_get_iochannel (GIOChannel *sock)
-{
-       return soup_gnutls_get_iochannel (sock, SOUP_SSL_TYPE_CLIENT);
-}
-
-GIOChannel *
-soup_ssl_get_server_iochannel (GIOChannel *sock)
-{
-       return soup_gnutls_get_iochannel (sock, SOUP_SSL_TYPE_SERVER);
-}
-#endif /* HAVE_SSL */
index 8feecc6..3480d35 100644 (file)
@@ -1,11 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * soup-queue.c: Asyncronous Callback-based HTTP Request Queue.
- *
- * Authors:
- *      Alex Graveley (alex@ximian.com)
- *
- * Copyright (C) 2000-2002, Ximian, Inc.
+ * Copyright (C) 2000-2003, Ximian, Inc.
  */
 
 #ifndef SOUP_SSL_H
@@ -18,7 +13,6 @@ typedef enum {
        SOUP_SSL_TYPE_SERVER
 } SoupSSLType;
 
-GIOChannel *soup_ssl_get_iochannel (GIOChannel *sock);
-GIOChannel *soup_ssl_get_server_iochannel (GIOChannel *sock);
+GIOChannel *soup_ssl_get_iochannel (GIOChannel *sock, SoupSSLType type);
 
 #endif /* SOUP_SSL_H */
index 6ae8801..17842be 100644 (file)
@@ -22,4 +22,28 @@ typedef struct SoupSession           SoupSession;
 typedef struct SoupSocket            SoupSocket;
 typedef struct SoupUri               SoupUri;
 
+#define SOUP_MAKE_TYPE(l,t,ci,i,parent) \
+GType l##_get_type(void)\
+{\
+       static GType type = 0;                          \
+       if (!type){                                     \
+               static GTypeInfo const object_info = {  \
+                       sizeof (t##Class),              \
+                                                       \
+                       (GBaseInitFunc) NULL,           \
+                       (GBaseFinalizeFunc) NULL,       \
+                                                       \
+                       (GClassInitFunc) ci,            \
+                       (GClassFinalizeFunc) NULL,      \
+                       NULL,   /* class_data */        \
+                                                       \
+                       sizeof (t),                     \
+                       0,      /* n_preallocs */       \
+                       (GInstanceInitFunc) i,          \
+               };                                      \
+               type = g_type_register_static (parent, #t, &object_info, 0); \
+       }                                               \
+       return type;                                    \
+}
+
 #endif
index 9271b38..151a281 100644 (file)
@@ -4,7 +4,6 @@
 
 #include "libsoup/soup.h"
 #include "libsoup/soup-auth.h"
-#include "libsoup/soup-private.h"
 #include "libsoup/soup-session.h"
 
 int errors = 0;