QtWebApp icon indicating copy to clipboard operation
QtWebApp copied to clipboard

error: QIODevice ::readLine(QSslSocket):Called with maxSize <2

Open HanChinese-LIURUI opened this issue 1 year ago • 0 comments

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 image image

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

HanChinese-LIURUI avatar Aug 10 '24 06:08 HanChinese-LIURUI