diff -ur gst-plugins-good/ext/soup/gstsouphttpsrc.c gst-plugins-good_new/ext/soup/gstsouphttpsrc.c
--- gst-plugins-good/ext/soup/gstsouphttpsrc.c	2011-11-10 21:26:29.000000000 +0400
+++ gst-plugins-good_new/ext/soup/gstsouphttpsrc.c	2011-11-16 02:12:36.073630816 +0400
@@ -1301,6 +1301,19 @@
   GST_DEBUG_OBJECT (src, "stop()");
   gst_soup_http_src_session_close (src);
   if (src->loop) {
+    g_main_loop_quit (src->loop);
+
+    {
+      /* Iterating the main context to give GIO cancellables a chance
+       * to initiate cleanups. Wihout this, resources allocated by
+       * libsoup for the connection are not released and socket fd is
+       * leaked. */
+      GSource * const idle_source = g_idle_source_new ();
+      g_source_attach (idle_source, src->context);
+      g_main_context_iteration (src->context, TRUE);
+      g_source_unref (idle_source);
+    }
+
     g_main_loop_unref (src->loop);
     g_main_context_unref (src->context);
     src->loop = NULL;
