diff options
author | 2005-09-23 06:16:52 +1000 | |
---|---|---|
committer | 2005-09-23 06:16:52 +1000 | |
commit | f971e02256f903fa58fbc288629009d47fc89712 (patch) | |
tree | c64b639776ab294a7f17a374ddb3ad1743939a8f /fishd.c | |
parent | fcdaed44d73b0f151f53a304501c987b7a649446 (diff) |
Exportable universal variables
darcs-hash:20050922201652-ac50b-f70e7607b4ace24da4020f2d432718dc335e5bdd.gz
Diffstat (limited to 'fishd.c')
-rw-r--r-- | fishd.c | 33 |
1 files changed, 7 insertions, 26 deletions
@@ -107,48 +107,29 @@ int get_socket() return s; } -void enqueue( const void *k, - const void *v, - void *q) -{ - const wchar_t *key = (const wchar_t *)k; - const wchar_t *val = (const wchar_t *)v; - queue_t *queue = (queue_t *)q; - - message_t *msg = create_message( SET, key, val ); - msg->count=1; - - q_put( queue, msg ); -} - -void enqueue_all( connection_t *c ) -{ - hash_foreach2( &env_universal_var, - &enqueue, - (void *)&c->unsent ); - try_send_all( c ); -} - void broadcast( int type, const wchar_t *key, const wchar_t *val ) { connection_t *c; message_t *msg; + debug( 1, L"Got message %d %ls %ls", type, key, val ); + if( !conn ) return; - - msg = create_message( type, key, val ); + + msg = create_message( type, key, val ); + /* Don't merge loops, or try_send_all can free the message prematurely */ - + for( c = conn; c; c=c->next ) { msg->count++; q_put( &c->unsent, msg ); } - + for( c = conn; c; c=c->next ) { try_send_all( c ); |