~vcs-imports/mpd/trunk

Viewing all changes in revision 1872.

  • Committer: normalperson
  • Date: 2008-06-30 02:43:13 UTC
  • Revision ID: vcs-imports@canonical.com-20080630024313-31sgc4jxo3esvw9s
http: initial rewrite using ringbuffer + pthreads

This institutes the usage of a separate thread to buffer HTTP
input.  It is basically practice code for using the ringbuffer
code which I plan on reusing for the OutputBuffer as well as
further input buffering for disk (networked filesystems over
WAN, laptops on battery, etc).

Each readFromInputStream() call on an HTTP stream can take
several seconds to complete, short reads are avoided.

A single-threaded solution for systems supporting large enough
SO_RCVBUF values should also be possible and will likely be done
in the future; but this lock-free(except when full/empty)
ringbuffer is cool :)

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: