andig / moode

Moode audio distribution
3 stars 3 forks source link

can we send multiple mpd commands? #6

Closed andig closed 9 years ago

andig commented 9 years ago

From what I've seen, sending a command always needs to read the response. However, we also have code like this:

case 'savepl':
    if (isset($_GET['plname']) && $_GET['plname'] != '') {
        sendMpdCommand($mpd,"rm \"" .html_entity_decode($_GET['plname']) . "\"");
        sendMpdCommand($mpd,"save \"" .html_entity_decode($_GET['plname']) . "\"");
        $res = readMpdResponse($mpd);
    }
    break;

Is this broken and should rather send+read response? How das mpd handle " signs?

moodeaudio commented 9 years ago

Yes broken although it does seem to work ok. I think should always b "send cmd + read response”.

On Aug 17, 2015, at 4:20 AM, andig notifications@github.com wrote:

From what I've seen, sending a command always needs to read the response. However, we also have code like this:

case 'savepl': if (isset($_GET['plname']) && $_GET['plname'] != '') { sendMpdCommand($mpd,"rm \"" .html_entity_decode($_GET['plname']) . "\""); sendMpdCommand($mpd,"save \"" .html_entity_decode($_GET['plname']) . "\""); $res = readMpdResponse($mpd); } break; Is this broken and should rather send+read response? How das mpd handle " signs?

— Reply to this email directly or view it on GitHub https://github.com/andig/moode/issues/6.

andig commented 9 years ago

Fixed throughout.