[wp-trac] [WordPress Trac] #28616: ftp_fput should have a retry threshold

WordPress Trac noreply at wordpress.org
Mon Jun 23 19:47:51 UTC 2014

#28616: ftp_fput should have a retry threshold
 Reporter:  runderwo        |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Filesystem API  |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:

Comment (by runderwo):

 I patched around it with this hack for now.

 while (($ret = ftp_fput($this->link, $file, $temp, $type)) != 1)
     error_log("Reconnecting"); $this->connect();

 This naive approach retries infinitely, reconnecting to FTP server on
 failure.  There should probably be a new option to ftp_set_option() to
 control the number of connection retries.

 It doesn't really seem feasible to fix at the higher level because many
 things call put_contents() directly (like unzip layer).  I don't see an
 option besides making the lower level more resilient.

Ticket URL: <https://core.trac.wordpress.org/ticket/28616#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list