Skip to content
Snippets Groups Projects
Commit 2191e065 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

daemon/lua: update defaults (both v4/v6 localhost, 100M cache)

parent 110f5e49
Branches
Tags
No related merge requests found
-- Listen on localhost
if not next(net.list()) then
if not pcall(net.listen, '127.0.0.1') then
error('failed to bind to localhost#53')
local ok, err = pcall(net.listen, {'127.0.0.1', '::1'})
if not ok then
error('bind to localhost#53 '..err)
end
end
-- Open cache if not set/disabled
if not cache.current_size then
cache.size = 10 * MB
cache.size = 100 * MB
end
\ No newline at end of file
......@@ -443,14 +443,11 @@ static void on_connect(uv_connect_t *req, int status)
struct qr_task *task = req->data;
uv_stream_t *handle = req->handle;
if (qr_valid_handle(task, (uv_handle_t *)req->handle)) {
struct sockaddr_in6 addr;
int addrlen = sizeof(addr); /* Retrieve endpoint IP for statistics */
uv_tcp_getpeername((uv_tcp_t *)handle, (struct sockaddr *)&addr, &addrlen);
if (status == 0) {
qr_task_send(task, (uv_handle_t *)handle, (struct sockaddr *)&addr, task->pktbuf);
qr_task_send(task, (uv_handle_t *)handle, NULL, task->pktbuf);
} else {
DEBUG_MSG("ioreq conn_done %p => %d, %s\n", req, status, uv_strerror(status));
qr_task_step(task, (struct sockaddr *)&addr, NULL);
qr_task_step(task, task->addrlist, NULL);
}
}
qr_task_unref(task);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment