Fix the latest round of "Connection terminated unexpectedly" errors
authorDan Winship <danw@gnome.org>
Sun, 18 Oct 2009 15:21:36 +0000 (11:21 -0400)
committerDan Winship <danw@gnome.org>
Sun, 18 Oct 2009 15:21:36 +0000 (11:21 -0400)
commit897883bc4dcabe1814c5d14fb65c7a64e3b4a604
treeae726a2ca7ca58834d83495314c433c142636416
parent9fc013ef95522cd5d651ae700c4ed446f4126290
Fix the latest round of "Connection terminated unexpectedly" errors

The fix introduced in ef7fc058 for bug 578990 caught most cases where
we'd write a request to an already-closed connection, but not all.
Unfortunately, at some point the code path for recovering from that
case got broken, so when it did happen, we'd always end up returning
the error to the app rather than retrying the request. This is now
fixed again.

The specific recent cause of the problem was that the
multiple-pending-connections fix (baa316ac/bug 594768) results in us
sometimes opening more connections than we need, and so some of those
connections become idle without ever having had a message sent across
them. Servers tend to have different timeouts/behaviors here than with
idle persistent connections, so we should time them out more
aggressively. So now we close a connection after 3 seconds if it
hasn't been used yet.
libsoup/soup-connection.c
libsoup/soup-message-io.c
libsoup/soup-socket.c