clean up ACK error coding a little bit

git-svn-id: https://svn.musicpd.org/mpd/trunk@1321 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2004-06-04 00:49:33 +00:00
parent dafe92a9ed
commit ef6c500edb
8 changed files with 83 additions and 111 deletions

View File

@@ -41,7 +41,7 @@
#include <errno.h>
#include <signal.h>
#define GREETING "MPD"
#define GREETING "OK MPD"
#define INTERFACE_MAX_BUFFER_LENGTH MAXPATHLEN+1024
#define INTERFACE_LIST_MODE_BEGIN "command_list_begin"
@@ -120,8 +120,7 @@ void openInterface(Interface * interface, int fd) {
#endif
interface->outBuffer = malloc(interface->outBufSize);
myfprintf(interface->fp,"%s %s %s\n",COMMAND_RESPOND_OK,GREETING,
VERSION);
myfprintf(interface->fp, "%s %s\n", GREETING, VERSION);
printInterfaceOutBuffer(interface);
}
@@ -237,9 +236,7 @@ int interfaceReadInput(Interface * interface) {
interface->num,
ret);
if(ret==0) {
myfprintf(interface->fp,
"%s\n",
COMMAND_RESPOND_OK);
commandSuccess(interface->fp);
}
else if(ret==COMMAND_RETURN_CLOSE ||
interface->expired) {
@@ -291,7 +288,8 @@ int interfaceReadInput(Interface * interface) {
INTERFACE_LIST_MODE_END)
==0)
{
myfprintf(interface->fp,"%s not in command list mode\n",COMMAND_RESPOND_ERROR);
commandError(interface->fp,
"not in command list mode");
ret = -1;
}
else {
@@ -304,7 +302,7 @@ int interfaceReadInput(Interface * interface) {
DEBUG("interface %i: command returned %i\n",interface->num,ret);
}
if(ret==0) {
myfprintf(interface->fp,"%s\n",COMMAND_RESPOND_OK);
commandSuccess(interface->fp);
}
else if(ret==COMMAND_RETURN_CLOSE ||
interface->expired) {