add chunk read support and fix proxy bugs; forked from httplib2-0.8