~ubuntu-branches/ubuntu/lucid/libsoup2.4/lucid-proposed

« back to all changes in this revision

Viewing changes to libsoup/soup-session.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-04-28 15:26:36 UTC
  • mfrom: (1.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20100428152636-fgpkrmoqac052vjy
Tags: 2.30.1-0ubuntu1
* New upstream version (lp: #571242):
  - Fix for https through proxies that close the connection when returning a 
    "407 Proxy Authentication Required" response, and add a 
    regression test for that case.
  - Fixed multiple forms/multipart-related interoperability problems reported 
    by Egon Andersen:
  - Don't quote the multipart boundary string if it's not needed, since 
    RFC 2616 recommends that you don't, and some servers don't handle quotes 
    there correctly. (Sigh.)
  - Don't put an extra blank line before the first multipart part, since it's 
    unnecessary and some servers don't handle a multipart preamble correctly.
  - Don't put Content-Transfer-Encoding headers in 
    the multipart/form-data parts, even though the HTML 4 spec says you must, 
    since no other browsers do, and some servers don't handle them correctly.
  - Changed SoupCookieJarSqlite to actually erase deleted
    cookies from the database.
  - Fixed SoupLogger to be more robust against getting passed bad data 
     by the session.
  - Fixed SoupAuthDomain to ignore paths when doing proxy auth
  - Fixed a g_warning when hovering over a javascript link in WebKit
* debian/libsoup2.4-1.symbols:
  - new version update
* debian/rules:
  - copied new Debian soname computation code to fix build issue 
  - updated shlib version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1271
1271
                        return;
1272
1272
        }
1273
1273
 
 
1274
        if (status == SOUP_STATUS_TRY_AGAIN)
 
1275
                return;
 
1276
 
1274
1277
        /* Cancel any other messages waiting for a connection to it,
1275
1278
         * since they're out of luck.
1276
1279
         */
1304
1307
        }
1305
1308
}
1306
1309
 
 
1310
static void
 
1311
tunnel_connect_restarted (SoupMessage *msg, gpointer session)
 
1312
{
 
1313
        SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
 
1314
        SoupMessageQueueItem *item;
 
1315
 
 
1316
        if (msg->status_code != SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED)
 
1317
                return;
 
1318
 
 
1319
        item = soup_message_queue_lookup (priv->queue, msg);
 
1320
        if (!item)
 
1321
                return;
 
1322
        if (soup_connection_get_state (item->conn) == SOUP_CONNECTION_DISCONNECTED) {
 
1323
                /* We got a 407, and the session provided auth and
 
1324
                 * restarted the message, but the proxy closed the
 
1325
                 * connection, so we need to create a new one. The
 
1326
                 * easiest way to do this is to just give up on the
 
1327
                 * current msg and conn, and re-run the queue.
 
1328
                 */
 
1329
                soup_session_cancel_message (session, msg,
 
1330
                                             SOUP_STATUS_TRY_AGAIN);
 
1331
        }
 
1332
        soup_message_queue_item_unref (item);
 
1333
}
 
1334
 
1307
1335
SoupMessageQueueItem *
1308
1336
soup_session_make_connect_message (SoupSession *session,
1309
1337
                                   SoupAddress *server_addr)
1330
1358
         */
1331
1359
        g_signal_connect (msg, "finished",
1332
1360
                          G_CALLBACK (tunnel_connected), session);
 
1361
        g_signal_connect (msg, "restarted",
 
1362
                          G_CALLBACK (tunnel_connect_restarted), session);
1333
1363
        queue_message (session, msg, NULL, NULL);
1334
1364
        item = soup_message_queue_lookup (priv->queue, msg);
1335
1365
        g_object_unref (msg);
1781
1811
void
1782
1812
soup_session_prepare_for_uri (SoupSession *session, SoupURI *uri)
1783
1813
{
1784
 
        SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
 
1814
        SoupSessionPrivate *priv;
1785
1815
        SoupSessionHost *host;
1786
1816
        SoupAddress *addr;
1787
1817
 
 
1818
        g_return_if_fail (SOUP_IS_SESSION (session));
 
1819
        g_return_if_fail (uri != NULL);
 
1820
 
 
1821
        if (!uri->host)
 
1822
                return;
 
1823
 
 
1824
        priv = SOUP_SESSION_GET_PRIVATE (session);
 
1825
 
1788
1826
        g_mutex_lock (priv->host_lock);
1789
1827
        host = get_host_for_uri (session, uri);
1790
1828
        addr = g_object_ref (host->addr);