Commit Graph

105 Commits

Author SHA1 Message Date
Hallvard Furuseth
6054463eeb Minor cleanup:
Fix Statlog() formats, remove an implicit int, include <ctype.h> for isspace().
1999-08-07 05:36:48 +00:00
Kurt Zeilenga
9c3ed0310b Add copyright notices. 1999-08-06 23:07:46 +00:00
Kurt Zeilenga
9ea7a42b99 Add copyright notice and a few comments here and there 1999-08-04 23:59:13 +00:00
Kurt Zeilenga
2b79ff2c48 Initial inet_aton() detection. 1999-08-03 20:02:44 +00:00
Kurt Zeilenga
df8f7cbb9b s/exit(1)/exit(EXIT_FAILURE)/
s/exit(0)/exit(EXIT_SUCCESS)/
add <ac/stdlib.h> where needed and other minor header adjustments
1999-08-03 18:14:24 +00:00
Kurt Zeilenga
008bbf56db Fix -USLAPD_RLOOKUPS 1999-07-27 18:49:32 +00:00
Kurt Zeilenga
d147e609d2 Implement TCP_NODELAY on both client and server side. 1999-07-22 21:49:35 +00:00
Kurt Zeilenga
f0c1fc37f5 Fix IP: typo in peername 1999-07-22 20:37:56 +00:00
Kurt Zeilenga
933908f72f ACL CHANGES:
by <who> <access> changed to by <who>+ <access> (joined with AND)
  added peername=<regex> sockname=<regex> url=<regex>
  removed addr=<regex> (use peername instead).
replace dn_upcase with str2upper and str2lower.  Use where needed.
1999-07-21 20:54:23 +00:00
Gary Williams
f4eb2feba5 use rd instead of i looking for listeners (line 848) 1999-07-20 21:55:06 +00:00
Julio Sánchez Fernández
504038ffac Move the input data exhaustion loop to connection.c from daemon.c 1999-07-20 18:03:29 +00:00
Julio Sánchez Fernández
535cc34421 If we did gethostbyname, we need no further address manipulation. 1999-07-20 11:26:44 +00:00
Kurt Zeilenga
cb94e155ae Don't call Debug inside a signal handler 1999-07-20 07:11:56 +00:00
Kurt Zeilenga
6847e329bc Fix new URL startup code. 1999-07-19 20:48:19 +00:00
Kurt Zeilenga
170836751a Namespace changes
added slap_ and ldbm_ to many structures
  added typedefs to many structures
  used typedefs
