use enum in PacketHeaders, coding standard fixes in Connection

This commit is contained in:
Stephen Birarda 2016-09-29 11:22:05 -07:00
parent e7c0ed035f
commit fdcface8cb
3 changed files with 9 additions and 6 deletions

View file

@ -152,13 +152,13 @@ void Connection::queueInactive() {
} }
void Connection::queueTimeout() { void Connection::queueTimeout() {
updateCongestionControlAndSendQueue([this]{ updateCongestionControlAndSendQueue([this] {
_congestionControl->onTimeout(); _congestionControl->onTimeout();
}); });
} }
void Connection::queueShortCircuitLoss(quint32 sequenceNumber) { void Connection::queueShortCircuitLoss(quint32 sequenceNumber) {
updateCongestionControlAndSendQueue([this, sequenceNumber]{ updateCongestionControlAndSendQueue([this, sequenceNumber] {
_congestionControl->onLoss(SequenceNumber { sequenceNumber }, SequenceNumber { sequenceNumber }); _congestionControl->onLoss(SequenceNumber { sequenceNumber }, SequenceNumber { sequenceNumber });
}); });
} }
@ -691,7 +691,7 @@ void Connection::processACK(ControlPacketPointer controlPacket) {
} }
// give this ACK to the congestion control and update the send queue parameters // give this ACK to the congestion control and update the send queue parameters
updateCongestionControlAndSendQueue([this, ack, &controlPacket](){ updateCongestionControlAndSendQueue([this, ack, &controlPacket] {
if (_congestionControl->onACK(ack, controlPacket->getReceiveTime())) { if (_congestionControl->onACK(ack, controlPacket->getReceiveTime())) {
// the congestion control has told us it needs a fast re-transmit of ack + 1, add that now // the congestion control has told us it needs a fast re-transmit of ack + 1, add that now
_sendQueue->fastRetransmit(ack + 1); _sendQueue->fastRetransmit(ack + 1);
@ -780,7 +780,7 @@ void Connection::processNAK(ControlPacketPointer controlPacket) {
getSendQueue().nak(start, end); getSendQueue().nak(start, end);
// give the loss to the congestion control object and update the send queue parameters // give the loss to the congestion control object and update the send queue parameters
updateCongestionControlAndSendQueue([this, start, end](){ updateCongestionControlAndSendQueue([this, start, end] {
_congestionControl->onLoss(start, end); _congestionControl->onLoss(start, end);
}); });

View file

@ -58,8 +58,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
case PacketType::AssetGetInfo: case PacketType::AssetGetInfo:
case PacketType::AssetGet: case PacketType::AssetGet:
case PacketType::AssetUpload: case PacketType::AssetUpload:
// Introduction of TCPVegasCC as default congestion control return static_cast<PacketVersion>(AssetServerPacketVersion::VegasCongestionControl);
return 19;
case PacketType::NodeIgnoreRequest: case PacketType::NodeIgnoreRequest:
return 18; // Introduction of node ignore request (which replaced an unused packet tpye) return 18; // Introduction of node ignore request (which replaced an unused packet tpye)

View file

@ -189,6 +189,10 @@ const PacketVersion VERSION_MODEL_ENTITIES_SUPPORT_SIMPLE_HULLS = 62;
const PacketVersion VERSION_WEB_ENTITIES_SUPPORT_DPI = 63; const PacketVersion VERSION_WEB_ENTITIES_SUPPORT_DPI = 63;
const PacketVersion VERSION_ENTITIES_ARROW_ACTION = 64; const PacketVersion VERSION_ENTITIES_ARROW_ACTION = 64;
enum class AssetServerPacketVersion: PacketVersion {
VegasCongestionControl = 19
};
enum class AvatarMixerPacketVersion : PacketVersion { enum class AvatarMixerPacketVersion : PacketVersion {
TranslationSupport = 17, TranslationSupport = 17,
SoftAttachmentSupport, SoftAttachmentSupport,