Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed18c7c

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

File tree

1 file changed

+2
-3
lines changed
Filter options

1 file changed

+2
-3
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php
+2-3
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.