Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
helje5 committed Dec 20, 2024
2 parents 447330b + 60cb596 commit 7b51ca6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*]
indent_style = space
indent_size = 2
tab_width = 8
max_line_length = 80
trim_trailing_whitespace = false
end_of_line = lf
insert_final_newline = true
14 changes: 5 additions & 9 deletions Sources/http/Server/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -546,21 +546,17 @@ open class Server: ErrorEmitter, CustomStringConvertible {
server.emitError(error, transaction: ( request, response ))
self.transaction = nil
}
else {
else { // We are not in a transaction. ECONNRESET is not an error.
assert(transaction == nil)
var doError = true

if let error = error as? IOError, error.errnoCode == ECONNRESET {
doError = false
}

if doError {
server.log.error("HTTP error, closing connection: \(error)")
server.log.trace("HTTP ECONNRESET, closing connection: \(error)")
// Do not emit ECONNRESET
}
else {
server.log.trace("HTTP error, closing connection: \(error)")
server.log.error("HTTP error, closing connection: \(error)")
server.emitError(error, transaction: nil)
}
server.emitError(error, transaction: nil)
}
context.close(promise: nil)
}
Expand Down

0 comments on commit 7b51ca6

Please sign in to comment.