After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 601733 - rtspsrc: Use specific error message when authentication is required
rtspsrc: Use specific error message when authentication is required
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 601732
 
 
Reported: 2009-11-12 19:22 UTC by Bastien Nocera
Modified: 2015-02-24 09:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtspsrc: improve error message when unauthorized (1.02 KB, patch)
2015-02-22 01:16 UTC, Krzysztof Kotlenga
committed Details | Review

Description Bastien Nocera 2009-11-12 19:22:19 UTC
Something similar to giosrc's "not-mounted" message would be fine. It could even pass the "AuthName" from the server, as context.
Comment 1 Bastien Nocera 2011-04-03 23:47:47 UTC
FWIW, that's what we have right now:

  /* RTSP or HTTP source with user-id property ? */
  if ((g_strcmp0 ("GstRTSPSrc", G_OBJECT_TYPE_NAME (err_msg->src)) == 0 || 
       g_strcmp0 ("GstSoupHTTPSrc", G_OBJECT_TYPE_NAME (err_msg->src)) == 0) &&
      g_object_class_find_property (G_OBJECT_GET_CLASS (err_msg->src), "user-id") != NULL) {
    GError *err = NULL;
    gchar *dbg = NULL;

    gst_message_parse_error (err_msg, &err, &dbg);

    /* Urgh! Check whether this is an auth error */
    if (err != NULL && dbg != NULL &&
        is_error (err, RESOURCE, READ) &&
        strstr (dbg, "401") != NULL) {

and strstr'ing for "401" really doesn't look like the best of ideas.
Comment 2 Bastien Nocera 2012-03-29 00:11:34 UTC
This is still current.
Comment 3 Tim-Philipp Müller 2012-10-26 19:35:59 UTC
So what's actually needed here?

Error codes for 401 UNAUTHORIZED and make both souphttpsrc and rtspsrc map 401 errors to that and post appropriate error messages?
Comment 4 Bastien Nocera 2012-10-26 22:20:20 UTC
Yeah, anything better than doing strstr() on a string.
Comment 5 Krzysztof Kotlenga 2015-02-22 01:16:36 UTC
Created attachment 297541 [details] [review]
rtspsrc: improve error message when unauthorized

I'm attaching a patch that fixes this for rtspsrc.
souphttpsrc already returns NOT_AUTHORIZED since cf31a4284bcd87f4137bdd8f2dc1cf3cedf43ccb.
Comment 6 Sebastian Dröge (slomo) 2015-02-24 09:07:10 UTC
Comment on attachment 297541 [details] [review]
rtspsrc: improve error message when unauthorized

Thanks for the patch!

commit e3ca4d1c86813338915e2e143e4d4675e40c45ea
Author: Krzysztof Kotlenga <pocek@users.sf.net>
Date:   Sun Feb 22 01:49:52 2015 +0100

    rtspsrc: improve error message when unauthorized
    
    Make use of NOT_AUTHORIZED error code instead of falling back to generic
    READ error.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=601733