Check-in [a473650e79]
Overview
Comment:Added start of socket timeout and cleanup
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a473650e799eb94da37cf8c88c94baffe1ef248c
User & Date: rkeene on 2016-02-22 18:31:55
Other Links: manifest | tags
Context
2016-02-22
21:02
Completed support for killing idle connections check-in: 6e6baf524b user: rkeene tags: trunk
18:31
Added start of socket timeout and cleanup check-in: a473650e79 user: rkeene tags: trunk
2016-02-11
16:29
Updated license dates and added it to the C source as well check-in: bb0e4b5e36 user: rkeene tags: trunk
Changes

Modified filed.c from [33946c2e20] to [932c017b84].

583
584
585
586
587
588
589



















590
591
592
593
594
595
596
	pthread_create(&thread_id, NULL, filed_logging_thread, args);

	filed_log_msg("START");

	return(0);
}
#endif




















/* Format time per RFC2616 */
static char *filed_format_time(char *buffer, size_t buffer_len, const time_t timeinfo) {
	struct tm timeinfo_tm, *timeinfo_tm_p;

	timeinfo_tm_p = gmtime_r(&timeinfo, &timeinfo_tm);
	if (timeinfo_tm_p == NULL) {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
	pthread_create(&thread_id, NULL, filed_logging_thread, args);

	filed_log_msg("START");

	return(0);
}
#endif

static void *filed_sockettimeout_thread(void *arg) {
	while (1) {
		usleep(300000);
	}

	return(NULL);

	/* NOTREACHED */
	arg = arg;
}

static int filed_sockettimeout_thread_init(void) {
	pthread_t thread_id;

	pthread_create(&thread_id, NULL, filed_sockettimeout_thread, NULL);

	return(0);
}

/* Format time per RFC2616 */
static char *filed_format_time(char *buffer, size_t buffer_len, const time_t timeinfo) {
	struct tm timeinfo_tm, *timeinfo_tm_p;

	timeinfo_tm_p = gmtime_r(&timeinfo, &timeinfo_tm);
	if (timeinfo_tm_p == NULL) {
1605
1606
1607
1608
1609
1610
1611








1612
1613
1614
1615
1616
1617
1618
	/* Create logging thread */
	init_ret = filed_logging_thread_init(log_fp);
	if (init_ret != 0) {
		perror("filed_logging_thread_init");

		return(4);
	}









	/* Create worker threads */
	init_ret = filed_worker_threads_init(fd, thread_count, &thread_options);
	if (init_ret != 0) {
		perror("filed_worker_threads_init");

		return(5);







>
>
>
>
>
>
>
>







1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
	/* Create logging thread */
	init_ret = filed_logging_thread_init(log_fp);
	if (init_ret != 0) {
		perror("filed_logging_thread_init");

		return(4);
	}

	/* Create socket termination thread */
	init_ret = filed_sockettimeout_thread_init();
	if (init_ret != 0) {
		perror("filed_sockettimeout_thread_init");

		return(6);
	}

	/* Create worker threads */
	init_ret = filed_worker_threads_init(fd, thread_count, &thread_options);
	if (init_ret != 0) {
		perror("filed_worker_threads_init");

		return(5);