1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

libwbclient: Add async call framework.

This commit is contained in:
Kai Blin 2009-04-16 14:53:36 +02:00
parent 590a3afc8a
commit 57ea909b32
19 changed files with 75 additions and 16 deletions

View File

@ -426,7 +426,7 @@ static void writev_handler(struct tevent_context *ev, struct tevent_fd *fde,
to_write += state->iov[i].iov_len;
}
written = sys_writev(state->fd, state->iov, state->count);
written = writev(state->fd, state->iov, state->count);
if (written == -1) {
tevent_req_error(req, errno);
return;
@ -570,7 +570,7 @@ static void read_packet_handler(struct tevent_context *ev,
return;
}
tmp = TALLOC_REALLOC_ARRAY(state, state->buf, uint8_t, total+more);
tmp = talloc_realloc(state, state->buf, uint8_t, total+more);
if (tevent_req_nomem(tmp, req)) {
return;
}

View File

@ -1,3 +1,4 @@
[SUBSYSTEM::LIBASYNC_REQ]
PUBLIC_DEPENDENCIES = LIBREPLACE_NETWORK
LIBASYNC_REQ_OBJ_FILES = $(addprefix ../lib/async_req/, async_sock.o)

View File

@ -26,7 +26,11 @@ PRIVATE_DEPENDENCIES = \
LIBCLI_AUTH \
LIBPOPT \
POPT_SAMBA \
LIBWINBIND-CLIENT
LIBWINBIND-CLIENT \
LIBWBCLIENT \
LIBTEVENT \
UTIL_TEVENT \
LIBASYNC_REQ
# End BINARY nsstest
#################################

View File

@ -0,0 +1,15 @@
[SUBSYSTEM::LIBWBCLIENT]
PUBLIC_DEPENDENCIES = LIBASYNC_REQ \
LIBTEVENT \
LIBTALLOC \
UTIL_TEVENT
LIBWBCLIENT_OBJ_FILES = $(addprefix $(libwbclientsrcdir)/, wbc_async.o \
wbc_guid.o \
wbc_idmap.o \
wbclient.o \
wbc_pam.o \
wbc_pwd.o \
wbc_sid.o \
wbc_util.o \
wb_reqtrans.o )

View File

@ -36,6 +36,7 @@
/* Public headers */
#include "wbclient.h"
#include "wbc_async.h"
/* Private headers */

View File

@ -23,11 +23,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "wbc_async.h"
#include "replace.h"
#include "system/filesys.h"
#include "system/network.h"
#include <talloc.h>
#include <tevent.h>
struct fd_event;
struct event_context;
#include "lib/async_req/async_sock.h"
#include "lib/util/tevent_unix.h"
#include "nsswitch/winbind_struct_protocol.h"
#include "nsswitch/libwbclient/wbclient.h"
#include "nsswitch/libwbclient/wbc_async.h"
#ifdef DBGC_CLASS
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
#endif
struct req_read_state {
struct winbindd_request *wb_req;

View File

@ -21,8 +21,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "wbc_async.h"
#include "replace.h"
#include "system/filesys.h"
#include "system/network.h"
#include <talloc.h>
#include <tevent.h>
struct fd_event;
struct event_context;
#include "lib/async_req/async_sock.h"
#include "nsswitch/winbind_struct_protocol.h"
#include "nsswitch/libwbclient/wbclient.h"
#include "nsswitch/libwbclient/wbc_async.h"
wbcErr map_wbc_err_from_errno(int error)
{

View File

@ -24,9 +24,13 @@
#ifndef _WBC_ASYNC_H_
#define _WBC_ASYNC_H_
#include <talloc.h>
#include <tevent.h>
#include "nsswitch/libwbclient/wbclient.h"
struct wb_context;
struct winbindd_request;
struct winbindd_response;
struct tevent_req *wb_trans_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,

View File

@ -22,6 +22,8 @@
/* Required Headers */
#include "lib/talloc/talloc.h"
#include "lib/tevent/tevent.h"
#include "libwbclient.h"
/* From wb_common.c */

View File

@ -28,5 +28,4 @@ wbcErr wbcRequestResponse(int cmd,
struct winbindd_request *request,
struct winbindd_response *response);
#endif /* _WBCLIENT_INTERNAL_H */

View File

@ -15,6 +15,11 @@
#define SAFE_FREE(x) do { if(x) {free(x); x=NULL;} } while(0)
#endif
#ifndef FSTRING_LEN
#define FSTRING_LEN 256
typedef char fstring[FSTRING_LEN];
#endif
#ifndef _WINBINDD_NTDOM_H
#define _WINBINDD_NTDOM_H

View File

@ -992,7 +992,7 @@ SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/uta
SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \
$(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
lib/wb_reqtrans.o lib/wbclient.o \
@LIBWBCLIENT_STATIC@ \
$(LIBNDR_GEN_OBJ0)
MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIENT_OBJ) \
@ -1876,7 +1876,10 @@ LIBWBCLIENT_OBJ0 = ../nsswitch/libwbclient/wbclient.o \
../nsswitch/libwbclient/wbc_idmap.o \
../nsswitch/libwbclient/wbc_sid.o \
../nsswitch/libwbclient/wbc_guid.o \
../nsswitch/libwbclient/wbc_pam.o
../nsswitch/libwbclient/wbc_pam.o \
../nsswitch/libwbclient/wb_reqtrans.o \
../nsswitch/libwbclient/wbc_async.o
LIBWBCLIENT_OBJ = $(LIBWBCLIENT_OBJ0) \
$(WBCOMMON_OBJ) \
$(LIBREPLACE_OBJ)
@ -1887,7 +1890,8 @@ LIBWBCLIENT_SHARED_TARGET_SONAME=$(LIBWBCLIENT_SHARED_TARGET).$(LIBWBCLIENT_SOVE
LIBWBCLIENT_STATIC_TARGET=@LIBWBCLIENT_STATIC_TARGET@
LIBWBCLIENT=@LIBWBCLIENT_STATIC@ @LIBWBCLIENT_SHARED@
LIBWBCLIENT_SYMS=$(srcdir)/exports/libwbclient.@SYMSEXT@
LIBWBCLIENT_HEADERS=$(srcdir)/../nsswitch/libwbclient/wbclient.h
LIBWBCLIENT_HEADERS=$(srcdir)/../nsswitch/libwbclient/wbclient.h \
$(srcdir)/../nsswitch/libwbclient/wbc_async.h
$(LIBWBCLIENT_SYMS): $(LIBWBCLIENT_HEADERS)
@$(MKSYMS_SH) $(AWK) $@ $(LIBWBCLIENT_HEADERS)

View File

@ -74,6 +74,7 @@ clustersrcdir := $(samba4srcdir)/cluster
libnetsrcdir := $(samba4srcdir)/libnet
authsrcdir := $(samba4srcdir)/auth
nsswitchsrcdir := $(samba4srcdir)/../nsswitch
libwbclientsrcdir := $(nsswitchsrcdir)/libwbclient
libsrcdir := $(samba4srcdir)/lib
libsocketsrcdir := $(samba4srcdir)/lib/socket
libcharsetsrcdir := $(samba4srcdir)/../lib/util/charset

View File

@ -18,7 +18,7 @@
*/
#include "includes.h"
#include "wbc_async.h"
#include "nsswitch/libwbclient/wbc_async.h"
extern char *optarg;
extern int optind;

View File

@ -58,6 +58,7 @@ clustersrcdir := cluster
libnetsrcdir := libnet
authsrcdir := auth
nsswitchsrcdir := ../nsswitch
libwbclientsrcdir := ../nsswitch/libwbclient
libsrcdir := lib
libsocketsrcdir := lib/socket
libcharsetsrcdir := ../lib/util/charset

View File

@ -1,5 +1,5 @@
[SUBSYSTEM::LIBWBCLIENT]
[SUBSYSTEM::LIBWBCLIENT_OLD]
PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBEVENTS
PRIVATE_DEPENDENCIES = NDR_WINBIND MESSAGING
LIBWBCLIENT_OBJ_FILES = $(libclisrcdir)/wbclient/wbclient.o
LIBWBCLIENT_OLD_OBJ_FILES = $(libclisrcdir)/wbclient/wbclient.o

View File

@ -7,6 +7,7 @@ mkinclude smbd/process_model.mk
mkinclude libnet/config.mk
mkinclude auth/config.mk
mkinclude ../nsswitch/config.mk
mkinclude ../nsswitch/libwbclient/config.mk
mkinclude lib/samba3/config.mk
mkinclude lib/socket/config.mk
mkinclude ../lib/util/charset/config.mk

View File

@ -42,7 +42,7 @@ OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = ntvfs_posix_init
#PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4
PRIVATE_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING \
LIBWBCLIENT pvfs_acl pvfs_aio
LIBWBCLIENT_OLD pvfs_acl pvfs_aio
# End MODULE ntvfs_posix
################################################

View File

@ -85,7 +85,7 @@ PRIVATE_DEPENDENCIES = \
SAMDB \
NDR_UNIXINFO \
NSS_WRAPPER \
LIBWBCLIENT
LIBWBCLIENT_OLD
# End MODULE dcerpc_unixinfo
################################################