return TRUE;
}
+/**
+ * Clear the given chunk and free it
+ */
+static void destroy_request_chunk(chunk_t *chunk)
+{
+ chunk_clear(chunk);
+ free(chunk);
+}
+
/**
* Callback processing incoming requests in strict order
*/
entry_selector_t *sel)
{
entry_t *entry;
- chunk_t chunk;
+ chunk_t *chunk;
bool found;
u_int id;
break;
}
- found = array_remove(entry->queue, ARRAY_HEAD, &chunk);
+ INIT(chunk);
+ found = array_remove(entry->queue, ARRAY_HEAD, chunk);
if (!found)
{
entry->has_processor = FALSE;
put_entry(sel->this, entry, TRUE, FALSE);
if (!found)
{
+ free(chunk);
break;
}
- thread_cleanup_push((void*)chunk_clear, &chunk);
- sel->this->inbound(sel->this->user, id, chunk);
+ thread_cleanup_push((void*)destroy_request_chunk, chunk);
+ sel->this->inbound(sel->this->user, id, *chunk);
thread_cleanup_pop(TRUE);
}
return JOB_REQUEUE_NONE;