1. 14 Oct, 2008 1 commit
    • Max Kellermann's avatar
      command: added command "idle" · a3e3d2c9
      Max Kellermann authored
      "idle" waits until something noteworthy happens on the server,
      e.g. song change, playlist modified, database updated.  This allows
      clients to keep up to date without polling.
      a3e3d2c9
  2. 10 Oct, 2008 2 commits
  3. 09 Oct, 2008 4 commits
    • Max Kellermann's avatar
      update: make the job id unsigned · 4beba26c
      Max Kellermann authored
      Since the return value cannot be -1 anymore, we can make it unsigned.
      4beba26c
    • Max Kellermann's avatar
      update: job ID must be positive · f1022bcc
      Max Kellermann authored
      The documentation for directory_update_init() was incorrect: a job ID
      must be positive, not non-negative.  If the update queue is full and
      no job was created, it makes more sense to return 0 instead of -1,
      because it is more consistent with the return value of isUpdatingDB().
      f1022bcc
    • Max Kellermann's avatar
      diretory: moved code to directory_save.c, directory_print.c · a0c044df
      Max Kellermann authored
      Remove clutter from directory.c.  Everything which saves or loads
      to/from the hard disk goes to directory_save.c, and code which sends
      directory information to the client is moved into directory_print.c.
      a0c044df
    • Qball Cow's avatar
      Fix error code for "Playlist already exists" · ecc3c39e
      Qball Cow authored
      With commit 6dcd7fea (if I am not mistaken) the error returned when
      you try to save to an existing playlist is wrong.  Instead of
      MPD_ACK_ERROR_EXIST, MPD_ACK_ERROR_NO_EXIST is returned.  This is
      obviously wrong and breaks gmpc.
      ecc3c39e
  4. 08 Oct, 2008 4 commits
  5. 06 Oct, 2008 3 commits
    • Eric Wong's avatar
      command: fix return status · d51da61b
      Eric Wong authored
      This got broken when listHandlerFunc was removed.  Since we no
      longer need it and it's confusing, remove processCommandInternal
      and just use process_command.
      d51da61b
    • Eric Wong's avatar
      command: get rid of specialized list handlers · 8faf6487
      Eric Wong authored
      commands should really not behave differently if they're issued
      inside a command list or not; so stop having special handler
      functions to deal with them.  "update" was the only command
      that used this functionality and I changed that in the last
      commit to serialize access.
      8faf6487
    • Eric Wong's avatar
      directory: simplify list update handling logic · 37a8239f
      Eric Wong authored
      Now the "update" command can be issued multiple times regardless
      of whether the client is in list mode or not.
      
      We serialize the update tasks to prevent updates from trampling
      over each other and will spawn another update task
      once the current one is finished updating and reaped.
      
      Right now we cap the queue size to 32 which is probably enough (I
      bet most people usually run update with no argument anyways);
      but we can make it grow/shrink dynamically if needed.  There'll
      still be a hard-coded limit to prevent DoS attacks, though.
      37a8239f
  6. 29 Sep, 2008 2 commits
  7. 25 Sep, 2008 1 commit
    • Max Kellermann's avatar
      update: send proper response to the client · 05f66e04
      Max Kellermann authored
      Due to a merge error, I broke the function handleUpdate().  It did not
      do anything for the global update, and it did not send a proper
      response to the client.  This patch fixes both bugs.
      05f66e04
  8. 23 Sep, 2008 2 commits
    • Max Kellermann's avatar
      command: fix command "addid" · ad92d9a8
      Max Kellermann authored
      With patch 8d2830b3, I broke "addid": it did not return the id of the
      new song, because of a typo in the return condition (== instead of
      !=).
      ad92d9a8
    • Eric Wong's avatar
      directory: update do its work inside a thread · 3f0ae13c
      Eric Wong authored
      A lot of the preparation was needed (and done in previous
      months) in making update thread-safe, but here it is.
      
      This was the first thing I made work inside a thread when I
      started mpd-uclinux many years ago, and also the last thing I've
      done in mainline mpd to work inside a thread, go figure.
      3f0ae13c
  9. 07 Sep, 2008 21 commits