Skip to content

"HTTPClient::end(void)" runs are too long #828

Closed
@xiruilin

Description

@xiruilin

In /libraries/HTTPClient/src/HTTPClient.cpp, function "void HTTPClient::end(void)", line 231:

    if(_tcp->available() > 0) {
        log_d("still data in buffer (%d), clean up.", _tcp->available());
        while(_tcp->available() > 0) {
            _tcp->read();
        }
    }

If the unread data is very large, it will take a long time. If changed to:

    if(_tcp->available() > 0) {
        log_d("still data in buffer (%d), clean up.", _tcp->available());
        _tcp->flush();
    }

You can achieve what you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions