aboutsummaryrefslogtreecommitdiffstats
path: root/src/interface.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-11 17:37:47 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-11 17:37:47 +0000
commitfc7a264e4d3f6ba93d52722455e6d4ec7ca671fb (patch)
treec55738667ba5973be0435fd54048269013ae89c2 /src/interface.c
parent87f53c94d7361bb3aaa1369d26f76f049905fc82 (diff)
downloadmpd-fc7a264e4d3f6ba93d52722455e6d4ec7ca671fb.tar.gz
mpd-fc7a264e4d3f6ba93d52722455e6d4ec7ca671fb.tar.xz
mpd-fc7a264e4d3f6ba93d52722455e6d4ec7ca671fb.zip
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
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c15
1 files changed, 10 insertions, 5 deletions
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) {