1. 23 Oct, 2008 2 commits
  2. 22 Oct, 2008 1 commit
  3. 15 Oct, 2008 1 commit
  4. 08 Oct, 2008 2 commits
  5. 29 Sep, 2008 2 commits
  6. 07 Sep, 2008 8 commits
  7. 06 Sep, 2008 1 commit
  8. 28 Aug, 2008 1 commit
  9. 26 Aug, 2008 1 commit
  10. 12 Apr, 2008 2 commits
  11. 26 Jan, 2008 3 commits
    • Eric Wong's avatar
      Revert the queue implementation and commands · 688289b2
      Eric Wong authored
      It's too ugly and broken (both technically and usability-wise)
      to be worth supporting in any stable release.
      
      In one sentence: The queue is a very crippled version of the
      playlist that takes precedence over the normal playlist.
      
      How is it crippled?
      
      * The "queueid" command only allows the queuing of songs
      ALREADY IN THE PLAYLIST!  This promotes having the entire mpd
      database of songs in the playlist, which is a stupid practice
      to begin with.
      
      * It doesn't allow for meaningful rearranging and movement
      of songs within the queue.  To move a song, you'd need to
      dequeue and requeue it (and other songs on the list).
      Why?  The playlist already allows _all_ these features
      and shows everything a client needs to know about the ordering
      of songs in a _single_ command!
      
      * Random was a stupid idea to begin with and unfortunately
      we're stuck supporting it since we've always had it.  Users
      should learn to use "shuffle" instead and not look at their
      playlists.  Implementing queue because we have the problem of
      random is just a bandage fix and digging ourselves a new hole.
      
      This protocol addition was never in a stable release of mpd, so
      reverting it will only break things for people following trunk;
      which I'm not too worried about.  I am however worried about
      long-term support of this misfeature, so I'm removing it.
      
      Additionally, there are other points:
      
      * It's trivially DoS-able:
      
      (while true; do echo queueid $song_id; done) | nc $MPD_HOST $MPD_PORT
      
      The above commands would cause the queue to become infinitely
      expanding, taking up all available memory in the system.  The
      mpd playlist was implemented as an array with a fixed (but
      configurable) size limit for this reason.
      
      * It's not backwards-compatible.  All clients would require
      upgrades (and additional complexity) to even know what the
      next song in the playlist is.  mpd is a shared architecture,
      and we should not violate the principle of least astonishment
      here.
      
      This removes the following commands:
      queueid, dequeue, queueinfo
      
      Additionally, the status field of "playlistqueue: " is removed
      from the status command.
      
      While this DoS is trivial to fix, the design is simply too
      broken to ever support in a real release.
      
      The overloading of the "addid" command and the allowing of
      negative numbers to be used as offsets is far more flexible.
      
      This improved "addid" is completely backwards-compatible with
      all clients, and does not require clients to have UI changes or
      run additional commands to display the queue.
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@7155 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      688289b2
    • Eric Wong's avatar
      storedPlaylist: prevent potential DoS from stored playlist commands · 29df7036
      Eric Wong authored
      While mpd has always protected against the infinite expansion of
      the main playlist by limiting its size in memory, however the
      new storedPlaylist code has never checked for this limit.
      
      Malicious (or clumsy) users could repeatedly append songs to
      stored playlists, causing files to grow increasingly large
      on disk.  Attempting to load extremely large files into memory
      will require mpd to slurp that all into memory, and ultimately
      the file would be unusable by mpd because of the configurable
      playlist size limit.
      
      Now we limit stored playlists to the max_playlist_length
      configuration variable set by the user (default is 16384).  We
      will refuse to append to playlist files if they hit that limit;
      and also refuse to load more than the specified amount of songs
      into memory.
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@7154 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      29df7036
    • Eric Wong's avatar
      addToPlaylist/addSongToPlaylist: printId argument changed to added_id · 2f0e5bfd
      Eric Wong authored
      Instead of printing out the Id from playlist.c, instead set
      the integer that added_id poitns to if added_id is non-NULL.
      
      This makes the API cleaner and will allow us to use additional
      commands to manipulate the newly-added song_id.  Callers
      (handleAddId) that relied on printId to print it to the given
      fd have now been modified to print the ID at a higher-level;
      making playlist.c less-dependent on protocol details.
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@7149 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      2f0e5bfd
  12. 03 Jan, 2008 1 commit
    • Eric Wong's avatar
      Cleanup #includes of standard system headers and put them in one place · cb8f1af3
      Eric Wong authored
      This will make refactoring features easier, especially now that
      pthreads support and larger refactorings are on the horizon.
      
      Hopefully, this will make porting to other platforms (even
      non-UNIX-like ones for masochists) easier, too.
      
      os_compat.h will house all the #includes for system headers
      considered to be the "core" of MPD.  Headers for optional
      features will be left to individual source files.
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      cb8f1af3
  13. 01 Jan, 2008 1 commit
  14. 26 Sep, 2007 1 commit
  15. 16 May, 2007 1 commit
  16. 05 Apr, 2007 1 commit
  17. 24 Feb, 2007 1 commit
  18. 20 Nov, 2006 1 commit
  19. 20 Aug, 2006 1 commit
  20. 30 Jul, 2006 2 commits
    • Eric Wong's avatar
      Standardize state_file handling routines. · 12aec573
      Eric Wong authored
      This way it's easier to manage and extend.
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@4494 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      12aec573
    • Eric Wong's avatar
      interface/connection malloc reductions from mpd-ke · 4cf5d04c
      Eric Wong authored
      This patch massively reduces the amount of heap allocations at
      the interface/command layer.  Most commands with minimal output
      should not allocate memory from the heap at all.  Things like
      repeatedly polling status, currentsong, and volume changes
      should be faster as a result, and more importantly, not a source
      of memory fragmentation.
      
      These changes should be safe in that there's no way for a
      remote-client to corrupt memory or otherwise do bad stuff to
      MPD, but an extra set of eyes to review would be good.  Of
      course there's never any warranty :)
      
      No longer do we use FILE * structures in the interface, which means
      we don't have to allocate any new memory for most connections.
      
      Now, before you go on about losing the buffering that FILE *
      +implies+, remember that myfprintf() never took advantage of
      any of the stdio buffering features.
      
      To reduce the diff and make bugs easier to spot in the diff,
      I've kept myfprintf in places where we write to files (and not
      network interfaces).  Expect myfprintf to go away entirely soon
      (we'll use fprintf for writing regular files).
      
      git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
      4cf5d04c
  21. 20 Jul, 2006 1 commit
  22. 14 Jul, 2006 2 commits
  23. 13 Jul, 2006 1 commit
  24. 08 May, 2006 1 commit
  25. 23 Apr, 2006 1 commit