forked from cory/tildefriends
Remove Socket.info.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4312 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
dd61a6ecc3
commit
0cf4118330
@ -44,7 +44,6 @@ typedef struct _socket_t {
|
|||||||
JSValue _onConnect;
|
JSValue _onConnect;
|
||||||
JSValue _onRead;
|
JSValue _onRead;
|
||||||
JSValue _onError;
|
JSValue _onError;
|
||||||
JSValue _info;
|
|
||||||
uint64_t created_ms;
|
uint64_t created_ms;
|
||||||
} socket_t;
|
} socket_t;
|
||||||
|
|
||||||
@ -67,7 +66,6 @@ static JSValue _socket_getPeerName(JSContext* context, JSValueConst this_val, in
|
|||||||
static JSValue _socket_getPeerCertificate(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
static JSValue _socket_getPeerCertificate(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
||||||
static JSValue _socket_getNoDelay(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
static JSValue _socket_getNoDelay(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
||||||
static JSValue _socket_setNoDelay(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
static JSValue _socket_setNoDelay(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
||||||
static JSValue _socket_setInfo(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
|
||||||
static JSValue _sockets_get(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
static JSValue _sockets_get(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
||||||
|
|
||||||
static void _socket_onClose(uv_handle_t* handle);
|
static void _socket_onClose(uv_handle_t* handle);
|
||||||
@ -120,7 +118,6 @@ static void _socket_gc_mark(JSRuntime* runtime, JSValueConst value, JS_MarkFunc
|
|||||||
JS_MarkValue(runtime, socket->_onConnect, mark_func);
|
JS_MarkValue(runtime, socket->_onConnect, mark_func);
|
||||||
JS_MarkValue(runtime, socket->_onRead, mark_func);
|
JS_MarkValue(runtime, socket->_onRead, mark_func);
|
||||||
JS_MarkValue(runtime, socket->_onError, mark_func);
|
JS_MarkValue(runtime, socket->_onError, mark_func);
|
||||||
JS_MarkValue(runtime, socket->_info, mark_func);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,11 +208,6 @@ socket_t* _socket_create_internal(JSContext* context)
|
|||||||
JS_DefinePropertyGetSet(context, object, atom, get_no_delay, set_no_delay, 0);
|
JS_DefinePropertyGetSet(context, object, atom, get_no_delay, set_no_delay, 0);
|
||||||
JS_FreeAtom(context, atom);
|
JS_FreeAtom(context, atom);
|
||||||
|
|
||||||
atom = JS_NewAtom(context, "info");
|
|
||||||
JSValue set_info = JS_NewCFunction(context, _socket_setInfo, "setInfo", 1);
|
|
||||||
JS_DefinePropertyGetSet(context, object, atom, JS_UNDEFINED, set_info, 0);
|
|
||||||
JS_FreeAtom(context, atom);
|
|
||||||
|
|
||||||
++_open_count;
|
++_open_count;
|
||||||
uv_tcp_init(tf_task_get_loop(socket->_task), &socket->_socket);
|
uv_tcp_init(tf_task_get_loop(socket->_task), &socket->_socket);
|
||||||
socket->_socket.data = socket;
|
socket->_socket.data = socket;
|
||||||
@ -1094,15 +1086,6 @@ JSValue _socket_setNoDelay(JSContext* context, JSValueConst this_val, int argc,
|
|||||||
return JS_UNDEFINED;
|
return JS_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSValue _socket_setInfo(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
|
|
||||||
{
|
|
||||||
socket_t* socket = JS_GetOpaque(this_val, _classId);
|
|
||||||
JSValue old = socket->_info;
|
|
||||||
socket->_info = JS_DupValue(context, argv[0]);
|
|
||||||
JS_FreeValue(context, old);
|
|
||||||
return JS_UNDEFINED;
|
|
||||||
}
|
|
||||||
|
|
||||||
JSValue _sockets_get(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
|
JSValue _sockets_get(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
|
||||||
{
|
{
|
||||||
JSValue array = JS_NewArray(context);
|
JSValue array = JS_NewArray(context);
|
||||||
@ -1115,7 +1098,6 @@ JSValue _sockets_get(JSContext* context, JSValueConst this_val, int argc, JSValu
|
|||||||
JS_SetPropertyStr(context, entry, "connected", JS_NewBool(context, s->_connected));
|
JS_SetPropertyStr(context, entry, "connected", JS_NewBool(context, s->_connected));
|
||||||
JS_SetPropertyStr(context, entry, "tls", JS_NewBool(context, s->_tls != NULL));
|
JS_SetPropertyStr(context, entry, "tls", JS_NewBool(context, s->_tls != NULL));
|
||||||
JS_SetPropertyStr(context, entry, "age_seconds", JS_NewFloat64(context, (uv_now(tf_task_get_loop(s->_task)) - s->created_ms) / 1000.0));
|
JS_SetPropertyStr(context, entry, "age_seconds", JS_NewFloat64(context, (uv_now(tf_task_get_loop(s->_task)) - s->created_ms) / 1000.0));
|
||||||
JS_SetPropertyStr(context, entry, "info", JS_DupValue(context, s->_info));
|
|
||||||
JS_SetPropertyUint32(context, array, i, entry);
|
JS_SetPropertyUint32(context, array, i, entry);
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
|
@ -1755,7 +1755,7 @@ static void _tf_ssb_connection_dispatch_scheduled(tf_ssb_connection_t* connectio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _tf_ssb_connection_destroy(tf_ssb_connection_t* connection, const char* reason)
|
static void _tf_ssb_connection_destroy(tf_ssb_connection_t* connection, const char* reason)
|
||||||
{
|
{
|
||||||
tf_ssb_t* ssb = connection->ssb;
|
tf_ssb_t* ssb = connection->ssb;
|
||||||
if (!connection->destroy_reason)
|
if (!connection->destroy_reason)
|
||||||
|
Loading…
Reference in New Issue
Block a user