[SCM] Samba Shared Repository - branch v4-0-test updated -
release-4-0-0alpha6-1252-g76a0050
Andrew Bartlett
abartlet at samba.org
Thu Feb 26 02:17:57 GMT 2009
The branch, v4-0-test has been updated
via 76a0050e239b1fb9e2135f2e6cea80ed780a0ee0 (commit)
via 59a28a22ab26bb7f2c12f9bccda9c7f585d992a7 (commit)
via a6d0a93fc27729b63ae3fd4994059f3854a63845 (commit)
via 9e54f4151cf0e5d958f1929d854d082635b11c39 (commit)
via 7e01ec5560e8193c8e8853ba49c0ee625956c1fd (commit)
via 8bf0c256d7f06fe7d0abf031921abd83e6956c8b (commit)
via 9b8bb1ad957f9c2d91e55ac6a27657cd8f6d4a14 (commit)
via 228e75112ffe4124748e80d6571ddde4df22881f (commit)
via e17df483fbedb81aededdef5fbb6ae1d034bc2dd (commit)
via 95e428e2279b706ac590ffb964fda07fd1ee2200 (commit)
via 7f33b947e3c770f96f46fc9466376cd3c7825cd4 (commit)
via 01493737c88c0056ca3da5faf43b7bc9b9a2fbcb (commit)
via 76ca297ecfd1086b38487ac8f53a8392a4a38ad6 (commit)
via a4e570e3cedf284ee83853415176e4dcccc105cb (commit)
via bfc7ec9e4a35e8ad64205e56cd0e621b41740efb (commit)
via 3d7cde5dd3603ba3a7e78e8ca9a28d5bbf816b80 (commit)
via d86cb9b52d8cdaa03f856665f56278836e6336d3 (commit)
via 03efdcb7cb55f61d2b8cf419b25ed6d1eac1d3af (commit)
via 820a1c1a17f3848fafd796a54e0b2eeb886aef2e (commit)
via 6cd30a351a13822a557f20de3abe04bd8b2e3112 (commit)
via 666cc916ebea618fbf7bfed99dbfff38326189fa (commit)
via a045dd063d24d004f66c3b11ca11ebf665639971 (commit)
via 06d2604d9d1f77dddc1408233da48f0958bb24d0 (commit)
via b239a4ee76ec424f09a74ae65bbddeba71026141 (commit)
via 92f05e3c96a412d50cf8733d393464acb1d702fd (commit)
via 74232e323762abc8fbdc2a6a28c6e77b0020c304 (commit)
via f90250b54923588d756a02e76876fc66a6c68074 (commit)
via 15f108f0917eedab89199e9fbf93ed802eed7f89 (commit)
via d7c7b31bbaf110446ea835b66845ab6f0ee09231 (commit)
via fd3f3e68f2e6be0196473f641f8edb41e40ca761 (commit)
via 59cc0c09d5413d1264758bef505856f5f56131e4 (commit)
via 838b950138255beb7135a32d4429a74fec2bfe42 (commit)
via f71db89256b65c3700eadaf44b2727623eb831fa (commit)
via b6457c78d61992f12903ed0966d9d1608de68da8 (commit)
via 2bd8cacf0e5ed6965f5791c4a86320d4978d9b15 (commit)
via 543db0f94aa4cdeb6499f62aee8791cda7a670d7 (commit)
via fc3ffedcfe173900d65f6fa7db3a3cf2608f9f68 (commit)
via e2f37ec106fb51ec894e0d6160949545e80dfe69 (commit)
via 01d1aaf63e8170936139a01814211f6567c4b125 (commit)
via 80a9a41d412aa61877a7497661197fd16ddb4903 (commit)
via c46fad3d1bdf1082a695d3df90e55e739e494a5c (commit)
via 2390ea274bff7a8878a488db0893a393c9d1b51e (commit)
via 13ac0dc4565b1cbdb977b6959562f3f8f9ac5ff8 (commit)
via 5bab95b58366ff001b4967bdb0674f42dc990a77 (commit)
via 06b018767b6e6f3ee0221c3aee142cb2b4836fc9 (commit)
via 423c1d88fcd0f128bceaf8b0c371281aa4a41003 (commit)
via be4913fbe6f6bb2fefbeeb1559692e04a15758f9 (commit)
via 00ad0c4a4317db810bf2197503006ae5a6bb8bce (commit)
via d1c7bbd893c27ebff28571b4ea611bd3e35148c1 (commit)
via 258ae4cec596631b758fb17c170c4494e4db8a8e (commit)
via a041d9061922b1a90e5b5047af77934d908afdd5 (commit)
via 59e90d3715a577503434ace9e01bfe63dfcfa714 (commit)
via c03f2072762d91240fe90a2f02542e521313e7ef (commit)
via c7ba20b465e4c2bf893891ab7ace8172704bb27c (commit)
via 109ba07b0e2ce45cc0a960bcafd0e8d28c877ae3 (commit)
via f8af5130d5515e017330a2123b933109599e072c (commit)
via 1a77218dca0222aafff81aae6cd17462706e226e (commit)
via 6366084c4a7aa4845816cef6f1782e9d1c1f138c (commit)
via 9e3178e8387cd85858a145bb4918073f91127d20 (commit)
via 9d165fa5c69d3c98d1a76a155bb794a7e4c9744a (commit)
via 24a63add2d92afa0084fec956df7508ea28aab89 (commit)
via 4823e988b6360646931f9b6369bf7b8f512069a8 (commit)
via eb5efd1978acd38cf6cc97e067b5105743ca5469 (commit)
via 662f996b1554508baf7344b8618f152c179f1680 (commit)
via dc0e46afb7018a1da666729c6d61e8ea85dcf07d (commit)
via 2f1b12890a31baceee6a4d446b4782caefb1fcaa (commit)
via c2cdb4ad5c9398ef0d3310613107999f8d33c7ce (commit)
via afc7e45a4ccf8505e4c598334e339e79ba036057 (commit)
via d75df717336e063f52af1415f99b6e16ccbf918c (commit)
via fff055f8e33a8f0bbb5e7cc5b77d6251bf37e0cf (commit)
via b9cf189404d5ef6b0a2440dc5f9670f0f6d0c131 (commit)
via dcb2e7d57718ebd3db75999819ec8ef507f9dd7b (commit)
via 10c047c6f4c0f6b9fdebbdf133a3bd72aa8776de (commit)
from d8b70278e20b276566a3893d288101ff4826df61 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test
- Log -----------------------------------------------------------------
commit 76a0050e239b1fb9e2135f2e6cea80ed780a0ee0
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Feb 26 13:12:07 2009 +1100
A simple hack to avoid the segfault in #6138
Thanks to Andrew Kroeger <andrew at id10ts.net> for reporting this. This
fix just for the release. A better fix will make it into the master
branch soon.
Andrew Bartlett
-----------------------------------------------------------------------
Summary of changes:
WHATSNEW4.txt | 9 +-
lib/async_req/async_sock.c | 300 --------
lib/async_req/async_sock.h | 11 -
lib/tdb/common/open.c | 5 +
lib/tevent/tevent.h | 16 +-
lib/tevent/tevent_req.c | 42 +-
librpc/gen_ndr/dfs.h | 2 +
librpc/gen_ndr/drsblobs.h | 2 +
librpc/gen_ndr/drsuapi.h | 2 +
librpc/gen_ndr/dssetup.h | 2 +
librpc/gen_ndr/echo.h | 2 +
librpc/gen_ndr/epmapper.h | 2 +
librpc/gen_ndr/eventlog.h | 2 +
librpc/gen_ndr/initshutdown.h | 2 +
librpc/gen_ndr/krb5pac.h | 2 +
librpc/gen_ndr/lsa.h | 2 +
librpc/gen_ndr/misc.h | 2 +
librpc/gen_ndr/named_pipe_auth.h | 2 +
librpc/gen_ndr/nbt.h | 2 +
librpc/gen_ndr/ndr_spoolss.c | 521 +++++++++++++-
librpc/gen_ndr/ndr_spoolss.h | 3 +
librpc/gen_ndr/netlogon.h | 2 +
librpc/gen_ndr/ntsvcs.h | 2 +
librpc/gen_ndr/samr.h | 2 +
librpc/gen_ndr/security.h | 2 +
librpc/gen_ndr/spoolss.h | 36 +
librpc/gen_ndr/srvsvc.h | 2 +
librpc/gen_ndr/svcctl.h | 2 +
librpc/gen_ndr/winreg.h | 2 +
librpc/gen_ndr/wkssvc.h | 2 +
librpc/gen_ndr/xattr.h | 2 +
librpc/idl/spoolss.idl | 39 +-
pidl/lib/Parse/Pidl/Samba4/Header.pm | 3 +
pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 2 +
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 2 +
pidl/lib/Parse/Pidl/Samba4/Python.pm | 19 +-
source3/auth/auth_wbc.c | 2 +-
source3/client/mount.cifs.c | 4 +-
source3/include/proto.h | 54 +-
source3/include/rpc_spoolss.h | 127 ----
source3/lib/events.c | 2 +-
source3/lib/fault.c | 173 ++++-
source3/modules/onefs.h | 32 +-
source3/modules/onefs_acl.c | 2 +-
source3/modules/onefs_streams.c | 2 +-
source3/modules/onefs_system.c | 50 ++
source3/modules/vfs_acl_tdb.c | 89 ++-
source3/modules/vfs_acl_xattr.c | 12 +-
source3/modules/vfs_onefs.c | 144 +++-
source3/modules/vfs_streams_depot.c | 14 +-
source3/modules/vfs_streams_xattr.c | 15 +-
source3/passdb/pdb_wbc_sam.c | 4 +-
source3/printing/nt_printing.c | 6 +-
source3/rpc_client/cli_spoolss.c | 269 +++-----
source3/rpc_client/rpc_transport_sock.c | 110 +++-
source3/rpc_parse/parse_spoolss.c | 832 ---------------------
source3/rpc_server/srv_spoolss_nt.c | 66 +-
source3/rpcclient/cmd_netlogon.c | 44 ++
source3/rpcclient/cmd_samr.c | 32 +-
source3/rpcclient/cmd_spoolss.c | 378 ++++++----
source3/smbd/close.c | 22 +-
source3/smbd/reply.c | 2 +-
source3/smbd/trans2.c | 2 +
source3/utils/net_rpc_printer.c | 276 ++++---
source4/build/m4/public.m4 | 7 +
source4/heimdal_build/internal.m4 | 6 +
source4/heimdal_build/internal.mk | 2 +-
source4/lib/events/tevent_s4.c | 2 +-
source4/lib/ldb/include/ldb.h | 11 +-
source4/ntptr/ntptr.h | 3 +
source4/ntptr/ntptr_interface.c | 9 +
source4/ntptr/simple_ldb/ntptr_simple_ldb.c | 43 ++
source4/rpc_server/netlogon/dcerpc_netlogon.c | 2 +-
source4/rpc_server/spoolss/dcesrv_spoolss.c | 20 +-
source4/scripting/python/samba/__init__.py | 2 +-
source4/scripting/python/samba/provision.py | 4 +-
source4/scripting/python/samba/samdb.py | 10 +-
source4/scripting/python/samba/tests/__init__.py | 4 +-
source4/scripting/python/samba/tests/provision.py | 2 +-
source4/torture/rpc/spoolss.c | 167 ++++-
80 files changed, 2086 insertions(+), 2025 deletions(-)
Changeset truncated at 500 lines:
diff --git a/WHATSNEW4.txt b/WHATSNEW4.txt
index 2093a4e..7c637cc 100644
--- a/WHATSNEW4.txt
+++ b/WHATSNEW4.txt
@@ -69,8 +69,11 @@ In the time since Samba4 alpha6 was released in Janurary 2009, Samba has
continued to evolve, but you may particularly notice these areas
(in no particular order):
- OpenLDAP Multi Master Replication can now also replicate the OpenLDAP
- configuration itself.
+ Multi Master Replication (MMR) configuration can now be generated
+ for the OpenLDAP-Backend.
+
+ OpenLDAP-Online-Configuration (olc) can now be generated for the
+ OpenLDAP-Backend. (OpenLDAP-Versions >=2.4.15 required).
Support for Windows 7 beta as a member of the Samba4 domain
@@ -83,6 +86,8 @@ continued to evolve, but you may particularly notice these areas
the corrected IDL back into Samba4
Fixes to allow use of C++ compilers and to increase portability
+
+ Fixed TLS (SSL) support with modern versions of GnuTLS
These are just some of the highlights of the work done in the past
month. More details can be found in our GIT history.
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index 3563421..40e7bca 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -30,45 +30,6 @@
#endif
/**
- * Discriminator for async_syscall_state
- */
-enum async_syscall_type {
- ASYNC_SYSCALL_SEND,
- ASYNC_SYSCALL_RECV,
-};
-
-/**
- * Holder for syscall arguments and the result
- */
-
-struct async_syscall_state {
- enum async_syscall_type syscall_type;
- struct tevent_fd *fde;
-
- union {
- struct param_send {
- int fd;
- const void *buffer;
- size_t length;
- int flags;
- } param_send;
- struct param_recv {
- int fd;
- void *buffer;
- size_t length;
- int flags;
- } param_recv;
- } param;
-
- union {
- ssize_t result_ssize_t;
- size_t result_size_t;
- int result_int;
- } result;
- int sys_errno;
-};
-
-/**
* @brief Map async_req states to unix-style errnos
* @param[in] req The async req to get the state from
* @param[out] err Pointer to take the unix-style errno
@@ -117,267 +78,6 @@ int async_req_simple_recv_errno(struct async_req *req)
return 0;
}
-/**
- * @brief Create a new async syscall req
- * @param[in] mem_ctx The memory context to hang the result off
- * @param[in] ev The event context to work from
- * @param[in] type Which syscall will this be
- * @param[in] pstate Where to put the newly created private_data state
- * @retval The new request
- *
- * This is a helper function to prepare a new struct async_req with an
- * associated struct async_syscall_state. The async_syscall_state will be put
- * into the async_req as private_data.
- */
-
-static struct async_req *async_syscall_new(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- enum async_syscall_type type,
- struct async_syscall_state **pstate)
-{
- struct async_req *result;
- struct async_syscall_state *state;
-
- if (!async_req_setup(mem_ctx, &result, &state,
- struct async_syscall_state)) {
- return NULL;
- }
- state->syscall_type = type;
-
- result->private_data = state;
-
- *pstate = state;
-
- return result;
-}
-
-/**
- * @brief Create a new async syscall req based on a fd
- * @param[in] mem_ctx The memory context to hang the result off
- * @param[in] ev The event context to work from
- * @param[in] type Which syscall will this be
- * @param[in] fd The file descriptor we work on
- * @param[in] fde_flags TEVENT_FD_READ/WRITE -- what are we interested in?
- * @param[in] fde_cb The callback function for the file descriptor event
- * @param[in] pstate Where to put the newly created private_data state
- * @retval The new request
- *
- * This is a helper function to prepare a new struct async_req with an
- * associated struct async_syscall_state and an associated file descriptor
- * event.
- */
-
-static struct async_req *async_fde_syscall_new(
- TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- enum async_syscall_type type,
- int fd,
- uint16_t fde_flags,
- void (*fde_cb)(struct tevent_context *ev,
- struct tevent_fd *fde, uint16_t flags,
- void *priv),
- struct async_syscall_state **pstate)
-{
- struct async_req *result;
- struct async_syscall_state *state;
-
- result = async_syscall_new(mem_ctx, ev, type, &state);
- if (result == NULL) {
- return NULL;
- }
-
- state->fde = tevent_add_fd(ev, state, fd, fde_flags, fde_cb, result);
- if (state->fde == NULL) {
- TALLOC_FREE(result);
- return NULL;
- }
- *pstate = state;
- return result;
-}
-
-/**
- * Retrieve a ssize_t typed result from an async syscall
- * @param[in] req The syscall that has just finished
- * @param[out] perrno Where to put the syscall's errno
- * @retval The return value from the asynchronously called syscall
- */
-
-ssize_t async_syscall_result_ssize_t(struct async_req *req, int *perrno)
-{
- struct async_syscall_state *state = talloc_get_type_abort(
- req->private_data, struct async_syscall_state);
-
- *perrno = state->sys_errno;
- return state->result.result_ssize_t;
-}
-
-/**
- * Retrieve a size_t typed result from an async syscall
- * @param[in] req The syscall that has just finished
- * @param[out] perrno Where to put the syscall's errno
- * @retval The return value from the asynchronously called syscall
- */
-
-size_t async_syscall_result_size_t(struct async_req *req, int *perrno)
-{
- struct async_syscall_state *state = talloc_get_type_abort(
- req->private_data, struct async_syscall_state);
-
- *perrno = state->sys_errno;
- return state->result.result_size_t;
-}
-
-/**
- * Retrieve a int typed result from an async syscall
- * @param[in] req The syscall that has just finished
- * @param[out] perrno Where to put the syscall's errno
- * @retval The return value from the asynchronously called syscall
- */
-
-int async_syscall_result_int(struct async_req *req, int *perrno)
-{
- struct async_syscall_state *state = talloc_get_type_abort(
- req->private_data, struct async_syscall_state);
-
- *perrno = state->sys_errno;
- return state->result.result_int;
-}
-
-/**
- * fde event handler for the "send" syscall
- * @param[in] ev The event context that sent us here
- * @param[in] fde The file descriptor event associated with the send
- * @param[in] flags Can only be TEVENT_FD_WRITE here
- * @param[in] priv private data, "struct async_req *" in this case
- */
-
-static void async_send_callback(struct tevent_context *ev,
- struct tevent_fd *fde, uint16_t flags,
- void *priv)
-{
- struct async_req *req = talloc_get_type_abort(
- priv, struct async_req);
- struct async_syscall_state *state = talloc_get_type_abort(
- req->private_data, struct async_syscall_state);
- struct param_send *p = &state->param.param_send;
-
- if (state->syscall_type != ASYNC_SYSCALL_SEND) {
- async_req_error(req, EIO);
- return;
- }
-
- state->result.result_ssize_t = send(p->fd, p->buffer, p->length,
- p->flags);
- state->sys_errno = errno;
-
- TALLOC_FREE(state->fde);
-
- async_req_done(req);
-}
-
-/**
- * Async version of send(2)
- * @param[in] mem_ctx The memory context to hang the result off
- * @param[in] ev The event context to work from
- * @param[in] fd The socket to send to
- * @param[in] buffer The buffer to send
- * @param[in] length How many bytes to send
- * @param[in] flags flags passed to send(2)
- *
- * This function is a direct counterpart of send(2)
- */
-
-struct async_req *async_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- int fd, const void *buffer, size_t length,
- int flags)
-{
- struct async_req *result;
- struct async_syscall_state *state;
-
- result = async_fde_syscall_new(
- mem_ctx, ev, ASYNC_SYSCALL_SEND,
- fd, TEVENT_FD_WRITE, async_send_callback,
- &state);
- if (result == NULL) {
- return NULL;
- }
-
- state->param.param_send.fd = fd;
- state->param.param_send.buffer = buffer;
- state->param.param_send.length = length;
- state->param.param_send.flags = flags;
-
- return result;
-}
-
-/**
- * fde event handler for the "recv" syscall
- * @param[in] ev The event context that sent us here
- * @param[in] fde The file descriptor event associated with the recv
- * @param[in] flags Can only be TEVENT_FD_READ here
- * @param[in] priv private data, "struct async_req *" in this case
- */
-
-static void async_recv_callback(struct tevent_context *ev,
- struct tevent_fd *fde, uint16_t flags,
- void *priv)
-{
- struct async_req *req = talloc_get_type_abort(
- priv, struct async_req);
- struct async_syscall_state *state = talloc_get_type_abort(
- req->private_data, struct async_syscall_state);
- struct param_recv *p = &state->param.param_recv;
-
- if (state->syscall_type != ASYNC_SYSCALL_RECV) {
- async_req_error(req, EIO);
- return;
- }
-
- state->result.result_ssize_t = recv(p->fd, p->buffer, p->length,
- p->flags);
- state->sys_errno = errno;
-
- TALLOC_FREE(state->fde);
-
- async_req_done(req);
-}
-
-/**
- * Async version of recv(2)
- * @param[in] mem_ctx The memory context to hang the result off
- * @param[in] ev The event context to work from
- * @param[in] fd The socket to recv from
- * @param[in] buffer The buffer to recv into
- * @param[in] length How many bytes to recv
- * @param[in] flags flags passed to recv(2)
- *
- * This function is a direct counterpart of recv(2)
- */
-
-struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- int fd, void *buffer, size_t length,
- int flags)
-{
- struct async_req *result;
- struct async_syscall_state *state;
-
- result = async_fde_syscall_new(
- mem_ctx, ev, ASYNC_SYSCALL_RECV,
- fd, TEVENT_FD_READ, async_recv_callback,
- &state);
-
- if (result == NULL) {
- return NULL;
- }
-
- state->param.param_recv.fd = fd;
- state->param.param_recv.buffer = buffer;
- state->param.param_recv.length = length;
- state->param.param_recv.flags = flags;
-
- return result;
-}
-
struct async_send_state {
int fd;
const void *buf;
diff --git a/lib/async_req/async_sock.h b/lib/async_req/async_sock.h
index bfc4346..e001709 100644
--- a/lib/async_req/async_sock.h
+++ b/lib/async_req/async_sock.h
@@ -25,17 +25,6 @@
bool async_req_is_errno(struct async_req *req, int *err);
int async_req_simple_recv_errno(struct async_req *req);
-ssize_t async_syscall_result_ssize_t(struct async_req *req, int *perrno);
-size_t async_syscall_result_size_t(struct async_req *req, int *perrno);
-int async_syscall_result_int(struct async_req *req, int *perrno);
-
-struct async_req *async_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- int fd, const void *buffer, size_t length,
- int flags);
-struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- int fd, void *buffer, size_t length,
- int flags);
-
struct tevent_req *async_send_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
int fd, const void *buf, size_t len,
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index b19e4ce..e58c8ca 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -461,6 +461,10 @@ fail:
/* reopen all tdb's */
int tdb_reopen_all(int parent_longlived)
{
+#if defined(LIBREPLACE_PREAD_NOT_REPLACED) && \
+ defined(LIBREPLACE_PWRITE_NOT_REPLACED)
+ return 0;
+#else
struct tdb_context *tdb;
for (tdb=tdbs; tdb; tdb = tdb->next) {
@@ -483,6 +487,7 @@ int tdb_reopen_all(int parent_longlived)
if (tdb_reopen(tdb) != 0)
return -1;
}
+#endif
return 0;
}
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 33747f0..185a8fa 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -31,7 +31,7 @@
#include <stdint.h>
#include <talloc.h>
#include <sys/time.h>
-#include <../lib/replace/replace.h>
+#include <stdbool.h>
struct tevent_context;
struct tevent_ops;
@@ -212,6 +212,15 @@ struct tevent_req {
void *private_state;
/**
+ * @brief A function to overwrite the default print function
+ *
+ * The implementation doing the work may want to imeplement a
+ * custom function to print the text representation of the async
+ * request.
+ */
+ char *(*private_print)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+
+ /**
* @brief Internal state of the request
*
* Callers should only access this via functions and never directly.
@@ -267,6 +276,8 @@ struct tevent_req {
} internal;
};
+char *tevent_req_default_print(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+
char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req);
struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
@@ -296,6 +307,9 @@ struct tevent_req *tevent_req_post(struct tevent_req *req,
bool tevent_req_is_in_progress(struct tevent_req *req);
+bool tevent_req_poll(struct tevent_req *req,
+ struct tevent_context *ev);
+
bool tevent_req_is_error(struct tevent_req *req,
enum tevent_req_state *state,
uint64_t *error);
diff --git a/lib/tevent/tevent_req.c b/lib/tevent/tevent_req.c
index 800e385..e243c7d 100644
--- a/lib/tevent/tevent_req.c
+++ b/lib/tevent/tevent_req.c
@@ -28,14 +28,17 @@
#include "tevent_util.h"
/**
- * @brief Print an tevent_req structure in debug messages
- * @param[in] mem_ctx The memory context for the result
+ * @brief The default print function for creating debug messages
* @param[in] req The request to be printed
+ * @param[in] mem_ctx The memory context for the result
* @retval Text representation of req
*
+ * The function should not be used by users of the asynx API,
+ * but custom print function can use it and append custom text
+ * to the string.
*/
-char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req)
+char *tevent_req_default_print(struct tevent_req *req, TALLOC_CTX *mem_ctx)
{
return talloc_asprintf(mem_ctx,
"tevent_req[%p/%s]: state[%d] error[%lld (0x%llX)] "
@@ -51,6 +54,24 @@ char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req)
}
/**
+ * @brief Print an tevent_req structure in debug messages
+ * @param[in] mem_ctx The memory context for the result
+ * @param[in] req The request to be printed
+ * @retval Text representation of req
+ *
+ * This function should be used by callers of the async API
+ */
+
+char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req)
+{
+ if (!req->private_print) {
+ return tevent_req_default_print(req, mem_ctx);
+ }
+
+ return req->private_print(req, mem_ctx);
+}
+
+/**
* @brief Create an async request
* @param[in] mem_ctx The memory context for the result
* @param[in] ev The event context this async request will be driven by
@@ -235,6 +256,21 @@ bool tevent_req_is_in_progress(struct tevent_req *req)
return false;
}
+bool tevent_req_poll(struct tevent_req *req,
+ struct tevent_context *ev)
+{
+ while (tevent_req_is_in_progress(req)) {
+ int ret;
+
+ ret = tevent_loop_once(ev);
+ if (ret != 0) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list