Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some prolem with slow connection. Qt 5.4 Win 7 x64 #60

Closed
vedun opened this issue Jan 10, 2015 · 1 comment
Closed

Some prolem with slow connection. Qt 5.4 Win 7 x64 #60

vedun opened this issue Jan 10, 2015 · 1 comment
Assignees
Labels

Comments

@vedun
Copy link
Contributor

vedun commented Jan 10, 2015

Greetings.
The following minimum code demonstrates the problem:

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    HttpServer server;
    QObject::connect(&server, &HttpServer::requestReady,
                     [](HttpServerRequest &request, HttpServerResponse &res) {
                        qDebug() << "request body = " << request.readBody();
                        res.writeHead(200, "OK");
                        res.end("Hello World\n");
    });
    server.listen(QHostAddress::Any, 8000);
    return a.exec();
}

When client sends POST request with some time pause between headers and request body, i see empty request body in handler.
Investigation of source has not yet led to a beautiful solution. Please advise how to act in a case where I need to use POST request data in handler?
Thank.

@vinipsmaker vinipsmaker self-assigned this Jan 11, 2015
@vinipsmaker
Copy link
Owner

The data() signal is emitted when a piece of body is received. Use readBody() after data() or end() are emitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants