immediately error in AssetClient if no active socket for AS

This commit is contained in:
Stephen Birarda 2016-10-12 14:29:05 -07:00
parent ca94fbc219
commit 3c70a25a40
2 changed files with 11 additions and 7 deletions

View file

@ -453,15 +453,17 @@ MessageID AssetClient::getAssetMapping(const AssetPath& path, MappingOperationCa
packetList->writeString(path);
nodeList->sendPacketList(std::move(packetList), *assetServer);
if (nodeList->sendPacketList(std::move(packetList), *assetServer)) {
_pendingMappingRequests[assetServer][messageID] = callback;
_pendingMappingRequests[assetServer][messageID] = callback;
return messageID;
} else {
callback(false, AssetServerError::NoError, QSharedPointer<ReceivedMessage>());
return INVALID_MESSAGE_ID;
return messageID;
} else {
qDebug() << "getAssetMapping would have been sent but no active socket - send back no response received";
}
}
callback(false, AssetServerError::NoError, QSharedPointer<ReceivedMessage>());
return INVALID_MESSAGE_ID;
}
MessageID AssetClient::getAllAssetMappings(MappingOperationCallback callback) {

View file

@ -65,6 +65,8 @@ void GetMappingRequest::doStart() {
auto assetClient = DependencyManager::get<AssetClient>();
qDebug() << "Asking asset client to get mapping for" << _path;
_mappingRequestID = assetClient->getAssetMapping(_path,
[this, assetClient](bool responseReceived, AssetServerError error, QSharedPointer<ReceivedMessage> message) {