New main.c argument parsing with ldap url support (replacing -a address).
New sockaddr_in handling and support for multiple listeners.
1999-07-19 19:40:33 +00:00
Hallvard Furuseth
425bab2c47 Add comment thatPass socklen_t* instead of int* to getsockopt, accept, getpeername, recvfrom 1999-07-16 18:57:11 +00:00
Julio Sánchez Fernández
0053b27ce0 Look on connection_read() if it returns positive so it has a chance
to exhaust all protocol units received from the transport layer.
I think this is the necessary fix for the TLS-data-ready/
socket-not-ready issue, but I have not experimented that problem
yet, so I am unsure about its effectiveness.
Now, do we need something like that for connection_write?  How would
we go about implementing it?
1999-07-16 18:53:30 +00:00
Julio Sánchez Fernández
6d75d0f8fb connection_init now takes one more argument that indicates whether to
use TLS right away or not on that connection.
1999-07-14 19:44:18 +00:00
Julio Sánchez Fernández
c18d6e7ecf Only bind on TLS port if explicitly requested with -T, otherwise all
kind of conflicts happen when running tests.
1999-07-14 13:39:30 +00:00
Julio Sánchez Fernández
5b7babdee4 Bind and listen on TLS port too 1999-07-14 13:16:13 +00:00
Kurt Zeilenga
2fda53f375 Add missing arguments to Debug() calls... and adapt nt_debug for general
use.
1999-06-21 22:36:13 +00:00
Kurt Zeilenga
13ac82621b Limit the check to a 4 tries every timeout. 1999-06-19 03:23:49 +00:00
Kurt Zeilenga
2d720643be experimental connections_timeout_idle() implementation. 1999-06-19 03:20:01 +00:00
Kurt Zeilenga
669b8f4047 ber_int_t, ber_tag_t, ber_socket_t, ber_len_t
added lber_types.h.nt, lber_types.h.in
removal of NULLxxx internal macros (in favor of NULL).
ch_free added to slapd,slurpd/ch_malloc.c
#define free ch_free (should be removed after s/free/ch_free/g) in proto-slap.h
ch_malloc and friends use ber_memalloc and friends
1999-06-18 23:53:05 +00:00
Gary Williams
1971837778 fix comments (remove // style), free(ptr) in slapd_daemon_task was causing heap failure 1999-06-18 21:31:53 +00:00
Kurt Zeilenga
b0aea66d1d Recommit NT service changes (untested) with changes to resolve
compiling errors on other platforms.  Will need to update NT projects.
1999-06-17 18:46:02 +00:00
Kurt Zeilenga
bbc568b21f ldapconfig.h vs ldap_config.h changes
backout previous nt changes (actually, just don't include nt_svc.c)
1999-06-17 04:43:24 +00:00
Kurt Zeilenga
21e081dc5b Separate autoconf generated values from "defaults".
ldap_defaults.h incorporates non-generated ldapconfig.h values.
	ldap_config.h.in is new template for autoconf generated defaults
		(namely directories and paths)
	ldap_config.h.nt, NT template (must be manually copied)
	s/<ldapconfig.h>/<ldap_defaults.h>/
	s/DIRSEP/LDAP_DIRSEP/ & s/DEFAULT_/LDAP_/
1999-06-17 03:54:25 +00:00
Kurt Zeilenga
23c4b81819 Backout NT Service changes.... breaks Unix builds... 1999-06-17 00:51:12 +00:00
Gary Williams
4d13d4071a add code to support slapd as NT service 1999-06-16 19:15:35 +00:00
Kurt Zeilenga
e2e1cb76cb Remove check for inactive streams before connection_read/_write
calls.  Such checks are ineffective it protecting connection_read/_write
from being called inactive streams.  connection_read/_write have their
own protection against such (in connection_get()).
1999-06-14 20:28:30 +00:00
Kurt Zeilenga
3cfd58eed8 EXPERIMENTAL: move slapd_remove to connections_read/_write as they
acquire c_mutex.
1999-06-11 19:10:45 +00:00
Kurt Zeilenga
368628e9d5 Close inactive streams instead of asserting condition. 1999-06-10 22:06:05 +00:00
Kurt Zeilenga
571e8c098d Add cheap EBADF loop protection. 1999-06-10 21:11:21 +00:00
Kurt Zeilenga
9c793f15f4 Fix typo in last commit. 1999-06-10 15:55:00 +00:00
Kurt Zeilenga
446ef413f6 Don't shutdown when select() returns EBADF. 1999-06-10 03:11:22 +00:00
Kurt Zeilenga
64bb1a99f4 Fix unprotected (and bad) FD_SET asserts. 1999-06-10 02:52:51 +00:00
Kurt Zeilenga
22e981eef3 Close hit socket. 1999-06-04 21:42:25 +00:00
Kurt Zeilenga
5b218b7671 Move WAKE_LISTENER call behind &connection_mutex to eliminate
race condition on file descriptor sets.
1999-06-04 01:05:29 +00:00
Kurt Zeilenga
1a7d72e629 setsockopt( SO_KEEPALIVE ) on the listen() socket. Will be
inherited on accept().
1999-05-24 22:20:34 +00:00
Kurt Zeilenga
42c5a40b78 Implement keep alives. Probably should be a configuration option. 1999-05-24 21:57:26 +00:00
Kurt Zeilenga
450b02ca58 s/WIN32/HAVE_WINSOCK/
remove old Version.c
1999-05-21 03:53:37 +00:00
Kurt Zeilenga
dc07e765f2 Vienna Bulk Commit
This commit includes many changes.  All changes compile under NT but
have not been tested under UNIX.

A Summary of changes (likely incomplete):

NT changes:
	Removed lint.
	Clean up configuration support for "Debug", "Release", "SDebug",
		and "SRelease" configurations.
	Share output directories for clients, libraries,
		and slapd.  (maybe they should be combined further
		and moved to build/{,S}{Debug,Release}).
	Enable threading when _MT is defined.
	Enable debuging when _DEBUG is defined.
	Disable setting of NDEBUG under Release/SRelease.  Asserts
		are disabled in <ac/assert.h> when LDAP_DEBUG is not
		defined.
	Added 'build/main.dsp' Master project.
	Removed non-slapd projects from slapd.dsp (see main.dsp).
	Removed replaced many uses of _WIN32 macro with feature based
		macros.

ldap_cdefs.h changes
	#define LDAP_CONST const
		(see below)
	#define LDAP_F(type) LDAP_F_PRE type LDAP_F_POST
		To allow specifiers to be added before and after
		the type declaration.  (For DLL handling)

LBER/LDAP changes
	Namespace changes:
		s/lber_/ber_/ for here and there.
		s/NAME_ERROR/LDAP_NAME_ERROR/g
	Deleted NULLMSG and other NULL* macros for namespace reasons.
	"const" libraries.  Installed headers (ie: lber.h, ldap.h)
		use LDAP_CONST macro.  Normally set to 'const' when
		__STDC__.  Can be set externally to enable/disable
		'constification' of external interface.  Internal
		interface always uses 'const'.  Did not fix warnings
		in -lldif (in lieu of new LDIF parser).

	Added _ext API implementations (excepting search and bind).
		Need to implement ldap_int_get_controls() for reponses
		with controls.

	Added numberous assert() checks.

LDAP_R
	_MT defines HAVE_NT_THREADS
	Added numberous assert() checks.
	Changed ldap_pthread_t back to unsigned long.  Used cast
	to HANDLE in _join().

LDBM
	Replaced _WIN32 with HAVE_SYSLOG

ud
	Added version string if MKVERSION is not defined.  (MKVERSION
		needs to be set under UNIX).

slapd
	Made connection sockbuf field a pointer to a sockbuf.  This
		removed slap.h dependency on lber-int.h.  lber-int.h now only
		included by those files needing to mess with the sockbuf.
	Used ber_* functions/macros to access sockbuf internals whenever
		possible.
	Added version string if MKVERSION is not defined.  (MKVERSION
		needs to be set under UNIX).
	Removed FD_SET unsigned lint

slapd/tools
	Used EXEEXT to added ".exe" to routines.  Need to define EXEEXT
		under UNIX.

ldappasswd
	Added ldappasswd.dsp.  Ported to NT.  Used getpid() to seed rand().

nt_debug
	Minor cleanup.  Added "portable.h" include and used <ac/*.h> where
	appropriate.  Added const to char* format argument.
1999-05-19 01:12:33 +00:00
Ben Collins
74fa98dfa3 Missing # in front of else in the sockinit #if's 1999-05-07 01:10:03 +00:00
Gary Williams
fe924b727c ldap_pvt_thread_kill doesn't work on NT, so use hit_socket to break select. Also move WSAStartup so it gets called before _any_ socket calls 1999-05-06 16:32:11 +00:00
Kurt Zeilenga
b06c4a5576 Winsock changes:
Centralize #define EWOULDBLOCK WSAEWOULDBLOCK to ac/errno.h
Move WSAStartup to slapd_daemon(), add WSACleanup() to match.
1999-04-28 21:21:14 +00:00
Kurt Zeilenga
fa6fec3c9c Implement "quick" shutdown (similiar in behavior to shutdown
prior to connection management changes).  No "normal" (wait
for pending operations to complete) shutdown mode (yet).
Changes:
 Add connections_destroy() implementation to connections.c.
 Move connections_init() call to slap_daemon().
 Add connections_destroy() call to slap_daemon().
 Add connections_shutdown() implementation to connections.c.
	calls connection_closing()/connection_close() for each
	"in use" connection.
 Add connections_shutdown() call to slap_daemon_task().
1999-04-23 22:50:28 +00:00
Kurt Zeilenga
3041aafc2c Protect listener_tid from being killed after the listener has exited. 1999-04-17 05:21:30 +00:00
Kurt Zeilenga
c10bb54be0 Fix typo in write select. Fix errors in WINSOCK handling.
Add test listener no-thread_create experiment (behind ifdef).
1999-04-16 18:56:42 +00:00
Gary Williams
3a1aba86ab put conditions on hp so we don't get unreferenced variable warning 1999-04-14 15:11:57 +00:00