[wp-trac] [WordPress Trac] #16236: Method to stream file downloads in HTTP API, to reduce update memory footprint

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 12 23:45:37 UTC 2011


#16236: Method to stream file downloads in HTTP API, to reduce update memory
footprint
----------------------------+-----------------------------
 Reporter:  markjaquith     |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  Future Release
Component:  HTTP            |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  3.2-early       |
----------------------------+-----------------------------

Comment (by dd32):

 >  if ( strpos( $block, "\r\n\r\n" ) ) {

 Is there a chance that that could fall over 2 blocks, ie. \r\n in one
 block, \r\n in the next?

 My solution for that, would be
 {{{
 if ( $bodystarted ) {
 write to file
 } else {
 write to headers
 check headers for \r\n
  split headers
  write a bit to file
  bodystarted = true;
  NEXT!
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16236#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list