From 99318adcb88fa3f1dd21882ec364e682fec96c5e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 7 Nov 2005 17:32:40 +0100 Subject: Import work on services-based Win32 port --- bitlbee.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'bitlbee.c') diff --git a/bitlbee.c b/bitlbee.c index 32e28541..1054a42f 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -56,9 +56,6 @@ int bitlbee_daemon_init() int i; GIOChannel *ch; - log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG ); - log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG ); - global.listen_socket = socket( AF_INET, SOCK_STREAM, 0 ); if( global.listen_socket == -1 ) { @@ -112,9 +109,6 @@ int bitlbee_inetd_init() if( !irc_new( 0 ) ) return( 1 ); - log_link( LOGLVL_ERROR, LOGOUTPUT_IRC ); - log_link( LOGLVL_WARNING, LOGOUTPUT_IRC ); - return( 0 ); } -- cgit v1.2.3 From 80c1e4d9e8c82a83499d6b66cdf3a95d15bf0fa1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 25 May 2006 01:31:20 +0200 Subject: #ifdef out some Win32-incompatible code blocks --- bitlbee.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bitlbee.c') diff --git a/bitlbee.c b/bitlbee.c index cca14916..30167fea 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -122,6 +122,7 @@ int bitlbee_daemon_init() global.conf->runmode == RUNMODE_FORKDAEMON ) ipc_master_listen_socket(); +#ifndef _WIN32 if( ( fp = fopen( global.conf->pidfile, "w" ) ) ) { fprintf( fp, "%d\n", (int) getpid() ); @@ -131,6 +132,7 @@ int bitlbee_daemon_init() { log_message( LOGLVL_WARNING, "Warning: Couldn't write PID to `%s'", global.conf->pidfile ); } +#endif return( 0 ); } @@ -252,7 +254,6 @@ gboolean bitlbee_io_new_client( GIOChannel *source, GIOCondition condition, gpoi size_t size = sizeof( struct sockaddr_in ); struct sockaddr_in conn_info; int new_socket = accept( global.listen_socket, (struct sockaddr *) &conn_info, &size ); - pid_t client_pid = 0; if( new_socket == -1 ) { @@ -260,8 +261,10 @@ gboolean bitlbee_io_new_client( GIOChannel *source, GIOCondition condition, gpoi return TRUE; } +#ifndef _WIN32 if( global.conf->runmode == RUNMODE_FORKDAEMON ) { + pid_t client_pid = 0; int fds[2]; if( socketpair( AF_UNIX, SOCK_STREAM, 0, fds ) == -1 ) @@ -312,6 +315,7 @@ gboolean bitlbee_io_new_client( GIOChannel *source, GIOCondition condition, gpoi } } else +#endif { log_message( LOGLVL_INFO, "Creating new connection with fd %d.", new_socket ); irc_new( new_socket ); -- cgit v1.2.3 From 883a398f059f98cb31da77dd6e632e4152dcf87e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 2 Apr 2008 22:36:02 +0100 Subject: Rearranged some event handling code. --- bitlbee.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bitlbee.c') diff --git a/bitlbee.c b/bitlbee.c index 59a417f0..230b8ce8 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -225,12 +225,16 @@ gboolean bitlbee_io_current_client_write( gpointer data, gint fd, b_input_condit if( st == size ) { - g_free( irc->sendbuffer ); - irc->sendbuffer = NULL; - irc->w_watch_source_id = 0; - if( irc->status & USTATUS_SHUTDOWN ) + { irc_free( irc ); + } + else + { + g_free( irc->sendbuffer ); + irc->sendbuffer = NULL; + irc->w_watch_source_id = 0; + } return FALSE; } -- cgit v1.2.3 From aefaac3a5d44537bdf804d1f42e491cc2b931889 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 6 Apr 2008 16:34:25 +0100 Subject: Added ClientInterface configuration option to make BitlBee bind() to a specific interface before connecting to a remote host. --- bitlbee.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bitlbee.c') diff --git a/bitlbee.c b/bitlbee.c index 230b8ce8..17431546 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -53,11 +53,11 @@ int bitlbee_daemon_init() #endif ; - i = getaddrinfo( global.conf->iface, global.conf->port, &hints, &addrinfo_bind ); + i = getaddrinfo( global.conf->iface_in, global.conf->port, &hints, &addrinfo_bind ); if( i ) { log_message( LOGLVL_ERROR, "Couldn't parse address `%s': %s", - global.conf->iface, gai_strerror(i) ); + global.conf->iface_in, gai_strerror(i) ); return -1; } -- cgit v1.2.3 From cd63d5822e76a6126bb3017567c9ce2869a44e0b Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 29 Jun 2008 13:47:39 +0100 Subject: Now using an environment variable instead of a flag to pass state info when restarting the ForkDaemon. Preparing for a proper fallback when execv() fails. (Bug #425) --- bitlbee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitlbee.c') diff --git a/bitlbee.c b/bitlbee.c index 17431546..d8a6a5a7 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -117,7 +117,7 @@ int bitlbee_daemon_init() #endif if( global.conf->runmode == RUNMODE_FORKDAEMON ) - ipc_master_load_state(); + ipc_master_load_state( getenv( "_BITLBEE_RESTART_STATE" ) ); if( global.conf->runmode == RUNMODE_DAEMON || global.conf->runmode == RUNMODE_FORKDAEMON ) ipc_master_listen_socket(); -- cgit v1.2.3