Skip to content

Commit ed18c7c

Browse files
skmedixnicolas-grekas
authored andcommitted
[Mailer] Fix SMTP stream EOF handling on Windows by using feof()
1 parent 86b9250 commit ed18c7c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ public function readLine(): string
8080

8181
$line = @fgets($this->out);
8282
if ('' === $line || false === $line) {
83-
$metas = stream_get_meta_data($this->out);
84-
if ($metas['timed_out']) {
83+
if (stream_get_meta_data($this->out)['timed_out']) {
8584
throw new TransportException(sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription()));
8685
}
87-
if ($metas['eof']) {
86+
if (feof($this->out)) { // don't use "eof" metadata, it's not accurate on Windows
8887
throw new TransportException(sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription()));
8988
}
9089
if (false === $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