diff options
author | Luke Leighton <lkcl@samba.org> | 2000-04-11 06:42:25 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-04-11 06:42:25 +0000 |
commit | 8ecf7185e2d47d6302f9b3c1ec42146bf16fe503 (patch) | |
tree | 560c5bd794b9fc54ceef8cfe1c5aab5d5fc6dcce | |
parent | 5734a34eda9aba41393c1c07d19584424451d2cb (diff) | |
download | samba-8ecf7185e2d47d6302f9b3c1ec42146bf16fe503.tar.gz samba-8ecf7185e2d47d6302f9b3c1ec42146bf16fe503.tar.xz samba-8ecf7185e2d47d6302f9b3c1ec42146bf16fe503.zip |
nggh! damn select timeout, FD_ISSET... THING.
-rw-r--r-- | source/include/proto.h | 2 | ||||
-rw-r--r-- | source/include/rpc_creds.h | 2 | ||||
-rw-r--r-- | source/lib/util_sock.c | 5 | ||||
-rw-r--r-- | source/msrpc/msrpcd_process.c | 11 | ||||
-rw-r--r-- | source/rpc_parse/parse_creds.c | 8 |
5 files changed, 17 insertions, 11 deletions
diff --git a/source/include/proto.h b/source/include/proto.h index aeb2eaae73b..b955571b5cc 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -768,7 +768,7 @@ BOOL is_a_socket(int fd); void set_socket_options(int fd, char *options); void close_sockets(void); ssize_t write_socket(int fd, char *buf, size_t len); -int write_data_outstanding(int fd, unsigned int time_out); +int write_data_outstanding(int fd, unsigned int time_out, BOOL *more); int read_data_outstanding(int fd, unsigned int time_out); ssize_t read_udp_socket(int fd, char *buf, size_t len); ssize_t read_with_timeout(int fd, char *buf, size_t mincnt, size_t maxcnt, diff --git a/source/include/rpc_creds.h b/source/include/rpc_creds.h index 2b897da6791..f846a8b58ed 100644 --- a/source/include/rpc_creds.h +++ b/source/include/rpc_creds.h @@ -53,7 +53,7 @@ typedef struct unixsec_creds typedef struct user_creds { - BOOL reuse; + uint32 reuse; uint32 ptr_ntc; uint32 ptr_uxc; diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c index 459ab16501d..f751cea7ec8 100644 --- a/source/lib/util_sock.c +++ b/source/lib/util_sock.c @@ -238,7 +238,7 @@ ssize_t write_socket(int fd, char *buf, size_t len) /******************************************************************* checks if write data is outstanding. ********************************************************************/ -int write_data_outstanding(int fd, unsigned int time_out) +int write_data_outstanding(int fd, unsigned int time_out, BOOL *more) { int selrtn; fd_set fds; @@ -256,7 +256,8 @@ int write_data_outstanding(int fd, unsigned int time_out) { return selrtn; } - return FD_ISSET(fd, &fds) ? 1 : 0; + (*more) = FD_ISSET(fd, &fds); + return selrtn; } /******************************************************************* diff --git a/source/msrpc/msrpcd_process.c b/source/msrpc/msrpcd_process.c index 870ce2621a4..92e32cc2169 100644 --- a/source/msrpc/msrpcd_process.c +++ b/source/msrpc/msrpcd_process.c @@ -140,10 +140,11 @@ static void process_msrpc(rpcsrv_struct * l, const char *name, { int selrtn; int timeout = SMBD_SELECT_TIMEOUT * 1000; + BOOL more; smb_read_error = 0; - selrtn = write_data_outstanding(l->c, timeout); + selrtn = write_data_outstanding(l->c, timeout, &more); /* Check if error */ if (selrtn == -1) @@ -159,9 +160,13 @@ static void process_msrpc(rpcsrv_struct * l, const char *name, return; } - if (!msrpc_send(l->c, &l->rsmb_pdu)) + if (more) { - DEBUG(1,("msrpc_send: failed\n")); + if (!msrpc_send(l->c, &l->rsmb_pdu)) + { + prs_free_data(&l->rsmb_pdu); + } + break; } prs_free_data(&l->rsmb_pdu); } diff --git a/source/rpc_parse/parse_creds.c b/source/rpc_parse/parse_creds.c index 29a5bb12f0a..c8c9a4e61ed 100644 --- a/source/rpc_parse/parse_creds.c +++ b/source/rpc_parse/parse_creds.c @@ -287,7 +287,7 @@ void copy_unix_creds(CREDS_UNIX *to, const CREDS_UNIX *from) return; } fstrcpy(to->user_name, from->user_name); -}; +} void copy_unix_sec_creds(CREDS_UNIX_SEC *to, const CREDS_UNIX_SEC *from) { @@ -315,7 +315,7 @@ void copy_unix_sec_creds(CREDS_UNIX_SEC *to, const CREDS_UNIX_SEC *from) to->num_grps = from->num_grps; memcpy(to->grps, from->grps, size); } -}; +} void copy_nt_creds(struct ntuser_creds *to, const struct ntuser_creds *from) @@ -337,7 +337,7 @@ void copy_nt_creds(struct ntuser_creds *to, DEBUG(10,("copy_nt_creds: user %s domain %s nopw %s flgs: %x\n", to->user_name, to->domain, BOOLSTR(pwd_is_nullpwd(&to->pwd)), to->ntlmssp_flags)); -}; +} void copy_user_creds(struct user_creds *to, const struct user_creds *from) @@ -386,7 +386,7 @@ void copy_user_creds(struct user_creds *to, { copy_unix_sec_creds(&to->uxs, &from->uxs); } -}; +} void free_user_creds(struct user_creds *creds) { |