jotak / mipod

A node module for exposing an MPD API, either as REST service, Websocket or as a library to include. Written in Typescript, executed in Javascript.
MIT License
17 stars 4 forks source link

MPD responses > 16Kb are truncated #13

Closed Delapouite closed 9 years ago

Delapouite commented 9 years ago

Hi

When you perform a search command with a huge amount of data, the response is truncated at 16Kb (default highWaterMark value).

I've not yet look how the connection is handled in MpdClient but I guess the problem lies in the on 'data' callback.

Delapouite commented 9 years ago

I found the guilty part.

I'm not actually doing a real search command but a custom one. Custom triggers exec() but without any stopper "\nOKn\". So a custom command works fine for small order command (not expecting an answer back) but fails on big query command like playlistfind.

jotak commented 9 years ago

Ok, can you then use "search" instead of "custom"? I'll also add the possibility to add a stopper on "custom".

Delapouite commented 9 years ago

The problem with the search command is that it queries the MPD database, but not a particular playlist. So in the response, songs don't have a pos key, which is then needed to use the play-idx command. (In this case I don't want to use play/entry which clears the current playlist before playing the file.)

jotak commented 9 years ago

Done, "custom" can now use a stopper.