diff options
author | David Barksdale <amatus@amatus.name> | 2014-07-14 23:45:38 -0500 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2014-07-14 23:45:38 -0500 |
commit | f5c3a4a54b5179d89718fc9f41c47a305c3d6373 (patch) | |
tree | 406d1265301b3ac88fad41daa7e1f8864dbfb02c /src | |
parent | ef43ae5e48b8dfa06265d147e54a744d3faefcd3 (diff) |
Write GNUNET_SERVER_client_{get,set}_user_context
Diffstat (limited to 'src')
-rw-r--r-- | src/js/server.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/js/server.js b/src/js/server.js index 9863813..4504e55 100644 --- a/src/js/server.js +++ b/src/js/server.js @@ -31,6 +31,8 @@ mergeInto(LibraryManager.library, { name: client_name, ref_count: 0, shtudown_now: false, + user_context: 0, + user_context_size: 0, }; SERVER.connect_notify_list.map(function(notify) { ccallFunc(Runtime.getFuncWrapper(notify.callback, 'vii'), 'void', @@ -165,6 +167,21 @@ mergeInto(LibraryManager.library, { // when we are shutting down. // Since we don't handle shutdown this is a noop for now. }, + GNUNET_SERVER_client_get_user_context___deps: ['$SERVER'], + GNUNET_SERVER_client_get_user_context_: function(client, size) { + if (0 == SERVER.clients[client].user_context && + 0 == SERVER.clients[client].user_context_size) + return 0; + assert(size == SERVER.clients[client].user_context_size); + return SERVER.clients[client].user_context; + }, + GNUNET_SERVER_client_set_user_context___deps: ['$SERVER'], + GNUNET_SERVER_client_set_user_context_: function(client, ptr, size) { + if (0 == ptr) + size = 0; + SERVER.clients[client].user_context = ptr; + SERVER.clients[client].user_context_size = size; + }, }); // vim: set expandtab ts=2 sw=2: |