Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class EndpointFlowProtocol<LinkageType: InboundDataLinkage>: ProtocolInstanceCon
}

public func start() {
log.debug("start")
fromExternal {
lower.invokeConnect(reference)
}
Expand All @@ -197,7 +196,6 @@ class EndpointFlowProtocol<LinkageType: InboundDataLinkage>: ProtocolInstanceCon
}

public func stop() {
log.debug("stop")
fromExternal {
lower.invokeDisconnect(reference)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftNetwork/Protocols/BridgeProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public struct BridgeDatagramProtocol: NetworkProtocol {
public func sendDatagrams(_ datagrams: consuming FrameArray) throws(NetworkError) {
let remotePort = remoteEndpoint!.port
guard let remoteInstance = BridgeInstance.instances[remotePort] else {
log.error("unable to find instance for port: \(remotePort)")
log.error("Unable to find instance for port: \(remotePort)")
datagrams.finalizeAllFramesAsFailed()
return
}
Expand Down Expand Up @@ -430,7 +430,7 @@ public struct BridgeStreamProtocol: NetworkProtocol {
public func sendStreamData(_ streamData: consuming FrameArray) throws(NetworkError) {
let remotePort = remoteEndpoint!.port
guard let remoteInstance = BridgeInstance.instances[remotePort] else {
log.error("unable to find instance for port: \(remotePort)")
log.error("Unable to find instance for port: \(remotePort)")
streamData.finalizeAllFramesAsFailed()
return
}
Expand Down
4 changes: 1 addition & 3 deletions Sources/SwiftNetwork/Protocols/HarnessProtocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ public class UpperHarness<LinkageType: InboundDataLinkage>: UpperHarnessProtocol
}

public func start() {
log.debug("start")
invokeConnect()
}

Expand All @@ -194,7 +193,6 @@ public class UpperHarness<LinkageType: InboundDataLinkage>: UpperHarnessProtocol
}

public func stop(error: NetworkError? = nil) {
log.debug("stop")
invokeDisconnect(error: error)
}

Expand Down Expand Up @@ -684,7 +682,7 @@ public class DatagramLowerHarness: LowerHarness<OutboundDatagramLinkage>, Bottom

public func receiveDatagrams(maximumDatagramCount: Int) throws(NetworkError) -> FrameArray? {
let array = pendingInboundPackets.drainArray(maximumFrameCount: maximumDatagramCount)
log.debug("deliver inbound datagram count: \(array.count)")
log.debug("Deliver inbound datagram count: \(array.count)")
return array
}

Expand Down
16 changes: 8 additions & 8 deletions Sources/SwiftNetwork/QUIC/Ack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ struct AckSpace: ~Copyable, PrefixedLoggable {
return 0
}
guard _slowPath(largestTimestamp != .zero) else {
log.debug("largest PN receive time can't be 0 (\(packetNumberSpace))")
log.debug("Largest PN receive time can't be 0 (\(packetNumberSpace))")
return 0
}
let largest = lastBlock.end
Expand Down Expand Up @@ -828,7 +828,7 @@ final class Ack: PrefixedLoggable, TimerUser {

func flush(for packetNumberSpace: PacketNumberSpace) {
withAckSpace(packetNumberSpace: packetNumberSpace) { ackSpace in
log.debug("flushing all PN for \(packetNumberSpace)")
log.debug("Flushing all PN for \(packetNumberSpace)")
ackSpace.blocks = []
ackSpace.needsTransmission = false
return true
Expand Down Expand Up @@ -978,13 +978,13 @@ struct AckBitstring: ~Copyable {
let initialWord = initialWord
if _slowPath(startWord < initialWord) {
Logger.proto.fault(
"initial word \(initialWord) is lower than start \(startWord) (pn \(start))"
"Initial word \(initialWord) is lower than start \(startWord) (pn \(start))"
)
return false
}
if _slowPath(stopWord < initialWord) {
Logger.proto.fault(
"initial word \(initialWord) is lower than stop \(stopWord) (pn \(stop))"
"Initial word \(initialWord) is lower than stop \(stopWord) (pn \(stop))"
)
return false
}
Expand All @@ -1004,13 +1004,13 @@ struct AckBitstring: ~Copyable {
let initialWord = initialWord
if _slowPath(startWord > initialWord + bitstringCount) {
Logger.proto.fault(
"size \(bitstringCount + initialWord) is lower than start \(startWord) (pn \(start))"
"Size \(bitstringCount + initialWord) is lower than start \(startWord) (pn \(start))"
)
return false
}
if _slowPath(stopWord > initialWord + bitstringCount) {
Logger.proto.fault(
"size \(bitstringCount + initialWord) is lower than start \(stopWord) (pn \(stop))"
"Size \(bitstringCount + initialWord) is lower than start \(stopWord) (pn \(stop))"
)
return false
}
Expand All @@ -1028,7 +1028,7 @@ struct AckBitstring: ~Copyable {

if stopWord >= size {
guard _slowPath(stopWord < UInt32.max / 2) else {
Logger.proto.info("refusing to grow bitstring further")
Logger.proto.info("Refusing to grow bitstring further")
return
}
let targetSize = Int(stopWord) + 1
Expand Down Expand Up @@ -1074,7 +1074,7 @@ struct AckBitstring: ~Copyable {
guard initialWord == other.initialWord else {
let initialWord = self.initialWord
let otherInitialWord = other.initialWord
Logger.proto.fault("bitstring initial mismatch \(initialWord) != \(otherInitialWord)")
Logger.proto.fault("Bitstring initial mismatch \(initialWord) != \(otherInitialWord)")
return AckBitstringSequence.empty
}
if size > other.size {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/QUIC/CongestionControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ extension CongestionControlProtocol {
) {
congestionEvent(sentTime: largestAckSentTime, mss: mss, qlog: qlog)
log.debug(
"link was flow controlled, reduced congestion window is \(congestionWindow) bytes"
"Link was flow controlled, reduced congestion window is \(congestionWindow) bytes"
)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/QUIC/Crypto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ extension QUICCrypto: TopStreamProtocol, ProtocolInstanceContainer {

func handleConnectedEvent() {
guard let parentConnection else { return }
parentConnection.log.info("connected: TLS finished")
parentConnection.log.info("Connected: TLS finished")
parentConnection.fromExternal {
parentConnection.reportReady()
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/QUIC/Cubic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ struct Cubic: CongestionControlProtocol, CubicLikeProtocol {
) {
if _slowPath(ceCount < ecnCECounter) {
log.fault(
"new CE count \(ceCount) can't be less than current CE count \(ecnCECounter)"
"New CE count \(ceCount) can't be less than current CE count \(ecnCECounter)"
)
}
// Update packets acked and marked on every ACK, even if it
Expand Down
6 changes: 3 additions & 3 deletions Sources/SwiftNetwork/QUIC/ECN.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct ECN: ~Copyable, PrefixedLoggable {
}
path.ecnState?.resetValidationCounters()
log.info(
"enable ECN echo: \(path.ecnState?.echoEnabled ?? false), enable ECN: \(path.ecnState?.ecnMarkingEnabled ?? false) use ECT(1): \(path.ecnState?.useECT1 ?? false)"
"Enable ECN echo: \(path.ecnState?.echoEnabled ?? false), enable ECN: \(path.ecnState?.ecnMarkingEnabled ?? false) use ECT(1): \(path.ecnState?.useECT1 ?? false)"
)
}
for i in 0..<counters.count {
Expand Down Expand Up @@ -352,7 +352,7 @@ struct ECNPathState: ~Copyable, PrefixedLoggable {
}
guard let ackFrameECNCounter = ackFrame.ecnCounter else {
log.info(
"receiving ACK frame without ECN counts is ok only if newly ACKed packets were not originally sent with ECT"
"Receiving ACK frame without ECN counts is ok only if newly ACKed packets were not originally sent with ECT"
)
return counters.largestCECount
}
Expand Down Expand Up @@ -403,7 +403,7 @@ struct ECNPathState: ~Copyable, PrefixedLoggable {
return counters.largestCECount
} else if ackFrameECNCounter.ce < feedback.ce {
log.error(
"received CE count \(ackFrameECNCounter.ce) < current CE count \(feedback.ce)"
"Received CE count \(ackFrameECNCounter.ce) < current CE count \(feedback.ce)"
)
return counters.largestCECount
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftNetwork/QUIC/Ledbat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct Ledbat: CongestionControlProtocol, CubicLikeProtocol {
let baseRTT = rtt.baseRTT
let currentRTT = rtt.adjustedRTT
guard currentRTT >= baseRTT else {
log.fault("param check returned false")
log.fault("currentRTT lower than baseRTT")
return
}
let qDelay = currentRTT - baseRTT
Expand Down Expand Up @@ -238,7 +238,7 @@ struct Ledbat: CongestionControlProtocol, CubicLikeProtocol {
) {
if _slowPath(ceCount < ecnCECounter) {
log.fault(
"new CE count \(ceCount) can't be less than current CE count \(ecnCECounter)"
"New CE count \(ceCount) can't be less than current CE count \(ecnCECounter)"
)
}
// Update packets acked and marked on every ACK, even if it
Expand Down
20 changes: 10 additions & 10 deletions Sources/SwiftNetwork/QUIC/PMTUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,24 +232,24 @@ struct PMTUDState: ~Copyable {
if !enabled {
return
}
path.log.info("received ICMP packet too big MTU: \(nextMTU)")
path.log.info("Received ICMP packet too big MTU: \(nextMTU)")
if nextMTU < PMTUDState.minimumMTU {
path.log.info("ignore packet too big MTU < minimum MTU: \(PMTUDState.minimumMTU)")
path.log.info("Ignore packet too big MTU < minimum MTU: \(PMTUDState.minimumMTU)")
} else if nextMTU == currentPathMTU {
path.log.info(
"finished searching: packet too big MTU == current MTU: \(currentPathMTU)"
"Finished searching: packet too big MTU == current MTU: \(currentPathMTU)"
)
searchComplete(on: path)
} else if nextMTU > probedMTU {
path.log.info("ignore packet too big MTU > probed size: \(probedMTU)")
path.log.info("Ignore packet too big MTU > probed size: \(probedMTU)")
} else if PMTUDState.minimumMTU <= nextMTU && nextMTU < currentPathMTU {
path.log.info("packet too big MTU < current path MTU \(currentPathMTU)")
path.log.info("Packet too big MTU < current path MTU \(currentPathMTU)")
packetTooBigMTU = (packetTooBigMTU == 0) ? nextMTU : min(packetTooBigMTU, nextMTU)
path.parentProtocol.recordSentPackets {
enterBlackholeDetection(on: path)
}
} else if currentPathMTU < nextMTU && nextMTU < probedMTU {
path.log.info("current path MTU < packet too big MTU size < probed MTU")
path.log.info("Current path MTU < packet too big MTU size < probed MTU")
packetTooBigMTU = (packetTooBigMTU == 0) ? nextMTU : min(packetTooBigMTU, nextMTU)
}
}
Expand Down Expand Up @@ -306,9 +306,9 @@ struct PMTUDState: ~Copyable {
}

failedProbeCount += 1
path.log.info("lost probe for MTU \(lostMTU), probe count \(failedProbeCount)")
path.log.info("Lost probe for MTU \(lostMTU), probe count \(failedProbeCount)")
if failedProbeCount == PMTUDState.maxProbeCount {
path.log.info("finish searching: reached maxProbeCount")
path.log.info("Finished searching: reached maxProbeCount")
searchComplete(on: path)
} else {
updateProbeSize(on: path)
Expand Down Expand Up @@ -382,7 +382,7 @@ struct PMTUDState: ~Copyable {

private mutating func enterBlackholeDetection(on path: QUICPath) -> NetworkUniqueDeque<SentPacketRecord> {
guard enabled else { return .init() }
path.log.info("entering blackhole detection, setting path MTU to \(PMTUDState.minimumMTU)")
path.log.info("Entering blackhole detection, setting path MTU to \(PMTUDState.minimumMTU)")
currentPathMTU = PMTUDState.minimumMTU
searchCompleted = false
failedProbeCount = 0
Expand Down Expand Up @@ -467,7 +467,7 @@ struct PMTUDState: ~Copyable {

private mutating func updateProbeSize(on path: QUICPath) {
if searchCompleted {
Logger.proto.fault("attempt to update probe size while search is completed")
Logger.proto.fault("Attempt to update probe size while search is completed")
return
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/QUIC/Pacer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct Pacer: ~Copyable {
guard rate > 0 else {
let startupRate = startupRate
Logger.proto.fault(
"pacer rate shouldn't be 0, startup rate = \(startupRate), CCA is \(path.congestionControlName) (cwnd=\(path.congestionControlWindow), smoothed rtt=\(path.smoothedRTT.milliseconds) ms)"
"Pacer rate shouldn't be 0, startup rate = \(startupRate), CCA is \(path.congestionControlName) (cwnd=\(path.congestionControlWindow), smoothed rtt=\(path.smoothedRTT.milliseconds) ms)"
)
return Constants.maxBurstIntervalKernelPacing
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/SwiftNetwork/QUIC/PacketParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ struct PacketParser: ~Copyable, PrefixedLoggable {
do {
try connection.protector.openHeader(&packet, frame: &frame)
} catch {
connection.log.error("packet number undecryptable")
connection.log.error("Packet number undecryptable")
return false
}

Expand Down Expand Up @@ -593,21 +593,21 @@ struct PacketParser: ~Copyable, PrefixedLoggable {

func retryTokenPresent(_ frame: inout Frame, token: [UInt8]?) -> Bool {
guard let token else {
log.error("token is nil, discarding")
log.error("Token is nil, discarding")
return false
}
guard let firstOctet = try? self.parseFirstOctet(&frame, claim: false) else {
log.error("could not parse first octet from packet")
log.error("Could not parse first octet from packet")
return false
}
let longHeader = (firstOctet & 0x80) != 0
guard longHeader else {
log.error("received invalid packet")
log.error("Received invalid packet")
return false
}
let packetType = (firstOctet & 0x30) >> 4
guard packetType == 0x0 else {
log.error("received packet when expecting Initial with retry token")
log.error("Received packet when expecting Initial with retry token")
return false
}
var dcidLength: UInt8 = 0
Expand All @@ -625,7 +625,7 @@ struct PacketParser: ~Copyable, PrefixedLoggable {
try read.span(expect: token.span.bytes)
}
guard result.isValid else {
log.error("could not parse a valid token from the packet")
log.error("Could not parse a valid token from the packet")
return false
}
return true
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/QUIC/Prague.swift
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ struct Prague: CongestionControlProtocol, CubicLikeProtocol {
) {
if _slowPath(ceCount < ecnCECounter) {
log.fault(
"new CE count \(ceCount) can't be less than current CE count \(ecnCECounter)"
"New CE count \(ceCount) can't be less than current CE count \(ecnCECounter)"
)
}

Expand Down
12 changes: 6 additions & 6 deletions Sources/SwiftNetwork/QUIC/Protector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ struct SecFramerAESGCM: ~Copyable, SecFramerProtocol {
}
}
guard result == kCCSuccess else {
keys.log.error("unable to \(loggingOperation) header: \(result)")
keys.log.error("Unable to \(loggingOperation) header: \(result)")
throw QUICError.protector(.headerProtectionFailed)
}
#elseif canImport(CryptoExtras) || NETWORK_STANDALONE
Expand All @@ -365,7 +365,7 @@ struct SecFramerAESGCM: ~Copyable, SecFramerProtocol {
}
}.get()
} catch {
keys.log.error("unable to \(loggingOperation) header: \(error)")
keys.log.error("Unable to \(loggingOperation) header: \(error)")
throw QUICError.protector(.headerProtectionFailed)
}
#endif
Expand All @@ -388,7 +388,7 @@ struct SecFramerAESGCM: ~Copyable, SecFramerProtocol {
)
#endif
guard var buffer = frame.mutableSpan else {
keys.log.error("unclaimed bytes nil")
keys.log.error("Unclaimed bytes nil")
throw QUICError.protector(SecFramerError.openFailed)
}
do {
Expand Down Expand Up @@ -550,7 +550,7 @@ struct SecFramerChaChaPoly: ~Copyable, SecFramerProtocol {
)
#endif
guard var buffer = frame.mutableSpan else {
keys.log.error("buffer nil")
keys.log.error("Buffer nil")
throw QUICError.protector(SecFramerError.openFailed)
}
#if !NETWORK_EMBEDDED
Expand Down Expand Up @@ -767,7 +767,7 @@ struct Protector: ~Copyable, PrefixedLoggable {
}

mutating func swapFramers(keyState: PacketKeyState) {
log.debug("swapping framers since we're a server")
log.debug("Swapping framers since we're a server")
swap(&readFramer[keyState.rawValue], &writeFramer[keyState.rawValue])
}

Expand Down Expand Up @@ -1312,7 +1312,7 @@ struct Protector: ~Copyable, PrefixedLoggable {
tag: retryTag
)
} catch {
Logger.proto.error("failed to open retry packet")
Logger.proto.error("Failed to open retry packet")
throw QUICError.protector(SecFramerError.openFailed)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/QUIC/QLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ final class QLog {
return jsonData
} else {
let topLevelObject = topLevelObject
Logger.proto.error("error serializing JSON: \(topLevelObject)")
Logger.proto.error("Error serializing JSON: \(topLevelObject)")
return nil
}
}
Expand Down
Loading
Loading