Commit 558ab0f6 authored by Michael Graff's avatar Michael Graff
Browse files

adapt to the dispatch api changes

parent f4f3f2cf
......@@ -29,6 +29,7 @@
#include <dns/adb.h>
#include <dns/cache.h>
#include <dns/dispatch.h>
#include <dns/db.h>
#include <dns/log.h>
#include <dns/rootns.h>
......@@ -48,6 +49,7 @@ isc_logconfig_t *lcfg;
isc_taskmgr_t *taskmgr;
isc_socketmgr_t *socketmgr;
isc_timermgr_t *timermgr;
dns_dispatchmgr_t *dispatchmgr;
isc_task_t *t1, *t2;
dns_view_t *view;
dns_db_t *rootdb;
......@@ -146,6 +148,10 @@ create_managers(void) {
socketmgr = NULL;
result = isc_socketmgr_create(mctx, &socketmgr);
check_result(result, "isc_socketmgr_create");
dispatchmgr = NULL;
result = dns_dispatchmgr_create(mctx, &dispatchmgr);
check_result(result, "dns_dispatchmgr_create");
}
static void
......@@ -177,7 +183,7 @@ create_view(void) {
* see if we are dealing with a shared dispatcher in this view.
*/
result = dns_view_createresolver(view, taskmgr, 16, socketmgr,
timermgr, 0, NULL, NULL);
timermgr, 0, dispatchmgr, NULL, NULL);
check_result(result, "dns_view_createresolver()");
rootdb = NULL;
......
......@@ -33,6 +33,7 @@
#include <dns/byaddr.h>
#include <dns/cache.h>
#include <dns/dispatch.h>
#include <dns/events.h>
#include <dns/resolver.h>
#include <dns/result.h>
......@@ -91,6 +92,7 @@ main(int argc, char *argv[]) {
dns_view_t *view;
int ch;
isc_socketmgr_t *socketmgr;
dns_dispatchmgr_t *dispatchmgr;
isc_netaddr_t na;
dns_byaddr_t *byaddr;
isc_result_t result;
......@@ -125,11 +127,15 @@ main(int argc, char *argv[]) {
}
taskmgr = NULL;
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &taskmgr) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &taskmgr)
== ISC_R_SUCCESS);
task = NULL;
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task)
== ISC_R_SUCCESS);
dispatchmgr = NULL;
RUNTIME_CHECK(dns_dispatchmgr_create(mctx, &dispatchmgr)
== ISC_R_SUCCESS);
timermgr = NULL;
RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) == ISC_R_SUCCESS);
......@@ -146,7 +152,8 @@ main(int argc, char *argv[]) {
&view) == ISC_R_SUCCESS);
RUNTIME_CHECK(dns_view_createresolver(view, taskmgr, 10, socketmgr,
timermgr, 0, NULL, NULL) ==
timermgr, 0,
dispatchmgr, NULL, NULL) ==
ISC_R_SUCCESS);
{
......
......@@ -34,6 +34,7 @@
#include <dns/adb.h>
#include <dns/cache.h>
#include <dns/dispatch.h>
#include <dns/events.h>
#include <dns/log.h>
#include <dns/resolver.h>
......@@ -216,6 +217,7 @@ main(int argc, char *argv[]) {
isc_timermgr_t *timermgr;
int ch;
isc_socketmgr_t *socketmgr;
dns_dispatchmgr_t *dispatchmgr;
dns_cache_t *cache;
isc_buffer_t b;
......@@ -255,11 +257,17 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK(isc_task_create(taskmgr, 0, &task) ==
ISC_R_SUCCESS);
dispatchmgr = NULL;
RUNTIME_CHECK(dns_dispatchmgr_create(mctx, &dispatchmgr)
== ISC_R_SUCCESS);
timermgr = NULL;
RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) == ISC_R_SUCCESS);
socketmgr = NULL;
RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS);
cache = NULL;
RUNTIME_CHECK(dns_cache_create(mctx, taskmgr, timermgr,
dns_rdataclass_in, "rbt", 0, NULL,
......@@ -270,7 +278,8 @@ main(int argc, char *argv[]) {
&view) == ISC_R_SUCCESS);
RUNTIME_CHECK(dns_view_createresolver(view, taskmgr, 10, socketmgr,
timermgr, 0, NULL, NULL) ==
timermgr, 0,
dispatchmgr, NULL, NULL) ==
ISC_R_SUCCESS);
{
......
......@@ -36,6 +36,7 @@
isc_mem_t *mctx;
isc_taskmgr_t *manager;
isc_socketmgr_t *socketmgr;
dns_dispatchmgr_t *dispatchmgr;
dns_dispatch_t *disp;
isc_task_t *t0, *t1, *t2;
isc_buffer_t render;
......@@ -91,8 +92,8 @@ my_accept(isc_task_t *task, isc_event_t *ev_in) {
* Create a dispatch context
*/
disp = NULL;
RUNTIME_CHECK(dns_dispatch_create(mctx, ev->newsocket, task,
512, 6, 1024, 17, 19, NULL, &disp)
RUNTIME_CHECK(dns_dispatch_create(dispatchmgr, ev->newsocket, task,
512, 6, 1024, 17, 19, NULL, 0, &disp)
== ISC_R_SUCCESS);
resp = NULL;
......@@ -353,6 +354,10 @@ main(int argc, char *argv[]) {
socketmgr = NULL;
RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS);
dispatchmgr = NULL;
RUNTIME_CHECK(dns_dispatchmgr_create(mctx, &dispatchmgr)
== ISC_R_SUCCESS);
/*
* Open up a random socket. Who cares where.
*/
......
......@@ -45,6 +45,7 @@ typedef struct {
isc_mem_t *mctx;
isc_taskmgr_t *manager;
isc_socketmgr_t *socketmgr;
dns_dispatchmgr_t *dispatchmgr;
dns_dispatch_t *disp;
isc_task_t *t0, *t1, *t2;
clictx_t clients[16]; /* Lots of things might want to use this. */
......@@ -377,12 +378,16 @@ main(int argc, char *argv[]) {
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_socket_bind(s0, &sockaddr) == ISC_R_SUCCESS);
dispatchmgr = NULL;
RUNTIME_CHECK(dns_dispatchmgr_create(mctx, &dispatchmgr)
== ISC_R_SUCCESS);
/*
* Create a dispatch context.
*/
disp = NULL;
RUNTIME_CHECK(dns_dispatch_create(mctx, s0, t0, 512, 6, 1024,
17, 19, NULL, &disp)
RUNTIME_CHECK(dns_dispatch_create(dispatchmgr, s0, t0, 512, 6, 1024,
17, 19, NULL, 0, &disp)
== ISC_R_SUCCESS);
RUNTIME_CHECK(isc_mutex_init(&client_lock) == ISC_R_SUCCESS);
......
Markdown is supported
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