Commit 69e7309ba164cca12633b176cdb88d46fa9da6a9
Fix a socket thread ownership issue
| |   |
| 23 | 23 | |
| 24 | 24 | #include <QDebug> |
| 25 | 25 | #include <QTcpSocket> |
| #include <QThread> |
| 26 | 27 | |
| 27 | 28 | #include "fastcgi.h" |
| 28 | 29 | |
| … | … | |
| 36 | 36 | , m_requestId(requestId) |
| 37 | 37 | , m_socket(socket) |
| 38 | 38 | { |
| m_socket->setParent(this); |
| 39 | 40 | open(QIODevice::ReadWrite | QIODevice::Unbuffered); |
| 40 | 41 | connect( |
| 41 | 42 | m_socket, |
| … | … | |
| 87 | 87 | |
| 88 | 88 | qint64 FastCgiStream::writeData(const char* data, qint64 dataSize) |
| 89 | 89 | { |
| Q_ASSERT(thread() == m_socket->thread()); |
| Q_ASSERT(thread() == QThread::currentThread()); |
| 90 | 92 | qint64 remaining = dataSize; |
| 91 | 93 | while(remaining > 0) |
| 92 | 94 | { |