diff -Naur telepathy-salut-0.3.6.old/configure telepathy-salut-0.3.6/configure --- telepathy-salut-0.3.6.old/configure 2008-12-02 17:08:51.000000000 +0000 +++ telepathy-salut-0.3.6/configure 2009-01-02 21:38:56.000000000 +0000 @@ -23631,12 +23631,12 @@ pkg_cv_LIBSOUP_CFLAGS="$LIBSOUP_CFLAGS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.2\"") >&5 - ($PKG_CONFIG --exists --print-errors "libsoup-2.2") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_LIBSOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.2" 2>/dev/null` + pkg_cv_LIBSOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.4" 2>/dev/null` else pkg_failed=yes fi @@ -23649,12 +23649,12 @@ pkg_cv_LIBSOUP_LIBS="$LIBSOUP_LIBS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.2\"") >&5 - ($PKG_CONFIG --exists --print-errors "libsoup-2.2") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_LIBSOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.2" 2>/dev/null` + pkg_cv_LIBSOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.4" 2>/dev/null` else pkg_failed=yes fi @@ -23673,14 +23673,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsoup-2.2"` + LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsoup-2.4"` else - LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsoup-2.2"` + LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsoup-2.4"` fi # Put the nasty error message in config.log where it belongs echo "$LIBSOUP_PKG_ERRORS" >&5 - { { echo "$as_me:$LINENO: error: Package requirements (libsoup-2.2) were not met: + { { echo "$as_me:$LINENO: error: Package requirements (libsoup-2.4) were not met: $LIBSOUP_PKG_ERRORS @@ -23691,7 +23691,7 @@ and LIBSOUP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 -echo "$as_me: error: Package requirements (libsoup-2.2) were not met: +echo "$as_me: error: Package requirements (libsoup-2.4) were not met: $LIBSOUP_PKG_ERRORS diff -Naur telepathy-salut-0.3.6.old/configure.ac telepathy-salut-0.3.6/configure.ac --- telepathy-salut-0.3.6.old/configure.ac 2008-12-02 17:03:40.000000000 +0000 +++ telepathy-salut-0.3.6/configure.ac 2009-01-02 21:38:42.000000000 +0000 @@ -219,7 +219,7 @@ AC_SUBST(AVAHI_LIBS) dnl Check for libsoup -PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.2]) +PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4]) AC_SUBST(LIBSOUP_CFLAGS) AC_SUBST(LIBSOUP_LIBS) diff -Naur telepathy-salut-0.3.6.old/lib/gibber/gibber-oob-file-transfer.c telepathy-salut-0.3.6/lib/gibber/gibber-oob-file-transfer.c --- telepathy-salut-0.3.6.old/lib/gibber/gibber-oob-file-transfer.c 2008-12-02 17:03:35.000000000 +0000 +++ telepathy-salut-0.3.6/lib/gibber/gibber-oob-file-transfer.c 2009-01-02 21:38:42.000000000 +0000 @@ -22,10 +22,9 @@ #include #include -/* TODO: We should port code to use libsoup 2.4 */ #include #include -#include +#include #include "gibber-xmpp-stanza.h" #include "gibber-oob-file-transfer.h" @@ -292,25 +291,26 @@ return; /* FIXME make async */ - g_io_channel_write_chars (self->priv->channel, msg->response.body, - msg->response.length, NULL, NULL); + g_io_channel_write_chars (self->priv->channel, msg->response_body->data, + msg->response_body->length, NULL, NULL); if (msg->status_code != HTTP_STATUS_CODE_OK) { /* Something did wrong, so it's not file data. Don't fire the * transferred-chunk signal. */ - self->priv->transferred_bytes += msg->response.length; + self->priv->transferred_bytes += msg->response_body->length; return; } - transferred_chunk (self, (guint64) msg->response.length); + transferred_chunk (self, (guint64) msg->response_body->length); } /* * Received all the file from the HTTP server. */ static void -http_client_finished_chunks_cb (SoupMessage *msg, +http_client_finished_chunks_cb (SoupSession *session, + SoupMessage *msg, gpointer user_data) { GibberOobFileTransfer *self = user_data; @@ -518,9 +518,9 @@ switch (status) { case G_IO_STATUS_NORMAL: - soup_message_add_chunk (self->priv->msg, SOUP_BUFFER_SYSTEM_OWNED, + soup_message_body_append (self->priv->msg->request_body, SOUP_MEMORY_TAKE, buff, bytes_read); - soup_message_io_unpause (self->priv->msg); + soup_session_unpause_message (self->priv->session, self->priv->msg); DEBUG("Data available, writing a %"G_GSIZE_FORMAT" bytes chunk", bytes_read); transferred_chunk (self, (guint64) bytes_read); @@ -541,8 +541,8 @@ #undef BUFF_SIZE DEBUG("Closing HTTP chunked transfer"); - soup_message_add_final_chunk (self->priv->msg); - soup_message_io_unpause (self->priv->msg); + soup_message_body_complete (self->priv->msg->request_body); + soup_session_unpause_message (self->priv->session, self->priv->msg); g_io_channel_unref (self->priv->channel); self->priv->channel = NULL; @@ -553,15 +553,18 @@ } static void -http_server_cb (SoupServerContext *context, +http_server_cb (SoupServer *server, SoupMessage *msg, + const char *path, + GHashTable *query, + SoupClientContext *context, gpointer user_data) { - const SoupUri *uri = soup_message_get_uri (msg); + const SoupURI *uri = soup_message_get_uri (msg); GibberOobFileTransfer *self = user_data; const gchar *accept_encoding; - if (context->method_id != SOUP_METHOD_ID_GET) + if (msg->method != SOUP_METHOD_GET) { DEBUG ("A HTTP client tried to use an unsupported method"); soup_message_set_status (msg, SOUP_STATUS_NOT_IMPLEMENTED); @@ -577,17 +580,16 @@ DEBUG ("Serving '%s'", uri->path); soup_message_set_status (msg, SOUP_STATUS_OK); - soup_server_message_set_encoding (SOUP_SERVER_MESSAGE (msg), - SOUP_TRANSFER_CHUNKED); + soup_message_headers_set_encoding (msg->response_headers, SOUP_ENCODING_CHUNKED); - soup_message_add_header (msg->response_headers, "Content-Type", + soup_message_headers_append (msg->response_headers, "Content-Type", GIBBER_FILE_TRANSFER (self)->content_type); self->priv->msg = g_object_ref (msg); /* iChat accepts only AppleSingle encoding, i.e. file's contents and * attributes are stored in the same stream */ - accept_encoding = soup_message_get_header (msg->request_headers, + accept_encoding = soup_message_headers_get (msg->request_headers, "Accept-Encoding"); if (accept_encoding != NULL && strcmp (accept_encoding, "AppleSingle") == 0) { @@ -627,13 +629,13 @@ uint32 = htonl (size); g_byte_array_append (array, (guint8*) &uint32, 4); - soup_message_add_header (msg->response_headers, "Content-encoding", + soup_message_headers_append (msg->response_headers, "Content-encoding", "AppleSingle"); /* libsoup will free the date once they are written */ len = array->len; buff = (gchar *) g_byte_array_free (array, FALSE); - soup_message_add_chunk (self->priv->msg, SOUP_BUFFER_SYSTEM_OWNED, + soup_message_body_append (self->priv->msg->response_body, SOUP_MEMORY_TAKE, buff, len); soup_message_io_unpause (self->priv->msg); @@ -664,8 +666,8 @@ return; } - soup_server_add_handler (self->priv->server, self->priv->served_name, NULL, - http_server_cb, NULL, self); + soup_server_add_handler (self->priv->server, self->priv->served_name, + http_server_cb, self, NULL); if (!gibber_file_transfer_send_stanza (GIBBER_FILE_TRANSFER (self), stanza, &error))