Browse Source

More conditionals.

Jon Shier 2 years ago
parent
commit
d220759f75
2 changed files with 11 additions and 1 deletions
  1. 10 0
      Source/Request.swift
  2. 1 1
      Tests/TestHelpers.swift

+ 10 - 0
Source/Request.swift

@@ -1785,6 +1785,16 @@ public final class WebSocketRequest: Request {
         }
     }
 
+//    override func didCancel() {
+//        dispatchPrecondition(condition: .onQueue(underlyingQueue))
+//
+//        mutableState.write { mutableState in
+//            mutableState.error = mutableState.error ?? AFError.explicitlyCancelled
+//        }
+//
+//        eventMonitor?.requestDidCancel(self)
+//    }
+
     // TODO: Distinguish between cancellation and close behavior?
     // TODO: Reexamine cancellation behavior.
     @discardableResult

+ 1 - 1
Tests/TestHelpers.swift

@@ -379,7 +379,7 @@ extension Session {
                       interceptor: interceptor)
     }
 
-    #if !(os(Linux) || os(Windows))
+    #if canImport(Darwin) && !canImport(FoundationNetworking)
     @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
     func websocketRequest(_ endpoint: Endpoint,
                           protocol: String? = nil,