diff options
| author | Internet Software Consortium, Inc <@isc.org> | 2013-08-14 06:35:21 -0600 |
|---|---|---|
| committer | Internet Software Consortium, Inc <@isc.org> | 2013-08-14 06:35:21 -0600 |
| commit | ebbc86ee1eae2231a10e23f4cda592085dbc7eef (patch) | |
| tree | 8e373dd37c3b0a9fb113ff78f7a15dd19f6c0911 /lib/isc | |
| parent | 87c6fc212d37ddbeb388f8308377ae38de3061d9 (diff) | |
| download | bind9-ebbc86ee1eae2231a10e23f4cda592085dbc7eef.tar.gz | |
9.9.4b1
Diffstat (limited to 'lib/isc')
| -rw-r--r-- | lib/isc/api | 6 | ||||
| -rw-r--r-- | lib/isc/app_api.c | 12 | ||||
| -rw-r--r-- | lib/isc/include/isc/app.h | 11 | ||||
| -rw-r--r-- | lib/isc/log.c | 2 | ||||
| -rw-r--r-- | lib/isc/unix/app.c | 31 | ||||
| -rw-r--r-- | lib/isc/unix/include/isc/Makefile.in | 4 | ||||
| -rw-r--r-- | lib/isc/win32/include/isc/Makefile.in | 4 | ||||
| -rw-r--r-- | lib/isc/win32/include/isc/net.h | 74 | ||||
| -rw-r--r-- | lib/isc/win32/netdb.h | 4 | ||||
| -rw-r--r-- | lib/isc/win32/stdio.c | 3 |
10 files changed, 129 insertions, 22 deletions
diff --git a/lib/isc/api b/lib/isc/api index 48bc766d..38d3b8f9 100644 --- a/lib/isc/api +++ b/lib/isc/api @@ -4,6 +4,6 @@ # 9.8: 80-89, 120-129 # 9.9: 90-109 # 9.9-sub: 130-139 -LIBINTERFACE = 95 -LIBREVISION = 1 -LIBAGE = 0 +LIBINTERFACE = 96 +LIBREVISION = 0 +LIBAGE = 1 diff --git a/lib/isc/app_api.c b/lib/isc/app_api.c index ce767d17..709f2f25 100644 --- a/lib/isc/app_api.c +++ b/lib/isc/app_api.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009, 2013 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -91,6 +91,16 @@ isc_app_ctxrun(isc_appctx_t *ctx) { } isc_result_t +isc_app_ctxonrun(isc_appctx_t *ctx, isc_mem_t *mctx, + isc_task_t *task, isc_taskaction_t action, + void *arg) +{ + REQUIRE(ISCAPI_APPCTX_VALID(ctx)); + + return (ctx->methods->ctxonrun(ctx, mctx, task, action, arg)); +} + +isc_result_t isc_app_ctxsuspend(isc_appctx_t *ctx) { REQUIRE(ISCAPI_APPCTX_VALID(ctx)); diff --git a/lib/isc/include/isc/app.h b/lib/isc/include/isc/app.h index e0be7906..53810859 100644 --- a/lib/isc/include/isc/app.h +++ b/lib/isc/include/isc/app.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -117,6 +117,9 @@ typedef struct isc_appmethods { isc_socketmgr_t *timermgr); void (*settimermgr)(isc_appctx_t *ctx, isc_timermgr_t *timermgr); + isc_result_t (*ctxonrun)(isc_appctx_t *ctx, isc_mem_t *mctx, + isc_task_t *task, isc_taskaction_t action, + void *arg); } isc_appmethods_t; /*% @@ -153,10 +156,13 @@ isc_app_start(void); * close to the beginning of the application as possible. * * Requires: - * 'ctx' is a valid application context (for app_ctxstart()). + *\li 'ctx' is a valid application context (for app_ctxstart()). */ isc_result_t +isc_app_ctxonrun(isc_appctx_t *ctx, isc_mem_t *mctx, isc_task_t *task, + isc_taskaction_t action, void *arg); +isc_result_t isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, void *arg); /*!< @@ -164,6 +170,7 @@ isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, * * Requires: *\li isc_app_start() has been called. + *\li 'ctx' is a valid application context (for app_ctxonrun()). * * Returns: * ISC_R_SUCCESS diff --git a/lib/isc/log.c b/lib/isc/log.c index 024d97c6..35204cfb 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -767,7 +767,7 @@ isc_log_createchannel(isc_logconfig_t *lcfg, const char *name, break; default: - isc_mem_put(mctx, channel->name, strlen(channel->name) + 1); + isc_mem_free(mctx, channel->name); isc_mem_put(mctx, channel, sizeof(*channel)); return (ISC_R_UNEXPECTED); } diff --git a/lib/isc/unix/app.c b/lib/isc/unix/app.c index 5393be94..d97d7c6b 100644 --- a/lib/isc/unix/app.c +++ b/lib/isc/unix/app.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007-2009, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -107,6 +107,11 @@ ISC_APPFUNC_SCOPE void isc__appctx_setsocketmgr(isc_appctx_t *ctx, isc_socketmgr_t *socketmgr); ISC_APPFUNC_SCOPE void isc__appctx_settimermgr(isc_appctx_t *ctx, isc_timermgr_t *timermgr); +ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxonrun(isc_appctx_t *ctx, + isc_mem_t *mctx, + isc_task_t *task, + isc_taskaction_t action, + void *arg); /* * The application context of this module. This implementation actually @@ -148,8 +153,8 @@ static struct { * The following are defined just for avoiding unused static functions. */ #ifndef BIND9 - void *run, *shutdown, *start, *onrun, *reload, *finish, - *block, *unblock; + void *run, *shutdown, *start, *onrun, + *reload, *finish, *block, *unblock; #endif } appmethods = { { @@ -161,7 +166,8 @@ static struct { isc__app_ctxfinish, isc__appctx_settaskmgr, isc__appctx_setsocketmgr, - isc__appctx_settimermgr + isc__appctx_settimermgr, + isc__app_ctxonrun } #ifndef BIND9 , @@ -387,13 +393,22 @@ ISC_APPFUNC_SCOPE isc_result_t isc__app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, void *arg) { + return (isc__app_ctxonrun((isc_appctx_t *)&isc_g_appctx, mctx, + task, action, arg)); +} + +isc_result_t +isc__app_ctxonrun(isc_appctx_t *ctx0, isc_mem_t *mctx, isc_task_t *task, + isc_taskaction_t action, void *arg) +{ + isc__appctx_t *ctx = (isc__appctx_t *)ctx0; isc_event_t *event; isc_task_t *cloned_task = NULL; isc_result_t result; - LOCK(&isc_g_appctx.lock); + LOCK(&ctx->lock); - if (isc_g_appctx.running) { + if (ctx->running) { result = ISC_R_ALREADYRUNNING; goto unlock; } @@ -410,12 +425,12 @@ isc__app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action, goto unlock; } - ISC_LIST_APPEND(isc_g_appctx.on_run, event, ev_link); + ISC_LIST_APPEND(ctx->on_run, event, ev_link); result = ISC_R_SUCCESS; unlock: - UNLOCK(&isc_g_appctx.lock); + UNLOCK(&ctx->lock); return (result); } diff --git a/lib/isc/unix/include/isc/Makefile.in b/lib/isc/unix/include/isc/Makefile.in index d3b50842..6acad006 100644 --- a/lib/isc/unix/include/isc/Makefile.in +++ b/lib/isc/unix/include/isc/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2007, 2012, 2013 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2001 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -21,7 +21,7 @@ top_srcdir = @top_srcdir@ @BIND9_VERSION@ -HEADERS = dir.h int.h net.h netdb.h offset.h stdtime.h \ +HEADERS = dir.h int.h net.h netdb.h offset.h stat.h stdtime.h \ syslog.h time.h SUBDIRS = diff --git a/lib/isc/win32/include/isc/Makefile.in b/lib/isc/win32/include/isc/Makefile.in index 6b5bcea2..997de397 100644 --- a/lib/isc/win32/include/isc/Makefile.in +++ b/lib/isc/win32/include/isc/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2007, 2012, 2013 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1999-2001 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -22,7 +22,7 @@ top_srcdir = @top_srcdir@ @BIND9_VERSION@ HEADERS = dir.h int.h mutex.h net.h netdb.h once.h \ - stdtime.h thread.h time.h + stat.h stdtime.h thread.h time.h SUBDIRS = TARGETS = diff --git a/lib/isc/win32/include/isc/net.h b/lib/isc/win32/include/isc/net.h index 43e424d8..5ac325b8 100644 --- a/lib/isc/win32/include/isc/net.h +++ b/lib/isc/win32/include/isc/net.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008, 2012, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -189,41 +189,113 @@ typedef isc_uint16_t in_port_t; * Use the WSA constants instead. */ +#include <errno.h> + +#ifndef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK +#endif +#ifndef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS +#endif +#ifndef EALREADY #define EALREADY WSAEALREADY +#endif +#ifndef ENOTSOCK #define ENOTSOCK WSAENOTSOCK +#endif +#ifndef EDESTADDRREQ #define EDESTADDRREQ WSAEDESTADDRREQ +#endif +#ifndef EMSGSIZE #define EMSGSIZE WSAEMSGSIZE +#endif +#ifndef EPROTOTYPE #define EPROTOTYPE WSAEPROTOTYPE +#endif +#ifndef ENOPROTOOPT #define ENOPROTOOPT WSAENOPROTOOPT +#endif +#ifndef EPROTONOSUPPORT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#endif +#ifndef ESOCKTNOSUPPORT #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#endif +#ifndef EOPNOTSUPP #define EOPNOTSUPP WSAEOPNOTSUPP +#endif +#ifndef EPFNOSUPPORT #define EPFNOSUPPORT WSAEPFNOSUPPORT +#endif +#ifndef EAFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT +#endif +#ifndef EADDRINUSE #define EADDRINUSE WSAEADDRINUSE +#endif +#ifndef EADDRNOTAVAIL #define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#endif +#ifndef ENETDOWN #define ENETDOWN WSAENETDOWN +#endif +#ifndef ENETUNREACH #define ENETUNREACH WSAENETUNREACH +#endif +#ifndef ENETRESET #define ENETRESET WSAENETRESET +#endif +#ifndef ECONNABORTED #define ECONNABORTED WSAECONNABORTED +#endif +#ifndef ECONNRESET #define ECONNRESET WSAECONNRESET +#endif +#ifndef ENOBUFS #define ENOBUFS WSAENOBUFS +#endif +#ifndef EISCONN #define EISCONN WSAEISCONN +#endif +#ifndef ENOTCONN #define ENOTCONN WSAENOTCONN +#endif +#ifndef ESHUTDOWN #define ESHUTDOWN WSAESHUTDOWN +#endif +#ifndef ETOOMANYREFS #define ETOOMANYREFS WSAETOOMANYREFS +#endif +#ifndef ETIMEDOUT #define ETIMEDOUT WSAETIMEDOUT +#endif +#ifndef ECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED +#endif +#ifndef ELOOP #define ELOOP WSAELOOP +#endif +#ifndef EHOSTDOWN #define EHOSTDOWN WSAEHOSTDOWN +#endif +#ifndef EHOSTUNREACH #define EHOSTUNREACH WSAEHOSTUNREACH +#endif +#ifndef EPROCLIM #define EPROCLIM WSAEPROCLIM +#endif +#ifndef EUSERS #define EUSERS WSAEUSERS +#endif +#ifndef EDQUOT #define EDQUOT WSAEDQUOT +#endif +#ifndef ESTALE #define ESTALE WSAESTALE +#endif +#ifndef EREMOTE #define EREMOTE WSAEREMOTE +#endif /*** diff --git a/lib/isc/win32/netdb.h b/lib/isc/win32/netdb.h index f8d936a9..02d3c668 100644 --- a/lib/isc/win32/netdb.h +++ b/lib/isc/win32/netdb.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2006, 2007, 2009, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -27,6 +27,7 @@ * Define if <netdb.h> does not declare struct addrinfo. */ +#if _MSC_VER < 1600 struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_family; /* PF_xxx */ @@ -37,6 +38,7 @@ struct addrinfo { struct sockaddr *ai_addr; /* Binary address */ struct addrinfo *ai_next; /* Next structure in linked list */ }; +#endif /* diff --git a/lib/isc/win32/stdio.c b/lib/isc/win32/stdio.c index 427a8e1e..69a1c6f0 100644 --- a/lib/isc/win32/stdio.c +++ b/lib/isc/win32/stdio.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2007, 2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -50,6 +50,7 @@ isc_stdio_close(FILE *f) { isc_result_t isc_stdio_seek(FILE *f, long offset, int whence) { + /* based on the fact off_t is typedef to long */ int r; r = fseek(f, offset, whence); |
