diff options
author | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2011-07-15 23:21:16 +0400 |
---|---|---|
committer | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2011-07-15 23:21:16 +0400 |
commit | 3817ac3746f0bdcb209186da2b27c51b273911b0 (patch) | |
tree | ffe90cc262b2bf7694099701867df4d69a44c94d /server_connection | |
parent | dda3348a92d228a7a9b1b6b43f416c74c794ab71 (diff) |
ServerConnection: remove unused ServerConnection_StartMessage and ServerConnection_EndMessage
Diffstat (limited to 'server_connection')
-rw-r--r-- | server_connection/ServerConnection.c | 35 | ||||
-rw-r--r-- | server_connection/ServerConnection.h | 28 |
2 files changed, 1 insertions, 62 deletions
diff --git a/server_connection/ServerConnection.c b/server_connection/ServerConnection.c index 2669197..7115a2a 100644 --- a/server_connection/ServerConnection.c +++ b/server_connection/ServerConnection.c @@ -571,41 +571,6 @@ int ServerConnection_IsReady (ServerConnection *o) return (o->state == STATE_COMPLETE); } -int ServerConnection_StartMessage (ServerConnection *o, uint8_t **data, peerid_t peer_id, int len) -{ - ASSERT(o->state == STATE_COMPLETE) - ASSERT(o->output_local_packet_len == -1) - ASSERT(len >= 0) - ASSERT(len <= SC_MAX_MSGLEN) - ASSERT(data || len == 0) - DebugError_AssertNoError(&o->d_err); - DebugObject_Access(&o->d_obj); - - uint8_t *packet; - if (!start_packet(o, (void **)&packet, sizeof(struct sc_client_outmsg) + len)) { - return 0; - } - - struct sc_client_outmsg *msg = (struct sc_client_outmsg *)packet; - msg->clientid = htol16(peer_id); - - if (data) { - *data = packet + sizeof(struct sc_client_outmsg); - } - - return 1; -} - -void ServerConnection_EndMessage (ServerConnection *o) -{ - ASSERT(o->state == STATE_COMPLETE) - ASSERT(o->output_local_packet_len >= 0) - DebugError_AssertNoError(&o->d_err); - DebugObject_Access(&o->d_obj); - - end_packet(o, SCID_OUTMSG); -} - PacketPassInterface * ServerConnection_GetSendInterface (ServerConnection *o) { ASSERT(o->state == STATE_COMPLETE) diff --git a/server_connection/ServerConnection.h b/server_connection/ServerConnection.h index ab924c8..0ceb6e0 100644 --- a/server_connection/ServerConnection.h +++ b/server_connection/ServerConnection.h @@ -248,37 +248,11 @@ void ServerConnection_Free (ServerConnection *o); int ServerConnection_IsReady (ServerConnection *o); /** - * Provides a buffer for writing a message to be sent to a peer. - * The object must be in ready and not writing state. - * On success, the object enters writing state. - * Must not be called from the error handler. - * May invoke the error handler. - * - * @param o the object - * @param data the buffer will be returned here on success. Must not be NULL unless len is 0. - * @param peer_id ID of peer the message goes to - * @param len length of the message. Must be >=0 and <=SC_MAX_MSGLEN. - * @return 1 on success, 0 on out of buffer - */ -int ServerConnection_StartMessage (ServerConnection *o, uint8_t **data, peerid_t peer_id, int len) WARN_UNUSED; - -/** - * Submits a written message for sending to a peer. - * The object must be in ready and writing state. - * The object enters not writing state. - * Must not be called from the error handler. - * May invoke the error handler. - * - * @param o the object - */ -void ServerConnection_EndMessage (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. * The interface must not be used after an error was reported. - * The object must be in ready and writing state. + * The object must be in ready state. * Must not be called from the error handler. * * @param o the object |