From fc7a264e4d3f6ba93d52722455e6d4ec7ca671fb Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sun, 11 Apr 2004 17:37:47 +0000 Subject: incremental updates and command-list/update kung fu this needs some serious cleaning up and testing git-svn-id: https://svn.musicpd.org/mpd/trunk@692 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/interface.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/interface.c') diff --git a/src/interface.c b/src/interface.c index 0689e9319..747ac4097 100644 --- a/src/interface.c +++ b/src/interface.c @@ -233,6 +233,7 @@ int interfaceReadInput(Interface * interface) { if(argArrayLength==0); else if(strcmp(argArray[0],INTERFACE_LIST_MODE_END)==0) { ListNode * node = interface->commandList->firstNode; + ListNode * tempNode; ret = 0; while(node!=NULL) { @@ -240,12 +241,16 @@ int interfaceReadInput(Interface * interface) { int argArrayLength; argArrayLength = buffer2array((char *)node->data,&argArray); DEBUG("interface %i: process command \"%s\"\n",interface->num,node->data); - ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray); + ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray,node); DEBUG("interface %i: command returned %i\n",interface->num,ret); freeArgArray(argArray,argArrayLength); - node = node->nextNode; - if(ret!=0 || - interface->expired) { + tempNode = node->nextNode; + deleteNodeFromList( + interface->commandList, + node); + node = tempNode; + if(ret!=0 || interface->expired) + { node = NULL; } } @@ -295,7 +300,7 @@ int interfaceReadInput(Interface * interface) { } else { DEBUG("interface %i: process command \"%s\"\n",interface->num,interface->buffer); - ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray); + ret = processCommand(interface->fp,&(interface->permission),argArrayLength,argArray,NULL); DEBUG("interface %i: command returned %i\n",interface->num,ret); } if(ret==0) { -- cgit v1.2.3