Skip to content

Incorrect EOF test in getMessages #57

@mzygmuntowicz

Description

@mzygmuntowicz

In ClientImpl::getMessages there is an icorrect EOF test:
if ($read === false || feof($this->_socket)) {
the correct one should look like:
if ($read === false || (strlen($read) == 0 && @Feof($this->_socket))) {

I found this one having occassional read exceptions during a logoff command. The problem
somehow relates to the fact, that fread can return data, but later feof test signals end of file condition.
Therefore feof should be tested only if fread returns an empty string, which means there is no data, an end of file has been reached or some other error occured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions