forked from cory/tildefriends
Vague attempt at some more cleanup, and stick pthread_self() in the traces.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4176 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
16
src/ssb.c
16
src/ssb.c
@ -685,12 +685,12 @@ void tf_ssb_connection_rpc_send(tf_ssb_connection_t* connection, uint8_t flags,
|
||||
{
|
||||
if (!connection)
|
||||
{
|
||||
if (cleanup)
|
||||
{
|
||||
cleanup(NULL, user_data);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (request_number > 0 && callback)
|
||||
{
|
||||
tf_ssb_connection_add_request(connection, request_number, callback, cleanup, user_data, NULL);
|
||||
}
|
||||
uint8_t* combined = tf_malloc(9 + size);
|
||||
*combined = flags;
|
||||
uint32_t u32size = htonl((uint32_t)size);
|
||||
@ -706,6 +706,14 @@ void tf_ssb_connection_rpc_send(tf_ssb_connection_t* connection, uint8_t flags,
|
||||
_tf_ssb_connection_box_stream_send(connection, combined, 1 + 2 * sizeof(uint32_t) + size);
|
||||
tf_free(combined);
|
||||
connection->ssb->rpc_out++;
|
||||
if (request_number > 0 && callback)
|
||||
{
|
||||
tf_ssb_connection_add_request(connection, request_number, callback, cleanup, user_data, NULL);
|
||||
}
|
||||
else if (cleanup)
|
||||
{
|
||||
cleanup(connection->ssb, user_data);
|
||||
}
|
||||
}
|
||||
|
||||
void tf_ssb_connection_rpc_send_json(tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue message, tf_ssb_rpc_callback_t* callback, tf_ssb_callback_cleanup_t* cleanup, void* user_data)
|
||||
|
Reference in New Issue
Block a user