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

Use a separate global for nonblocking socket testing rather than global_loadparm.

This commit is contained in:
Jelmer Vernooij 2008-11-02 01:15:42 +01:00
parent a76adc5397
commit 9265cb02d0
3 changed files with 8 additions and 1 deletions

View File

@ -25,6 +25,8 @@
#include "system/network.h" #include "system/network.h"
#include "param/param.h" #include "param/param.h"
bool testnonblock = false;
/* /*
auto-close sockets on free auto-close sockets on free
*/ */
@ -70,7 +72,7 @@ _PUBLIC_ NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socke
if (!(flags & SOCKET_FLAG_BLOCK) && if (!(flags & SOCKET_FLAG_BLOCK) &&
type == SOCKET_TYPE_STREAM && type == SOCKET_TYPE_STREAM &&
lp_parm_bool(global_loadparm, NULL, "socket", "testnonblock", false)) { testnonblock) {
(*new_sock)->flags |= SOCKET_FLAG_TESTNONBLOCK; (*new_sock)->flags |= SOCKET_FLAG_TESTNONBLOCK;
} }

View File

@ -208,4 +208,6 @@ NTSTATUS socket_connect_multi(TALLOC_CTX *mem_ctx, const char *server_address,
void set_socket_options(int fd, const char *options); void set_socket_options(int fd, const char *options);
void socket_set_flags(struct socket_context *socket, unsigned flags); void socket_set_flags(struct socket_context *socket, unsigned flags);
extern bool testnonblock;
#endif /* _SAMBA_SOCKET_H */ #endif /* _SAMBA_SOCKET_H */

View File

@ -65,6 +65,7 @@
#include "param/loadparm.h" #include "param/loadparm.h"
#include "libcli/raw/libcliraw.h" #include "libcli/raw/libcliraw.h"
#include "rpc_server/common/common.h" #include "rpc_server/common/common.h"
#include "lib/socket/socket.h"
#define standard_sub_basic talloc_strdup #define standard_sub_basic talloc_strdup
@ -2475,6 +2476,8 @@ bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
reload_charcnv(lp_ctx); reload_charcnv(lp_ctx);
testnonblock = lp_parm_bool(lp_ctx, NULL, "socket", "testnonblock", false);
/* FIXME: Check locale in environment for this: */ /* FIXME: Check locale in environment for this: */
if (strcmp(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)) != 0) if (strcmp(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)) != 0)
d_set_iconv(smb_iconv_open(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx))); d_set_iconv(smb_iconv_open(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)));