Prechádzať zdrojové kódy

Use send with MSG_NOSIGNAL rather than write

Ted Goddard 8 rokov pred
rodič
commit
cc85f0b11a
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      Sources/Socket+File.swift

+ 1 - 1
Sources/Socket+File.swift

@@ -19,7 +19,7 @@ import Foundation
             }
             var writeCounter = 0
             while writeCounter < readResult {
-                let writeResult = write(target, &buffer + writeCounter, readResult - writeCounter)
+                let writeResult = send(target, &buffer + writeCounter, readResult - writeCounter, Int32(MSG_NOSIGNAL))
                 guard writeResult > 0 else {
                     return Int32(writeResult)
                 }