MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_http_auth_handle_header

Function ff_http_auth_handle_header

libavformat/httpauth.c:90–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void ff_http_auth_handle_header(HTTPAuthState *state, const char *key,
91 const char *value)
92{
93 if (!av_strcasecmp(key, "WWW-Authenticate") || !av_strcasecmp(key, "Proxy-Authenticate")) {
94 const char *p;
95 if (av_stristart(value, "Basic ", &p) &&
96 state->auth_type <= HTTP_AUTH_BASIC) {
97 state->auth_type = HTTP_AUTH_BASIC;
98 state->realm[0] = 0;
99 state->stale = 0;
100 ff_parse_key_value(p, (ff_parse_key_val_cb) handle_basic_params,
101 state);
102 } else if (av_stristart(value, "Digest ", &p) &&
103 state->auth_type <= HTTP_AUTH_DIGEST) {
104 state->auth_type = HTTP_AUTH_DIGEST;
105 memset(&state->digest_params, 0, sizeof(DigestParams));
106 state->realm[0] = 0;
107 state->stale = 0;
108 ff_parse_key_value(p, (ff_parse_key_val_cb) handle_digest_params,
109 state);
110 choose_qop(state->digest_params.qop,
111 sizeof(state->digest_params.qop));
112 if (!av_strcasecmp(state->digest_params.stale, "true"))
113 state->stale = 1;
114 }
115 } else if (!av_strcasecmp(key, "Authentication-Info")) {
116 ff_parse_key_value(value, (ff_parse_key_val_cb) handle_digest_update,
117 state);
118 }
119}
120
121
122static void update_md5_strings(struct AVMD5 *md5ctx, ...)

Callers 2

ff_rtsp_parse_lineFunction · 0.85
process_lineFunction · 0.85

Calls 4

av_strcasecmpFunction · 0.85
av_stristartFunction · 0.85
ff_parse_key_valueFunction · 0.85
choose_qopFunction · 0.85

Tested by

no test coverage detected