diff --git a/include/lighttpd/stat_cache.h b/include/lighttpd/stat_cache.h index 337a999..dc2245f 100644 --- a/include/lighttpd/stat_cache.h +++ b/include/lighttpd/stat_cache.h @@ -103,4 +103,4 @@ LI_API void li_stat_cache_entry_acquire(liVRequest *vr, liStatCacheEntry *sce); /* release a stat_cache_entry so it can be cleaned up */ LI_API void li_stat_cache_entry_release(liVRequest *vr, liStatCacheEntry *sce); -#endif \ No newline at end of file +#endif diff --git a/src/angel/angel_main.c b/src/angel/angel_main.c index 4f7a926..d6f59e3 100644 --- a/src/angel/angel_main.c +++ b/src/angel/angel_main.c @@ -88,5 +88,5 @@ cleanup: if (config_path) g_free((gchar*) config_path); if (module_dir != def_module_dir) g_free((gchar*) module_dir); - return 0; + return result; } diff --git a/src/angel/angel_plugin.c b/src/angel/angel_plugin.c index 532c8b7..0354c4e 100644 --- a/src/angel/angel_plugin.c +++ b/src/angel/angel_plugin.c @@ -273,6 +273,7 @@ static gboolean plugins_activate_module(liServer *srv, server_module *sm) { for (i = 0; i < sm->plugins->len; i++) { p = g_ptr_array_index(sm->plugins, i); g_ptr_array_add(ps->load_plugins, p); + g_hash_table_insert(ps->load_ht_plugins, (gpointer) p->name, p); if (!p->items) continue; for (pi = p->items; pi->name; pi++) { @@ -288,8 +289,6 @@ static gboolean plugins_activate_module(liServer *srv, server_module *sm) { } } - g_hash_table_insert(ps->load_ht_plugins, (gpointer) p->name, p); - return TRUE; item_collission: @@ -302,6 +301,7 @@ item_collission: for ( ; i-- > 0; ) { p = g_ptr_array_index(sm->plugins, i); + g_hash_table_remove(ps->load_ht_plugins, p->name); if (!p->items) continue; for (pi = p->items; pi->name; pi++) { @@ -359,13 +359,13 @@ liPlugin *li_angel_plugin_register(liServer *srv, liModule *mod, const gchar *na sm = g_hash_table_lookup(ps->load_module_refs, modname); if (!sm) { - ERROR(srv, "Module '%s' not loaded; cannot load plugin '%s'", mod->name->str, name); + ERROR(srv, "Module '%s' not loaded; cannot load plugin '%s'", modname, name); return NULL; } p = plugin_new(name); if (!init(srv, p)) { - ERROR(srv, "Couldn't load plugin '%s' for module '%s': init failed", name, mod->name->str); + ERROR(srv, "Couldn't load plugin '%s' for module '%s': init failed", name, modname); li_plugin_free(srv, p); return NULL; } diff --git a/src/main/actions.c b/src/main/actions.c index 6431416..2f54b5f 100644 --- a/src/main/actions.c +++ b/src/main/actions.c @@ -215,7 +215,6 @@ liHandlerResult li_action_execute(liVRequest *vr) { action_stack_pop(srv, vr, as); while (NULL != (ase = action_stack_top(as)) && (ase->act->type != ACTION_TBALANCER || !ase->act->data.balancer.provide_backlog)) { action_stack_pop(srv, vr, as); - ase = action_stack_top(as); } if (!ase) { /* no backlogging balancer found */ if (li_vrequest_handle_direct(vr)) diff --git a/src/main/chunk.c b/src/main/chunk.c index 59b7319..21a6737 100644 --- a/src/main/chunk.c +++ b/src/main/chunk.c @@ -756,8 +756,6 @@ gboolean li_chunkqueue_extract_to(liVRequest *vr, liChunkQueue *cq, goffset len, if (len > cq->length) return FALSE; ci = chunkqueue_iter(cq); - coff = 0; - clen = chunkiter_length(ci); while (len > 0) { coff = 0; @@ -791,8 +789,6 @@ gboolean li_chunkqueue_extract_to_bytearr(liVRequest *vr, liChunkQueue *cq, goff g_byte_array_set_size(dest, 0); ci = chunkqueue_iter(cq); - coff = 0; - clen = chunkiter_length(ci); while (len > 0) { coff = 0; diff --git a/src/main/condition.c b/src/main/condition.c index dc69500..005918c 100644 --- a/src/main/condition.c +++ b/src/main/condition.c @@ -445,6 +445,7 @@ static liHandlerResult li_condition_check_eval_int(liVRequest *vr, liCondition * switch (cond->lvalue->type) { case LI_COMP_REQUEST_CONTENT_LENGTH: val = vr->request.content_length; + break; case LI_COMP_PHYSICAL_SIZE: if (!vr->physical.have_stat) { if (vr->physical.have_errno || !li_vrequest_stat(vr)) { diff --git a/src/main/config_parser.rl b/src/main/config_parser.rl index 6f0a5b0..66e752f 100644 --- a/src/main/config_parser.rl +++ b/src/main/config_parser.rl @@ -931,9 +931,8 @@ ctx->in_setup_block = FALSE; } else { - liAction *al; /* pop action list stack */ - al = g_queue_pop_head(ctx->action_list_stack); + g_queue_pop_head(ctx->action_list_stack); } } diff --git a/src/main/plugin_core.c b/src/main/plugin_core.c index 85cf72a..b9fdb10 100644 --- a/src/main/plugin_core.c +++ b/src/main/plugin_core.c @@ -528,7 +528,6 @@ static gboolean core_event_handler(liServer *srv, liPlugin* p, liValue *val) { } str = val->data.string->str; - backend = 0; /* libev will chose the right one by default */ if (g_str_equal(str, "select")) backend = EVBACKEND_SELECT; diff --git a/src/main/server.c b/src/main/server.c index 97e857e..6ba927a 100644 --- a/src/main/server.c +++ b/src/main/server.c @@ -258,7 +258,7 @@ static void li_server_listen_cb(struct ev_loop *loop, ev_io *w, int revents) { while (-1 != (s = accept(w->fd, &sa, &l))) { liWorker *wrk = srv->main_worker; - guint i, min_load = g_atomic_int_get(&wrk->connection_load), sel = 0; + guint i, min_load = g_atomic_int_get(&wrk->connection_load); if (l <= sizeof(sa)) { remote_addr.addr = g_slice_alloc(l); @@ -277,12 +277,10 @@ static void li_server_listen_cb(struct ev_loop *loop, ev_io *w, int revents) { if (load < min_load) { wrk = wt; min_load = load; - sel = i; } } g_atomic_int_inc((gint*) &wrk->connection_load); - /* TRACE(srv, "selected worker %u with load %u", sel, min_load); */ li_server_socket_acquire(sock); li_worker_new_con(srv->main_worker, wrk, remote_addr, s, sock); } diff --git a/src/main/value_lua.c b/src/main/value_lua.c index 60db824..53485f7 100644 --- a/src/main/value_lua.c +++ b/src/main/value_lua.c @@ -114,7 +114,7 @@ liValue* li_value_from_lua(liServer *srv, lua_State *L) { if (a) { li_action_acquire(a); lua_pop(L, 1); - return val = li_value_new_action(srv, a); + return li_value_new_action(srv, a); } } { /* check for condition */ @@ -122,7 +122,7 @@ liValue* li_value_from_lua(liServer *srv, lua_State *L) { if (c) { li_condition_acquire(c); lua_pop(L, 1); - return val = li_value_new_condition(srv, c); + return li_value_new_condition(srv, c); } } ERROR(srv, "%s", "Unknown lua userdata"); diff --git a/src/modules/mod_debug.c b/src/modules/mod_debug.c index e435973..c536fd8 100644 --- a/src/modules/mod_debug.c +++ b/src/modules/mod_debug.c @@ -153,7 +153,6 @@ static gpointer debug_collect_func(liWorker *wrk, gpointer fdata) { static void debug_collect_cb(gpointer cbdata, gpointer fdata, GPtrArray *result, gboolean complete) { mod_debug_job_t *job = cbdata; liVRequest *vr; - liPlugin *p; GString *html; UNUSED(fdata); @@ -187,7 +186,6 @@ static void debug_collect_cb(gpointer cbdata, gpointer fdata, GPtrArray *result, } vr = job->vr; - p = job->p; /* clear context so it doesn't get cleaned up anymore */ *(job->context) = NULL; diff --git a/src/modules/mod_dirlist.c b/src/modules/mod_dirlist.c index 2491c83..c35cc51 100644 --- a/src/modules/mod_dirlist.c +++ b/src/modules/mod_dirlist.c @@ -161,14 +161,13 @@ static void dirlist_format_size(gchar *buf, goffset size) { *buf++ = remaining + '0'; } *buf++ = *u; - *buf++ = '\0'; + *buf = '\0'; } static liHandlerResult dirlist(liVRequest *vr, gpointer param, gpointer *context) { GString *listing; liStatCacheEntry *sce; dirlist_data *dd; - dirlist_plugin_data *pd; UNUSED(context); @@ -183,7 +182,6 @@ static liHandlerResult dirlist(liVRequest *vr, gpointer param, gpointer *context } dd = param; - pd = dd->plugin->data; if (sce->data.failed) { /* stat failed */ diff --git a/src/modules/mod_rewrite.c b/src/modules/mod_rewrite.c index 2e66dfd..6d75ad6 100644 --- a/src/modules/mod_rewrite.c +++ b/src/modules/mod_rewrite.c @@ -284,7 +284,7 @@ static gboolean rewrite_internal(liVRequest *vr, GString *dest_path, GString *de g_string_printf(vr->con->wrk->tmp_str, "%"L_GOFFSET_FORMAT, vr->request.content_length); str = vr->con->wrk->tmp_str; break; - default: str = NULL; + default: continue; } if (rp->data.cond_lval == LI_COMP_REQUEST_SCHEME) {