# File lib/rev/http_client.rb, line 387
387:     def process_body
388:       # FIXME the proper thing to do here is probably to keep reading until
389:       # the socket closes, then assume that's the end of the body, provided
390:       # the server has specified Connection: close
391:       if @bytes_remaining.nil?
392:         on_error "no content length specified"
393:         @state = :invalid
394:       end
395: 
396:       if @data.size < @bytes_remaining
397:         @bytes_remaining -= @data.size
398:         on_body_data @data.read
399:         return false
400:       end
401: 
402:       on_body_data @data.read(@bytes_remaining)
403:       @bytes_remaining = 0
404: 
405:       if @data.empty?
406:         on_request_complete
407:         @state = :finished
408:       else
409:         on_error "garbage at end of body"
410:         @state = :invalid
411:       end
412: 
413:       false
414:     end