Merge branch 'master' of github.com:highfidelity/hifi into near-grab-via-parenting

This commit is contained in:
Seth Alves 2015-12-17 11:48:04 -08:00
commit 9438015f3a
2 changed files with 14 additions and 8 deletions

View file

@ -147,10 +147,10 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
}
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
auto mimeType = QString { "text/html" };
if (localFileInfo.suffix() != "shtml") {
mimeType = mimeDatabase.mimeTypeForFile(filePath).name();
}
// otherwise use the mimeDatabase to look it up
auto mimeType = localFileInfo.suffix() == "shtml"
? QString { "text/html" }
: mimeDatabase.mimeTypeForFile(filePath).name();
connection->respond(HTTPConnection::StatusCode200, localFileData, qPrintable(mimeType));

View file

@ -236,8 +236,14 @@ void Socket::readPendingDatagrams() {
auto buffer = std::unique_ptr<char[]>(new char[packetSizeWithHeader]);
// pull the datagram
_udpSocket.readDatagram(buffer.get(), packetSizeWithHeader,
senderSockAddr.getAddressPointer(), senderSockAddr.getPortPointer());
auto sizeRead = _udpSocket.readDatagram(buffer.get(), packetSizeWithHeader,
senderSockAddr.getAddressPointer(), senderSockAddr.getPortPointer());
if (sizeRead <= 0) {
// we either didn't pull anything for this packet or there was an error reading (this seems to trigger
// on windows even if there's not a packet available)
continue;
}
auto it = _unfilteredHandlers.find(senderSockAddr);
@ -248,7 +254,7 @@ void Socket::readPendingDatagrams() {
it->second(std::move(basePacket));
}
return;
continue;
}
// check if this was a control packet or a data packet
@ -276,7 +282,7 @@ void Socket::readPendingDatagrams() {
packet->getDataSize(),
packet->getPayloadSize())) {
// the connection indicated that we should not continue processing this packet
return;
continue;
}
}