error: QIODevice ::readLine(QSslSocket):Called with maxSize <2
If a request is greater than the maxRequestSize parameter value, the current connection will be stuck in an endless loop and the output will be: QIODevice ::readLine(QSslSocket):Called with maxSize <2
After investigation, it was found to be the following code problem, and I have repaired the code in the figure
According to the Qt documentation, other waitFor functions such as waitForBytesWritten function fail randomly in windows, so this function should not be used here. When this function fails, it will cause readyRead signals to enter multiple times, resulting in bugs The disconnectFromHost function waits for data to be written before disconnecting, so you can use disconnectFromHost without using waitForBytesWritten HttpResponse: at the same time: writeToSocket QByteArray (data) you also use the waitForBytesWritten function in the function, the official recommended QEventLoop cooperate with corresponding signal solution, My solution is to implement the waitFor function from QTcpSocket