diff options
author | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2011-07-22 19:05:02 +0400 |
---|---|---|
committer | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2011-07-22 19:05:02 +0400 |
commit | f39c5c16f8141c1b4715dbf83dbe991034cff8f0 (patch) | |
tree | c0bdaf997e097a395da6979559d10438207ba9dd /server_connection | |
parent | 410dc467f2f02352b74234df87ee5ca0551c4584 (diff) |
client: cosmetic changes
Diffstat (limited to 'server_connection')
-rw-r--r-- | server_connection/ServerConnection.c | 13 | ||||
-rw-r--r-- | server_connection/ServerConnection.h | 10 |
2 files changed, 6 insertions, 17 deletions
diff --git a/server_connection/ServerConnection.c b/server_connection/ServerConnection.c index eb0f4e3..0fb4841 100644 --- a/server_connection/ServerConnection.c +++ b/server_connection/ServerConnection.c @@ -483,7 +483,6 @@ int ServerConnection_Init ( ServerConnection_handler_message handler_message ) { - ASSERT(addr.type == BADDR_TYPE_IPV4 || addr.type == BADDR_TYPE_IPV6) ASSERT(keepalive_interval > 0) ASSERT(buffer_size > 0) ASSERT(have_ssl == 0 || have_ssl == 1) @@ -505,6 +504,11 @@ int ServerConnection_Init ( o->handler_endclient = handler_endclient; o->handler_message = handler_message; + if (!BConnection_AddressSupported(addr)) { + BLog(BLOG_ERROR, "BConnection_AddressSupported failed"); + goto fail0; + } + // init connector if (!BConnector_Init(&o->connector, addr, o->reactor, o, (BConnector_handler)connector_handler)) { BLog(BLOG_ERROR, "BConnector_Init failed"); @@ -578,13 +582,6 @@ void ServerConnection_Free (ServerConnection *o) BConnector_Free(&o->connector); } -int ServerConnection_IsReady (ServerConnection *o) -{ - DebugObject_Access(&o->d_obj); - - return (o->state == STATE_COMPLETE); -} - PacketPassInterface * ServerConnection_GetSendInterface (ServerConnection *o) { ASSERT(o->state == STATE_COMPLETE) diff --git a/server_connection/ServerConnection.h b/server_connection/ServerConnection.h index a410f07..92f96e8 100644 --- a/server_connection/ServerConnection.h +++ b/server_connection/ServerConnection.h @@ -200,7 +200,7 @@ typedef struct { * * @param o the object * @param reactor {@link BReactor} we live in - * @param addr address to connect to. Must be IPv4 or IPv6. + * @param addr address to connect to * @param keepalive_interval keep-alive sending interval. Must be >0. * @param buffer_size minimum size of send buffer in number of packets. Must be >0. * @param have_ssl whether to use SSL for connecting to the server. Must be 1 or 0. @@ -245,14 +245,6 @@ int ServerConnection_Init ( void ServerConnection_Free (ServerConnection *o); /** - * Determines if the object is in ready state. - * - * @param o the object - * @return 1 if ready, 0 of not - */ -int ServerConnection_IsReady (ServerConnection *o); - -/** * Returns an interface for sending data to the server (just one). * This goes directly into the link (i.e. TCP, possibly via SSL), so packets * need to be manually encoded according to PacketProto. |