mirror of
https://github.com/osmarks/ngircd.git
synced 2025-02-15 00:30:16 +00:00
revert to last good revision
This commit is contained in:
parent
1e29560bac
commit
3f7191db0f
@ -17,7 +17,7 @@
|
|||||||
#include "portab.h"
|
#include "portab.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
static char UNUSED id[] = "$Id: conn.c,v 1.198.2.1 2006/12/17 23:00:47 fw Exp $";
|
static char UNUSED id[] = "$Id: conn.c,v 1.198.2.2 2006/12/17 23:06:29 fw Exp $";
|
||||||
|
|
||||||
#include "imp.h"
|
#include "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -998,18 +998,23 @@ New_Connection( int Sock )
|
|||||||
c = Client_NewLocal( new_sock, inet_ntoa( new_addr.sin_addr ), CLIENT_UNKNOWN, false );
|
c = Client_NewLocal( new_sock, inet_ntoa( new_addr.sin_addr ), CLIENT_UNKNOWN, false );
|
||||||
if( ! c ) {
|
if( ! c ) {
|
||||||
Log( LOG_ALERT, "Can't accept connection: can't create client structure!" );
|
Log( LOG_ALERT, "Can't accept connection: can't create client structure!" );
|
||||||
goto out;
|
Simple_Message( new_sock, "ERROR :Internal error" );
|
||||||
|
close( new_sock );
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* register callback */
|
|
||||||
if (!io_event_create( new_sock, IO_WANTREAD, cb_clientserver))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
Init_Conn_Struct( new_sock );
|
Init_Conn_Struct( new_sock );
|
||||||
My_Connections[new_sock].sock = new_sock;
|
My_Connections[new_sock].sock = new_sock;
|
||||||
My_Connections[new_sock].addr = new_addr;
|
My_Connections[new_sock].addr = new_addr;
|
||||||
My_Connections[new_sock].client = c;
|
My_Connections[new_sock].client = c;
|
||||||
|
|
||||||
|
/* register callback */
|
||||||
|
if (!io_event_create( new_sock, IO_WANTREAD, cb_clientserver)) {
|
||||||
|
Simple_Message( new_sock, "ERROR :Internal error" );
|
||||||
|
Conn_Close( new_sock, "io_event_create() failed", NULL, false );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
Log( LOG_INFO, "Accepted connection %d from %s:%d on socket %d.", new_sock,
|
Log( LOG_INFO, "Accepted connection %d from %s:%d on socket %d.", new_sock,
|
||||||
inet_ntoa( new_addr.sin_addr ), ntohs( new_addr.sin_port), Sock );
|
inet_ntoa( new_addr.sin_addr ), ntohs( new_addr.sin_port), Sock );
|
||||||
|
|
||||||
@ -1025,11 +1030,7 @@ New_Connection( int Sock )
|
|||||||
/* Penalty-Zeit setzen */
|
/* Penalty-Zeit setzen */
|
||||||
Conn_SetPenalty( new_sock, 4 );
|
Conn_SetPenalty( new_sock, 4 );
|
||||||
return new_sock;
|
return new_sock;
|
||||||
out:
|
} /* New_Connection */
|
||||||
Simple_Message( new_sock, "ERROR :Internal error" );
|
|
||||||
close( new_sock );
|
|
||||||
return -1;
|
|
||||||
}/* New_Connection */
|
|
||||||
|
|
||||||
|
|
||||||
static CONN_ID
|
static CONN_ID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user