aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nids.h6
-rw-r--r--src/serversocket.cpp16
2 files changed, 19 insertions, 3 deletions
diff --git a/src/nids.h b/src/nids.h
index 02d6cf4..0976e67 100644
--- a/src/nids.h
+++ b/src/nids.h
@@ -96,10 +96,10 @@ namespace Bu
96 /*uint32_t uPrevBlock,*/ bool bNew=false ); 96 /*uint32_t uPrevBlock,*/ bool bNew=false );
97 uint32_t createBlock( uint32_t uFirstBlock, /*uint32_t uPrevBlock,*/ 97 uint32_t createBlock( uint32_t uFirstBlock, /*uint32_t uPrevBlock,*/
98 int iPreAllocate=1 ); 98 int iPreAllocate=1 );
99 void getBlock( uint32_t uIndex, struct Nids::Block *pBlock ); 99 void getBlock( uint32_t uIndex, Block *pBlock );
100 void setBlock( uint32_t uIndex, struct Nids::Block *pBlock ); 100 void setBlock( uint32_t uIndex, Block *pBlock );
101 void updateStreamSize( uint32_t uIndex, uint32_t uSize ); 101 void updateStreamSize( uint32_t uIndex, uint32_t uSize );
102 uint32_t getNextBlock( uint32_t uIndex, struct Nids::Block *pBlock, 102 uint32_t getNextBlock( uint32_t uIndex, Block *pBlock,
103 bool bCreate=true); 103 bool bCreate=true);
104 104
105 void updateHeader(); 105 void updateHeader();
diff --git a/src/serversocket.cpp b/src/serversocket.cpp
index b711320..37eb3d4 100644
--- a/src/serversocket.cpp
+++ b/src/serversocket.cpp
@@ -31,6 +31,10 @@ namespace Bu { subExceptionDef( ServerSocketException ) }
31Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : 31Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) :
32 nPort( nPort ) 32 nPort( nPort )
33{ 33{
34#ifdef WIN32
35 Bu::Winsock2::getInstance();
36#endif
37
34 /* Create the socket and set it up to accept connections. */ 38 /* Create the socket and set it up to accept connections. */
35 struct sockaddr_in name; 39 struct sockaddr_in name;
36 40
@@ -48,6 +52,10 @@ Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) :
48Bu::ServerSocket::ServerSocket(const FString &sAddr,int nPort, int nPoolSize) : 52Bu::ServerSocket::ServerSocket(const FString &sAddr,int nPort, int nPoolSize) :
49 nPort( nPort ) 53 nPort( nPort )
50{ 54{
55#ifdef WIN32
56 Bu::Winsock2::getInstance();
57#endif
58
51 /* Create the socket and set it up to accept connections. */ 59 /* Create the socket and set it up to accept connections. */
52 struct sockaddr_in name; 60 struct sockaddr_in name;
53 61
@@ -69,6 +77,10 @@ Bu::ServerSocket::ServerSocket( int nServer, bool bInit, int nPoolSize ) :
69 nServer( nServer ), 77 nServer( nServer ),
70 nPort( 0 ) 78 nPort( 0 )
71{ 79{
80#ifdef WIN32
81 Bu::Winsock2::getInstance();
82#endif
83
72 if( bInit ) 84 if( bInit )
73 { 85 {
74 struct sockaddr name; 86 struct sockaddr name;
@@ -86,6 +98,10 @@ Bu::ServerSocket::ServerSocket( int nServer, bool bInit, int nPoolSize ) :
86 98
87Bu::ServerSocket::ServerSocket( const ServerSocket &rSrc ) 99Bu::ServerSocket::ServerSocket( const ServerSocket &rSrc )
88{ 100{
101#ifdef WIN32
102 Bu::Winsock2::getInstance();
103#endif
104
89 nServer = dup( rSrc.nServer ); 105 nServer = dup( rSrc.nServer );
90 nPort = rSrc.nPort; 106 nPort = rSrc.nPort;
91 FD_ZERO( &fdActive ); 107 FD_ZERO( &fdActive );