NSM: Mutli-server fixes.

This commit is contained in:
Jonathan Moore Liles 2012-02-23 04:10:55 -08:00
parent 7cfa1ec38a
commit f15523ea9e
1 changed files with 28 additions and 13 deletions

View File

@ -1476,12 +1476,20 @@ OSC_HANDLER( broadcast )
/* also relay to attached GUI so that the broadcast can be /* also relay to attached GUI so that the broadcast can be
* propagated to another NSMD instance */ * propagated to another NSMD instance */
if ( gui_is_active ) if ( gui_is_active )
{
char *u1 = lo_address_get_url( gui_addr );
if ( strcmp( u1, sender_url ) )
{ {
new_args.push_front( OSC::OSC_String( to_path ) ); new_args.push_front( OSC::OSC_String( to_path ) );
osc_server->send( gui_addr, path, new_args ); osc_server->send( gui_addr, path, new_args );
} }
free(u1);
}
free( sender_url ); free( sender_url );
return 0; return 0;
@ -1641,15 +1649,18 @@ OSC_HANDLER( resume )
{ {
Client *c = get_client_by_id( &client, &argv[0]->s ); Client *c = get_client_by_id( &client, &argv[0]->s );
/* FIXME: return error if no such client? */
if ( c )
{
if ( c->pid == 0 && if ( c->pid == 0 &&
! c->active ) ! c->active )
{ {
if ( ! launch( c->executable_path, c->client_id ) ) if ( ! launch( c->executable_path, c->client_id ) )
{ {
} }
} }
}
return 0; return 0;
} }
@ -1659,10 +1670,14 @@ OSC_HANDLER( client_save )
{ {
Client *c = get_client_by_id( &client, &argv[0]->s ); Client *c = get_client_by_id( &client, &argv[0]->s );
/* FIXME: return error if no such client? */
if ( c )
{
if ( c->active ) if ( c->active )
{ {
command_client_to_save( c ); command_client_to_save( c );
} }
}
return 0; return 0;
} }