MCPcopy Create free account
hub / github.com/KikoPlayProject/KikoPlay / readFromSocket

Method readFromSocket

LANServer/httpserver/httprequest.cpp:293–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293void HttpRequest::readFromSocket(QTcpSocket* socket)
294{
295 Q_ASSERT(status!=complete);
296 if (status==waitForRequest)
297 {
298 readRequest(socket);
299 }
300 else if (status==waitForHeader)
301 {
302 readHeader(socket);
303 }
304 else if (status==waitForBody)
305 {
306 readBody(socket);
307 }
308 if ((boundary.isEmpty() && currentSize>maxSize) || (!boundary.isEmpty() && currentSize>maxMultiPartSize))
309 {
310 Logger::logger()->log(Logger::LANServer, "HttpRequest: received too many bytes");
311 status=abort;
312 }
313 if (status==complete)
314 {
315 // Extract and decode request parameters from url and body
316 decodeRequestParams();
317 // Extract cookies from headers
318 extractCookies();
319 }
320}
321
322
323HttpRequest::RequestStatus HttpRequest::getStatus() const

Callers 1

readMethod · 0.80

Calls 2

logMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected