| 87 | } |
| 88 | |
| 89 | int credential_match(const struct credential *want, |
| 90 | const struct credential *have, int match_password) |
| 91 | { |
| 92 | #define CHECK(x) (!want->x || (have->x && !strcmp(want->x, have->x))) |
| 93 | return CHECK(protocol) && |
| 94 | CHECK(host) && |
| 95 | CHECK(path) && |
| 96 | CHECK(username) && |
| 97 | (!match_password || CHECK(password)) && |
| 98 | (!match_password || CHECK(credential)); |
| 99 | #undef CHECK |
| 100 | } |
| 101 | |
| 102 | |
| 103 | static int credential_from_potentially_partial_url(struct credential *c, |
no outgoing calls
no test coverage detected