hc->hc_access = access_ticket_verify2(ticket_id, hc->hc_url);
if (hc->hc_access == NULL)
return;
+ hc->hc_auth_type = HC_AUTH_TICKET;
tvhinfo(hc->hc_subsys, "%s: using ticket %s for %s",
hc->hc_peer_ipstr, ticket_id, hc->hc_url);
}
hc->hc_access = access_get_by_auth(hc->hc_peer, auth_id);
if (hc->hc_access == NULL)
return;
+ hc->hc_auth_type = HC_AUTH_PERM;
tvhinfo(hc->hc_subsys, "%s: using auth %s for %s",
hc->hc_peer_ipstr, auth_id, hc->hc_url);
}
http_access_verify(http_connection_t *hc, int mask)
{
struct http_verify_structure v;
+ int r;
/* quick path */
if (hc->hc_access)
hc->hc_access = access_get(hc->hc_peer, hc->hc_username,
http_verify_callback, &v);
http_verify_free(&v);
- if (hc->hc_access)
- return access_verify2(hc->hc_access, mask);
+ if (hc->hc_access) {
+ r = access_verify2(hc->hc_access, mask);
+ if (r == 0) {
+ if (!strempty(hc->hc_username))
+ hc->hc_auth_type = hc->hc_authhdr ? HC_AUTH_DIGEST : HC_AUTH_PLAIN;
+ else
+ hc->hc_auth_type = HC_AUTH_ADDR;
+ }
+ }
return -1;
}