]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
http: fix http_access_verify_channel(), fixes #5317
authorJaroslav Kysela <perex@perex.cz>
Thu, 8 Nov 2018 14:45:55 +0000 (15:45 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 8 Nov 2018 14:45:55 +0000 (15:45 +0100)
src/http.c

index 48c873681b8dad392d6d535336ab3da68ee1784e..1f85517714124ea7e23101a89c5c2c5bacc74cd5 100644 (file)
@@ -1010,36 +1010,18 @@ int
 http_access_verify_channel(http_connection_t *hc, int mask,
                            struct channel *ch)
 {
-  struct http_verify_structure v;
-  int res = -1;
+  int res = 0;
 
   assert(ch);
 
-  http_access_verify_ticket(hc);
-  if (hc->hc_access) {
-    res = access_verify2(hc->hc_access, mask);
-
-    if (!res && !channel_access(ch, hc->hc_access, 0))
-      res = -1;
-  }
-
-  if (res) {
-    access_destroy(hc->hc_access);
-    if (http_verify_prepare(hc, &v)) {
-      hc->hc_access = NULL;
-      return -1;
-    }
-    hc->hc_access = access_get(hc->hc_peer, hc->hc_username,
-                               http_verify_callback, &v);
-    http_verify_free(&v);
-    if (hc->hc_access) {
-      res = access_verify2(hc->hc_access, mask);
-
-      if (!res && !channel_access(ch, hc->hc_access, 0))
-        res = -1;
-    }
+  if (hc->hc_access == NULL) {
+    res = http_access_verify(hc, mask);
+    if (res)
+      return res;
   }
 
+  if (!channel_access(ch, hc->hc_access, 0))
+    res = -1;
 
   return res;
 }