From: Dan Winship Date: Mon, 18 Nov 2002 15:26:19 +0000 (+0000) Subject: Don't use s6_addr32 since it's apparently non-portable. Use s6_addr X-Git-Tag: LIBSOUP_1_99_15~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f2cb1e4fc74658efb5e8cc7126472dcc3c4dfe8;p=platform%2Fupstream%2Flibsoup.git Don't use s6_addr32 since it's apparently non-portable. Use s6_addr * 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. --- diff --git a/ChangeLog b/ChangeLog index bffa10e..0d4b91b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2002-11-18 Dan Winship + + * 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 * libsoup/*: Change old Helix Code refs to Ximian (and update diff --git a/libsoup/soup-address.c b/libsoup/soup-address.c index f12b172..d134680 100644 --- a/libsoup/soup-address.c +++ b/libsoup/soup-address.c @@ -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) diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c index f30cfc5..5cb600f 100644 --- a/libsoup/soup-message.c +++ b/libsoup/soup-message.c @@ -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 diff --git a/libsoup/soup-message.h b/libsoup/soup-message.h index 1e74b79..3441394 100644 --- a/libsoup/soup-message.h +++ b/libsoup/soup-message.h @@ -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*/ diff --git a/libsoup/soup-openssl.c b/libsoup/soup-openssl.c index fb84a66..1589f44 100644 --- a/libsoup/soup-openssl.c +++ b/libsoup/soup-openssl.c @@ -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; diff --git a/libsoup/soup-server.c b/libsoup/soup-server.c index 26a77c5..02d1046 100644 --- a/libsoup/soup-server.c +++ b/libsoup/soup-server.c @@ -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, diff --git a/libsoup/soup-socket.c b/libsoup/soup-socket.c index 47d5ad1..c563756 100644 --- a/libsoup/soup-socket.c +++ b/libsoup/soup-socket.c @@ -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); diff --git a/libsoup/soup-socks.c b/libsoup/soup-socks.c index 93c1818..579f428 100644 --- a/libsoup/soup-socks.c +++ b/libsoup/soup-socks.c @@ -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); diff --git a/libsoup/soup-ssl-proxy.c b/libsoup/soup-ssl-proxy.c index 70d4bf7..8e1385b 100644 --- a/libsoup/soup-ssl-proxy.c +++ b/libsoup/soup-ssl-proxy.c @@ -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, diff --git a/libsoup/soup-transfer.c b/libsoup/soup-transfer.c index cde14aa..fa9bb81 100644 --- a/libsoup/soup-transfer.c +++ b/libsoup/soup-transfer.c @@ -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).