diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-03-24 21:39:08 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-02 01:16:40 -0400 |
commit | dc01487ea6211337fbe632f0c8921d2efaa457eb (patch) | |
tree | 4c98f6237905fbba0c4b41b31da7eaacceecb3c8 /src/plugin.c | |
parent | b4310877ac50c8c0cfa032debe1ca4011385f418 (diff) | |
download | lighttpd-git-dc01487ea6211337fbe632f0c8921d2efaa457eb.tar.gz |
[multiple] use buffer_append_* aggregates
reduces the number of round-trips into some frequently-called routines
Diffstat (limited to 'src/plugin.c')
-rw-r--r-- | src/plugin.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugin.c b/src/plugin.c index 0afa34be..0854a8ab 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -158,11 +158,8 @@ int plugins_load(server *srv) { for (uint32_t i = 0; i < srv->srvconf.modules->used; ++i) { const buffer * const module = &((data_string *)srv->srvconf.modules->data[i])->value; - buffer_copy_buffer(tb, srv->srvconf.modules_dir); - - buffer_append_string_len(tb, CONST_STR_LEN("/")); - buffer_append_string_buffer(tb, module); + buffer_append_path_len(tb, CONST_BUF_LEN(module)); #if defined(__WIN32) || defined(__CYGWIN__) buffer_append_string_len(tb, CONST_STR_LEN(".dll")); #else @@ -201,8 +198,9 @@ int plugins_load(server *srv) { } #endif - buffer_copy_buffer(tb, module); - buffer_append_string_len(tb, CONST_STR_LEN("_plugin_init")); + buffer_clear(tb); + buffer_append_str2(tb, CONST_BUF_LEN(module), + CONST_STR_LEN("_plugin_init")); #ifdef __WIN32 init = GetProcAddress(p->lib, tb->ptr); |