summaryrefslogtreecommitdiff
path: root/src/mod_authn_dbi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_authn_dbi.c')
-rw-r--r--src/mod_authn_dbi.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mod_authn_dbi.c b/src/mod_authn_dbi.c
index 37de01f0..f375d7ea 100644
--- a/src/mod_authn_dbi.c
+++ b/src/mod_authn_dbi.c
@@ -128,8 +128,7 @@ mod_authn_dbi_dbconf_setup (server *srv, const array *opts, void **vdata)
* - encoding, default: database default
*/
- if (!buffer_string_is_empty(sqlquery)
- && !buffer_is_empty(dbname) && !buffer_is_empty(dbtype)) {
+ if (sqlquery && !buffer_is_blank(sqlquery) && dbname && dbtype) {
/* create/initialise database */
dbi_config *dbconf;
dbi_inst dbinst = NULL;
@@ -153,7 +152,7 @@ mod_authn_dbi_dbconf_setup (server *srv, const array *opts, void **vdata)
for (size_t j = 0; j < opts->used; ++j) {
data_unset *du = opts->data[j];
const buffer *opt = &du->key;
- if (!buffer_string_is_empty(opt)) {
+ if (!buffer_is_blank(opt)) {
if (du->type == TYPE_INTEGER) {
data_integer *di = (data_integer *)du;
dbi_conn_set_option_numeric(dbconn, opt->ptr, di->value);
@@ -474,7 +473,7 @@ mod_authn_dbi_query_build (buffer * const sqlquery, dbi_config * const dbconf, h
free(esc);
}
else {
- d = dbconf->sqlquery->ptr + buffer_string_length(dbconf->sqlquery);
+ d = dbconf->sqlquery->ptr + buffer_clen(dbconf->sqlquery);
buffer_append_string_len(sqlquery, b, (size_t)(d - b));
break;
}
@@ -546,9 +545,9 @@ mod_authn_dbi_basic (request_st * const r, void *p_d, const http_auth_require_t
ai.dalgo = HTTP_AUTH_DIGEST_NONE;
ai.dlen = 0;
ai.username = username->ptr;
- ai.ulen = buffer_string_length(username);
+ ai.ulen = buffer_clen(username);
ai.realm = require->realm->ptr;
- ai.rlen = buffer_string_length(require->realm);
+ ai.rlen = buffer_clen(require->realm);
rc = mod_authn_dbi_query(r, p_d, &ai, pw);
if (HANDLER_GO_ON != rc) return rc;
return http_auth_match_rules(require, username->ptr, NULL, NULL)