Skip to content

Commit b49f580

Browse files
committed
[Mailer] Thrown TransportException when unable to read from socket
1 parent 0cd0c49 commit b49f580

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function readLine(): string
7777
return '';
7878
}
7979

80-
$line = fgets($this->out);
80+
$line = @fgets($this->out);
8181
if ('' === $line || false === $line) {
8282
$metas = stream_get_meta_data($this->out);
8383
if ($metas['timed_out']) {
@@ -86,6 +86,9 @@ public function readLine(): string
8686
if ($metas['eof']) {
8787
throw new TransportException(sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription()));
8888
}
89+
if (false === $line) {
90+
throw new TransportException(sprintf('Unable to read from connection to "%s".', $this->getReadConnectionDescription()));
91+
}
8992
}
9093

9194
$this->debug .= sprintf('< %s', $line);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy