Minor cleanup.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4028 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -2027,11 +2027,11 @@ tf_ssb_connection_t* tf_ssb_connection_create(tf_ssb_t* ssb, const char* host, c
|
||||
{
|
||||
for (tf_ssb_connection_t* connection = ssb->connections; connection; connection = connection->next)
|
||||
{
|
||||
if (memcmp(connection->serverpub, public_key, k_id_bin_len) == 0)
|
||||
if (memcmp(connection->serverpub, public_key, k_id_bin_len) == 0 && connection->state != k_tf_ssb_state_invalid)
|
||||
{
|
||||
char id[k_id_base64_len];
|
||||
tf_ssb_id_bin_to_str(id, sizeof(id), public_key);
|
||||
printf("Not connecting to %s:%d, because we are already connected to %s.\n", host, ntohs(addr->sin_port), id);
|
||||
printf("Not connecting to %s:%d, because we are already connected to %s (state = %d).\n", host, ntohs(addr->sin_port), id, connection->state);
|
||||
return NULL;
|
||||
}
|
||||
else if (memcmp(ssb->pub, public_key, k_id_bin_len) == 0)
|
||||
@ -2749,11 +2749,6 @@ JSClassID tf_ssb_get_connection_class_id()
|
||||
|
||||
JSValue tf_ssb_connection_get_object(tf_ssb_connection_t* connection)
|
||||
{
|
||||
if (connection && !JS_IsUndefined(connection->object))
|
||||
{
|
||||
JSRefCountHeader *p = (JSRefCountHeader *)JS_VALUE_GET_PTR(connection->object);
|
||||
printf("%p _get_object count=%d\nn", JS_VALUE_GET_PTR(connection->object), p->ref_count);
|
||||
}
|
||||
return connection ? connection->object : JS_UNDEFINED;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user