summaryrefslogtreecommitdiff
path: root/src/mod_authn_gssapi.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2018-09-23 19:16:06 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2018-09-23 19:18:49 -0400
commit65fcd7810f328aace0430341386329df9c714127 (patch)
tree7a25873e15104ffbf27b2d77d51ecbadec7cbb2c /src/mod_authn_gssapi.c
parentb61ed6da2a4324cd562c3c5ec698f70ced4806b6 (diff)
downloadlighttpd-git-65fcd7810f328aace0430341386329df9c714127.tar.gz
[core] prefer buffer_append_string_len()
prefer buffer_append_string_len() when string len is known (instead of buffer_append_string() which will recalculate strlen)
Diffstat (limited to 'src/mod_authn_gssapi.c')
-rw-r--r--src/mod_authn_gssapi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mod_authn_gssapi.c b/src/mod_authn_gssapi.c
index 64400f6a..6ed61ee9 100644
--- a/src/mod_authn_gssapi.c
+++ b/src/mod_authn_gssapi.c
@@ -193,9 +193,9 @@ static void mod_authn_gssapi_log_gss_error(server *srv, const char *file, unsign
maj_stat = gss_display_status(&min_stat, err_min, GSS_C_MECH_CODE,
GSS_C_NULL_OID, &msg_ctx, &status_string);
if (!GSS_ERROR(maj_stat)) {
- buffer_append_string(msg, " (");
+ buffer_append_string_len(msg, CONST_STR_LEN(" ("));
buffer_append_string(msg, status_string.value);
- buffer_append_string(msg, ")");
+ buffer_append_string_len(msg, CONST_STR_LEN(")"));
gss_release_buffer(&min_stat, &status_string);
}
} while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
@@ -365,12 +365,12 @@ static handler_t mod_authn_gssapi_check_spnego(server *srv, connection *con, plu
* ??? What if con->server_name is not set?
* ??? Will this work below if IPv6 provided in Host? probably not */
if (!buffer_is_empty(con->request.http_host)) {
- buffer_append_string(sprinc, "/");
+ buffer_append_string_len(sprinc, CONST_STR_LEN("/"));
buffer_append_string_len(sprinc, con->request.http_host->ptr, strcspn(con->request.http_host->ptr, ":"));
}
}
if (strchr(sprinc->ptr, '@') == NULL) {
- buffer_append_string(sprinc, "@");
+ buffer_append_string_len(sprinc, CONST_STR_LEN("@"));
buffer_append_string_buffer(sprinc, require->realm);
}
/*#define GSS_C_NT_USER_NAME gss_nt_user_name*/
@@ -663,7 +663,7 @@ static handler_t mod_authn_gssapi_basic(server *srv, connection *con, void *p_d,
* ??? What if con->server_name is not set?
* ??? Will this work below if IPv6 provided in Host? probably not */
if (!buffer_is_empty(con->request.http_host)) {
- buffer_append_string(sprinc, "/");
+ buffer_append_string_len(sprinc, CONST_STR_LEN("/"));
buffer_append_string_len(sprinc, con->request.http_host->ptr, strcspn(con->request.http_host->ptr, ":"));
}
}