View | Details | Raw Unified | Return to bug 34763
Collapse All | Expand All

(-)debian/control (-1 / +1 lines)
 Lines 1-6    Link Here 
1
Source: univention-directory-listener
1
Source: univention-directory-listener
2
Section: univention
2
Section: univention
3
Priority: optional
3
Priority: standard
4
Maintainer: Univention GmbH <packages@univention.de>
4
Maintainer: Univention GmbH <packages@univention.de>
5
Standards-Version: 3.5.5
5
Standards-Version: 3.5.5
6
Build-Depends: debhelper (>= 9),
6
Build-Depends: debhelper (>= 9),
(-)src/main.c (-6 / +11 lines)
 Lines 384-407    Link Here 
384
		};
384
		};
385
		int ret;
385
		int ret;
386
		ret = ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, &timeout);
386
		ret = ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, &timeout);
387
		if (ret != LDAP_OPT_SUCCESS)
387
		if (ret != LDAP_OPT_SUCCESS) {
388
			fprintf(stderr, "Failed to set LDAP connection timeout: %s\n", ldap_err2string(ret));
388
			fprintf(stderr, "Failed to set LDAP connection timeout: %s\n", ldap_err2string(ret));
389
		}
389
		ret = ldap_set_option(NULL, LDAP_OPT_TIMEOUT, &timeout);
390
		ret = ldap_set_option(NULL, LDAP_OPT_TIMEOUT, &timeout);
390
		if (ret != LDAP_OPT_SUCCESS)
391
		if (ret != LDAP_OPT_SUCCESS) {
391
			fprintf(stderr, "Failed to set LDAP synchronous API timeout: %s\n", ldap_err2string(ret));
392
			fprintf(stderr, "Failed to set LDAP synchronous API timeout: %s\n", ldap_err2string(ret));
393
		}
392
394
393
		const int idle = 60;
395
		const int idle = 60;
394
		ret = ldap_set_option(NULL, LDAP_OPT_X_KEEPALIVE_IDLE, &idle);
396
		ret = ldap_set_option(NULL, LDAP_OPT_X_KEEPALIVE_IDLE, &idle);
395
		if (ret != LDAP_OPT_SUCCESS)
397
		if (ret != LDAP_OPT_SUCCESS) {
396
			fprintf(stderr, "Failed to set TCP KA idle: %s\n", ldap_err2string(ret));
398
			fprintf(stderr, "Failed to set TCP KA idle: %s\n", ldap_err2string(ret));
399
		}
397
		const int probes = 12;
400
		const int probes = 12;
398
		ret = ldap_set_option(NULL, LDAP_OPT_X_KEEPALIVE_PROBES, &probes);
401
		ret = ldap_set_option(NULL, LDAP_OPT_X_KEEPALIVE_PROBES, &probes);
399
		if (ret != LDAP_OPT_SUCCESS)
402
		if (ret != LDAP_OPT_SUCCESS) {
400
			fprintf(stderr, "Failed to set TCP KA probes: %s\n", ldap_err2string(ret));
403
			fprintf(stderr, "Failed to set TCP KA probes: %s\n", ldap_err2string(ret));
404
		}
401
		const int interval = 5;
405
		const int interval = 5;
402
		ret = ldap_set_option(NULL, LDAP_OPT_X_KEEPALIVE_PROBES, &interval);
406
		ret = ldap_set_option(NULL, LDAP_OPT_X_KEEPALIVE_INTERVAL, &interval);
403
		if (ret != LDAP_OPT_SUCCESS)
407
		if (ret != LDAP_OPT_SUCCESS) {
404
			fprintf(stderr, "Failed to set TCP KA interval: %s\n", ldap_err2string(ret));
408
			fprintf(stderr, "Failed to set TCP KA interval: %s\n", ldap_err2string(ret));
409
		}
405
	}
410
	}
406
411
407
	if ((lp = univention_ldap_new()) == NULL)
412
	if ((lp = univention_ldap_new()) == NULL)
(-)src/network.c (-6 / +12 lines)
 Lines 414-441    Link Here 
414
			};
414
			};
415
			int ret;
415
			int ret;
416
			ret = setsockopt(client->fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
416
			ret = setsockopt(client->fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
417
			if (ret < 0)
417
			if (ret < 0) {
418
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set SO_RCVTIMEO\n");
418
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set SO_RCVTIMEO\n");
419
			}
419
			ret = setsockopt(client->fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
420
			ret = setsockopt(client->fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
420
			if (ret < 0)
421
			if (ret < 0) {
421
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set SO_SNDTIMEO\n");
422
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set SO_SNDTIMEO\n");
423
			}
422
424
423
			const int enable = 1;
425
			const int enable = 1;
424
			ret = setsockopt(client->fd, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable));
426
			ret = setsockopt(client->fd, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable));
425
			if (ret < 0)
427
			if (ret < 0) {
426
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to enable TCP KEEPALIVE\n");
428
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to enable TCP KEEPALIVE\n");
429
			}
427
			const int idle = 60;
430
			const int idle = 60;
428
			ret = setsockopt(client->fd, SOL_TCP, TCP_KEEPIDLE, &idle, sizeof(idle));
431
			ret = setsockopt(client->fd, SOL_TCP, TCP_KEEPIDLE, &idle, sizeof(idle));
429
			if (ret < 0)
432
			if (ret < 0) {
430
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set TCP_KEEPIDLE\n");
433
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set TCP_KEEPIDLE\n");
434
			}
431
			const int probes = 12;
435
			const int probes = 12;
432
			ret = setsockopt(client->fd, SOL_TCP, TCP_KEEPCNT, &probes, sizeof(probes));
436
			ret = setsockopt(client->fd, SOL_TCP, TCP_KEEPCNT, &probes, sizeof(probes));
433
			if (ret < 0)
437
			if (ret < 0) {
434
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set TCP_KEEPCNT\n");
438
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set TCP_KEEPCNT\n");
439
			}
435
			const int interval = 5;
440
			const int interval = 5;
436
			ret = setsockopt(client->fd, SOL_TCP, TCP_KEEPINTVL, &interval, sizeof(interval));
441
			ret = setsockopt(client->fd, SOL_TCP, TCP_KEEPINTVL, &interval, sizeof(interval));
437
			if (ret < 0)
442
			if (ret < 0) {
438
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set TCP_KEEPINTVL\n");
443
				univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "Failed to set TCP_KEEPINTVL\n");
444
			}
439
		}
445
		}
440
446
441
		if (connect(client->fd, address, addrlen) == -1) {
447
		if (connect(client->fd, address, addrlen) == -1) {

Return to bug 34763