souphttpsrc: don't try to authenticate if no username/password is set.
authorArnout Vandecappelle <arnout@mind.be>
Thu, 16 Jul 2009 13:14:43 +0000 (15:14 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 16 Jul 2009 15:14:15 +0000 (17:14 +0200)
ext/soup/gstsouphttpsrc.c

index 812cd78d1165483a173e3f42a2b5d5953731af6a..1a94576f97b8109ba07ea84dc59c92fd9704c172 100644 (file)
@@ -703,9 +703,11 @@ gst_soup_http_src_authenticate_cb (SoupSession * session, SoupMessage * msg,
   if (!retrying) {
     /* First time authentication only, if we fail and are called again with retry true fall through */
     if (msg->status_code == SOUP_STATUS_UNAUTHORIZED) {
-      soup_auth_authenticate (auth, src->user_id, src->user_pw);
+      if (src->user_id && src->user_pw)
+        soup_auth_authenticate (auth, src->user_id, src->user_pw);
     } else if (msg->status_code == SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED) {
-      soup_auth_authenticate (auth, src->proxy_id, src->proxy_pw);
+      if (src->proxy_id && src->proxy_pw)
+        soup_auth_authenticate (auth, src->proxy_id, src->proxy_pw);
     }
   }
 }