Don't use s6_addr32 since it's apparently non-portable. Use s6_addr
authorDan Winship <danw@src.gnome.org>
Mon, 18 Nov 2002 15:26:19 +0000 (15:26 +0000)
committerDan Winship <danw@src.gnome.org>
Mon, 18 Nov 2002 15:26:19 +0000 (15:26 +0000)
* libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
since it's apparently non-portable. Use s6_addr instead.
(soup_gethostbyaddr): fix a sometimes-uninitialized variable.

* libsoup/soup-message.c (soup_message_get_request_header, etc):
Remove long-deprecated API.

* libsoup/soup-socket.c (soup_socket_connect): remove unused
variable.

* libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
* libsoup/soup-server.c (cgi_read): Likewise
* libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
Likewise.
* libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
* libsoup/soup-transfer.c (soup_transfer_read_cb,
soup_transfer_write_cb): Likewise.

ChangeLog
libsoup/soup-address.c
libsoup/soup-message.c
libsoup/soup-message.h
libsoup/soup-openssl.c
libsoup/soup-server.c
libsoup/soup-socket.c
libsoup/soup-socks.c
libsoup/soup-ssl-proxy.c
libsoup/soup-transfer.c

index bffa10e..0d4b91b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2002-11-18  Dan Winship  <danw@ximian.com>
+
+       * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
+       since it's apparently non-portable. Use s6_addr instead.
+       (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
+
+       * libsoup/soup-message.c (soup_message_get_request_header, etc):
+       Remove long-deprecated API.
+
+       * libsoup/soup-socket.c (soup_socket_connect): remove unused
+       variable.
+
+       * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
+       * libsoup/soup-server.c (cgi_read): Likewise
+       * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
+       Likewise.
+       * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
+       * libsoup/soup-transfer.c (soup_transfer_read_cb,
+       soup_transfer_write_cb): Likewise.
+
+       * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
+       instead of IPv4. (Tested on OS X.)
+
 2002-11-15  Dan Winship  <danw@ximian.com>
 
        * libsoup/*: Change old Helix Code refs to Ximian (and update
index f12b172..d134680 100644 (file)
@@ -376,10 +376,10 @@ soup_address_hash (const gpointer p)
                return ia->addr.in.s_addr;
 #ifdef HAVE_IPV6
        case AF_INET6:
-               return (ia->addr.in6.s6_addr32[0] ^
-                       ia->addr.in6.s6_addr32[1] ^
-                       ia->addr.in6.s6_addr32[2] ^
-                       ia->addr.in6.s6_addr32[3]);
+       {
+               guint32 *addr = (guint32 *)&(ia->addr.in6.s6_addr);
+               return (addr[0] ^ addr[1] ^ addr[2] ^ addr[3]);
+       }
 #endif
        default:
                return 0;
@@ -667,6 +667,8 @@ soup_gethostbyaddr (SoupAddress *ia)
 
        if (result)
                rv = g_strdup (result->h_name);
+       else
+               rv = NULL;
        if (buf)
                g_free (buf);
 #if defined(HAVE_GETHOSTBYNAME_R_GLIB_MUTEX)
index f30cfc5..5cb600f 100644 (file)
@@ -493,122 +493,6 @@ soup_message_foreach_remove_header (GHashTable        *hash,
 }
 
 /**
- * soup_message_set_request_header:
- * @req: a %SoupMessage.
- * @name: header name.
- * @value: header value.
- *
- * ** DEPRECATED **
- * 
- * Adds a new transport header to be sent on an outgoing request. Passing a NULL
- * @value will remove all headers with a name equal to @name.
- */
-void
-soup_message_set_request_header (SoupMessage *req,
-                                const gchar *name,
-                                const gchar *value) 
-{
-       g_return_if_fail (req != NULL);
-       g_return_if_fail (name != NULL || name [0] != '\0');
-
-       g_warning ("soup_message_set_request_header is DEPRECATED. Use "
-                  "soup_message_add_header, with msg->request_headers as "
-                  "the first argument.\n");
-
-       soup_message_add_header (req->request_headers, name, value);
-}
-
-/**
- * soup_message_get_request_header:
- * @req: a %SoupMessage.
- * @name: header name.
- * 
- * ** DEPRECATED **
- * 
- * Lookup the first transport request header with a key equal to @name.
- *
- * Return value: the header's value or NULL if not found.
- */
-const gchar *
-soup_message_get_request_header (SoupMessage *req,
-                                const gchar *name) 
-{
-       GSList *vals;
-       g_return_val_if_fail (req != NULL, NULL);
-       g_return_val_if_fail (name != NULL || name [0] != '\0', NULL);
-
-       g_warning ("soup_message_get_request_header is DEPRECATED. Use "
-                  "soup_message_get_header, with msg->request_headers as "
-                  "the first argument.\n");
-
-       if (req->request_headers) {
-               vals = g_hash_table_lookup (req->request_headers, name);
-               if (vals) 
-                       return vals->data;
-       }
-
-       return NULL;
-}
-
-/**
- * soup_message_set_response_header:
- * @req: a %SoupMessage.
- * @name: header name.
- * @value: header value.
- * 
- * ** DEPRECATED **
- * 
- * Adds a new transport header to be sent on an outgoing response. Passing a
- * NULL @value will remove all headers with a name equal to @name.
- */
-void
-soup_message_set_response_header (SoupMessage *req,
-                                 const gchar *name,
-                                 const gchar *value) 
-{
-       g_return_if_fail (req != NULL);
-       g_return_if_fail (name != NULL || name [0] != '\0');
-
-       g_warning ("soup_message_set_response_header is DEPRECATED. Use "
-                  "soup_message_add_header, with msg->response_headers as "
-                  "the first argument.\n");
-
-       soup_message_add_header (req->response_headers, name, value);
-}
-
-/**
- * soup_message_get_response_header:
- * @req: a %SoupMessage.
- * @name: header name.
- * 
- * ** DEPRECATED **
- * 
- * Lookup the transport response header with a key equal to @name.
- *
- * Return value: the header's value or NULL if not found.
- */
-const gchar *
-soup_message_get_response_header (SoupMessage *req,
-                                 const gchar *name) 
-{
-       GSList *vals;
-       g_return_val_if_fail (req != NULL, NULL);
-       g_return_val_if_fail (name != NULL || name [0] != '\0', NULL);
-
-       g_warning ("soup_message_get_response_header is DEPRECATED. Use "
-                  "soup_message_get_header, with msg->response_headers as "
-                  "the first argument.\n");
-
-       if (req->response_headers) {
-               vals = g_hash_table_lookup (req->response_headers, name);
-               if (vals) 
-                       return vals->data;
-       }
-
-       return NULL;
-}
-
-/**
  * soup_message_queue:
  * @req: a %SoupMessage.
  * @callback: a %SoupCallbackFn which will be called after the message completes
index 1e74b79..3441394 100644 (file)
@@ -222,24 +222,4 @@ void           soup_message_set_handler_error   (SoupMessage       *msg,
                                                 guint              errcode, 
                                                 const gchar       *errphrase);
 
-/** DEPRECATED API **/
-
-/** DEPRECATED **/
-void           soup_message_set_request_header  (SoupMessage       *req,
-                                                const gchar       *name,
-                                                const gchar       *value);
-
-/** DEPRECATED **/
-const gchar   *soup_message_get_request_header  (SoupMessage       *req,
-                                                const gchar       *name);
-
-/** DEPRECATED **/
-void           soup_message_set_response_header (SoupMessage       *req,
-                                                const gchar       *name,
-                                                const gchar       *value);
-
-/** DEPRECATED **/
-const gchar   *soup_message_get_response_header (SoupMessage       *req,
-                                                const gchar       *name);
-
 #endif /*SOUP_MESSAGE_H*/
index fb84a66..1589f44 100644 (file)
@@ -45,8 +45,8 @@ soup_openssl_free (GIOChannel *channel)
 static GIOStatus
 soup_openssl_read (GIOChannel   *channel,
                   gchar        *buf,
-                  guint         count,
-                  guint        *bytes_read,
+                  gsize         count,
+                  gsize        *bytes_read,
                   GError      **err)
 {
        SoupOpenSSLChannel *chan = (SoupOpenSSLChannel *) channel;
index 26a77c5..02d1046 100644 (file)
@@ -1001,7 +1001,7 @@ cgi_read (GIOChannel    *serv_chan,
        else {
                while (reader->recv_buf->len < reader->content_len) {
                        guchar read_buf [RESPONSE_BLOCK_SIZE];
-                       gint bytes_read;
+                       gsize bytes_read;
                        GIOError error;
 
                        error = g_io_channel_read (serv_chan,
index 47d5ad1..c563756 100644 (file)
@@ -112,7 +112,6 @@ soup_socket_connect (const gchar*        hostname,
                     gpointer            data)
 {
        SoupSocketConnectState* state;
-       SoupAddress *cached_addr;
 
        g_return_val_if_fail (hostname != NULL, NULL);
        g_return_val_if_fail (func != NULL, NULL);
index 93c1818..579f428 100644 (file)
@@ -82,7 +82,7 @@ soup_socks_write (GIOChannel* iochannel,
        gboolean finished = FALSE;
        guchar buf[128];
        gint len = 0, sa_len;
-       guint bytes_written;
+       gsize bytes_written;
        GIOError error;
 
        dest_uri = soup_context_get_uri (sd->dest_ctx);
@@ -175,7 +175,7 @@ soup_socks_read (GIOChannel* iochannel,
                 SoupSocksData *sd)
 {
        guchar buf[128];
-       guint bytes_read;
+       gsize bytes_read;
        GIOError error;
 
        error = g_io_channel_read (iochannel, buf, sizeof (buf), &bytes_read);
index 70d4bf7..8e1385b 100644 (file)
@@ -90,7 +90,7 @@ soup_ssl_proxy_readwrite (GIOChannel   *iochannel,
                          GIOChannel   *dest)
 {
        gchar read_buf [RESPONSE_BLOCK_SIZE];
-       gint bytes_read = 0, bytes_written = 0, write_total = 0;
+       gsize bytes_read = 0, bytes_written = 0, write_total = 0;
        GIOError error;
 
        error = g_io_channel_read (iochannel,
index cde14aa..fa9bb81 100644 (file)
@@ -411,7 +411,7 @@ soup_transfer_read_cb (GIOChannel   *iochannel,
                       SoupReader   *r)
 {
        gchar read_buf [RESPONSE_BLOCK_SIZE];
-       gint bytes_read = 0, total_read = 0;
+       gsize bytes_read = 0, total_read = 0;
        gboolean read_done = FALSE;
        gboolean cancelled = FALSE;
        GIOError error;
@@ -678,7 +678,7 @@ soup_transfer_write_cb (GIOChannel* iochannel,
 {
        GIOError error;
        gpointer pipe_handler;
-       guint bytes_written = 0;
+       gsize bytes_written = 0;
 
        /*
         * Get the header and first data chunk (if available).