X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconn.c;h=b798e6e75cd51b44eccf2c5c9e553505b77c0d81;hp=73a66bbb469cdc8f72d33574144b0ee3e1e7f293;hb=4a6d44dce2436103dafaad199597ada354d9b794;hpb=21cbf37db5647159eced6ed1275e0e2e6980155c diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 73a66bbb..b798e6e7 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -71,10 +71,6 @@ #include "resolve.h" #include "tool.h" -#ifdef ZEROCONF -# include "rendezvous.h" -#endif - #include "exp.h" @@ -82,6 +78,7 @@ #define MAX_COMMANDS 3 #define MAX_COMMANDS_SERVER 10 +#define MAX_COMMANDS_SERVICE MAX_COMMANDS_SERVER static bool Handle_Write PARAMS(( CONN_ID Idx )); @@ -515,9 +512,6 @@ Conn_ExitListeners( void ) /* Close down all listening sockets */ int *fd; size_t arraylen; -#ifdef ZEROCONF - Rendezvous_UnregisterListeners( ); -#endif arraylen = array_length(&My_Listeners, sizeof (int)); Log(LOG_INFO, @@ -574,9 +568,7 @@ NewListener(const char *listen_addr, UINT16 Port) /* Create new listening socket on specified port */ ng_ipaddr_t addr; int sock, af; -#ifdef ZEROCONF - char name[CLIENT_ID_LEN], *info; -#endif + if (!InitSinaddrListenAddr(&addr, listen_addr, Port)) return -1; @@ -612,38 +604,8 @@ NewListener(const char *listen_addr, UINT16 Port) return -1; } - Log(LOG_INFO, "Now listening on [%s]:%d (socket %d).", ng_ipaddr_tostr(&addr), Port, sock); - -#ifdef ZEROCONF - /* Get best server description text */ - if( ! Conf_ServerInfo[0] ) info = Conf_ServerName; - else - { - /* Use server info string */ - info = NULL; - if( Conf_ServerInfo[0] == '[' ) - { - /* Cut off leading hostname part in "[]" */ - info = strchr( Conf_ServerInfo, ']' ); - if( info ) - { - info++; - while( *info == ' ' ) info++; - } - } - if( ! info ) info = Conf_ServerInfo; - } - - /* Add port number to description if non-standard */ - if (Port != 6667) - snprintf(name, sizeof name, "%s (port %u)", info, - (unsigned int)Port); - else - strlcpy(name, info, sizeof name); - - /* Register service */ - Rendezvous_Register( name, MDNS_TYPE, Port ); -#endif + Log(LOG_INFO, "Now listening on [%s]:%d (socket %d).", + ng_ipaddr_tostr(&addr), Port, sock); return sock; } /* NewListener */ @@ -708,10 +670,6 @@ Conn_Handler(void) while (!NGIRCd_SignalQuit && !NGIRCd_SignalRestart) { t = time(NULL); -#ifdef ZEROCONF - Rendezvous_Handler(); -#endif - /* Check configured servers and established links */ Check_Servers(); Check_Connections(); @@ -1380,10 +1338,10 @@ New_Connection(int Sock) identsock = new_sock; #ifdef IDENTAUTH - if (Conf_NoIdent) + if (!Conf_Ident) identsock = -1; #endif - if (!Conf_NoDNS) + if (Conf_DNS) Resolve_Addr(&My_Connections[new_sock].proc_stat, &new_addr, identsock, cb_Read_Resolver_Result); @@ -1530,7 +1488,7 @@ Read_Request( CONN_ID Idx ) /** * Handle all data in the connection read-buffer. * Data is processed until no complete command is left in the read buffer, - * or MAX_COMMANDS[_SERVER] commands were processed. + * or MAX_COMMANDS[_SERVER|_SERVICE] commands were processed. * When a fatal error occurs, the connection is shut down. * @param Idx Index of the connection. * @return number of bytes processed. @@ -1555,8 +1513,12 @@ Handle_Buffer(CONN_ID Idx) /* Servers do get special command limits, so they can process * all the messages that are required while peering. */ - if (Client_Type(c) == CLIENT_SERVER) - maxcmd = MAX_COMMANDS_SERVER; + switch (Client_Type(c)) { + case CLIENT_SERVER: + maxcmd = MAX_COMMANDS_SERVER; break; + case CLIENT_SERVICE: + maxcmd = MAX_COMMANDS_SERVICE; break; + } starttime = time(NULL); for (i=0; i < maxcmd; i++) {