swiftmailer/swiftmailer — pull request #469 by lstrojny (2014-05-02 14:32:36+00:00)
Title: Fixing infinite loop with closed connection in SMTP transport

When a long-running script uses a connection to the SMTP server and that connection is already closed due to a timeout, `fwrite()` will return 0 when writing to the socket. This results in an infinite loop in `Swift_Transport_StreamBuffer`. See http://de2.php.net/fwrite#96951 for an explanation of the behavior.