Преглед изворни кода

Fixed all compile errors for Linux SPM build ( a fix for OSAtomicCompareAndSwapInt still needed ).

Damian Kołakowski пре 9 година
родитељ
комит
d18f018797

+ 2 - 5
Sources/DemoServer.swift

@@ -5,11 +5,8 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
+
 
 public func demoServer(_ publicDir: String) -> HttpServer {
     

+ 1 - 5
Sources/Errno.swift

@@ -5,11 +5,7 @@
 //  Copyright © 2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 public class Errno {
     

+ 1 - 6
Sources/Files.swift

@@ -5,12 +5,7 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
-
+import Foundation
 
 public func shareFilesFromDirectory(_ directoryPath: String, defaults: [String] = ["index.html", "default.html"]) -> ((HttpRequest) -> HttpResponse) {
     return { r in

+ 1 - 5
Sources/HttpParser.swift

@@ -5,11 +5,7 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 enum HttpParserError: Error {
     case InvalidStatusLine(String)

+ 1 - 5
Sources/HttpResponse.swift

@@ -5,11 +5,7 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 public enum SerializationError: Error {
     case invalidObject

+ 1 - 5
Sources/HttpRouter.swift

@@ -5,11 +5,7 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 open class HttpRouter {
     

+ 1 - 5
Sources/HttpServer.swift

@@ -5,11 +5,7 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 public class HttpServer: HttpServerIO {
     

+ 18 - 40
Sources/HttpServerIO.swift

@@ -5,26 +5,39 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
+import Dispatch
 
 public class HttpServerIO {
     
     private var socket = Socket(socketFileDescriptor: -1)
     private var sockets = Set<Socket>()
+
+    public enum HttpServerIOState: Int32 {
+        case starting
+        case running
+        case stopping
+        case stopped
+    }
+    
     private var stateValue: Int32 = HttpServerIOState.stopped.rawValue
+    
     public private(set) var state: HttpServerIOState {
         get {
             return HttpServerIOState(rawValue: stateValue)!
         }
         set(state) {
+            #if !os(Linux)
             OSAtomicCompareAndSwapInt(self.state.rawValue, state.rawValue, &stateValue)
+            #else
+            //TODO - hehe :)
+            self.stateValue = state.rawValue
+            #endif
         }
     }
+    
     public var operating: Bool { get { return self.state == .running } }
+    
     private let queue = DispatchQueue(label: "swifter.httpserverio.clientsockets")
     
     public func port() throws -> Int {
@@ -164,38 +177,3 @@ public class HttpServerIO {
         return keepAlive && content.length != -1;
     }
 }
-
-public enum HttpServerIOState: Int32 {
-    case starting
-    case running
-    case stopping
-    case stopped
-}
-
-#if os(Linux)
-    
-let DISPATCH_QUEUE_PRIORITY_BACKGROUND = 0
-
-private class dispatch_context {
-    let block: ((Void) -> Void)
-    init(_ block: ((Void) -> Void)) {
-        self.block = block
-    }
-}
-
-func dispatch_get_global_queue(queueId: Int, _ arg: Int) -> Int { return 0 }
-
-func dispatch_async(queueId: Int, _ block: ((Void) -> Void)) {
-    let unmanagedDispatchContext = Unmanaged.passRetained(dispatch_context(block))
-    let context = UnsafeMutablePointer<Void>(unmanagedDispatchContext.toOpaque())
-    var pthread: pthread_t = 0
-    pthread_create(&pthread, nil, { (context: UnsafeMutablePointer<Void>) -> UnsafeMutablePointer<Void> in
-        let unmanaged = Unmanaged<dispatch_context>.fromOpaque(COpaquePointer(context))
-        unmanaged.takeUnretainedValue().block()
-        unmanaged.release()
-        return context
-    }, context)
-}
-    
-#endif
-

+ 1 - 5
Sources/Process.swift

@@ -5,11 +5,7 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 public class Process {
     

+ 1 - 5
Sources/Scopes.swift

@@ -5,11 +5,7 @@
 //  Copyright © 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 public func scopes(_ scope: @escaping Closure) -> ((HttpRequest) -> HttpResponse) {
     return { r in

+ 3 - 7
Sources/Socket+File.swift

@@ -5,13 +5,10 @@
 //  Created by Damian Kolakowski on 13/07/16.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
-#if os(iOS) || os (Linux)
+#if os(iOS) || os(Linux)
+    
     struct sf_hdtr { }
     
     private func sendfileImpl(_ source: Int32, _ target: Int32, _: off_t, _: UnsafeMutablePointer<off_t>, _: UnsafeMutablePointer<sf_hdtr>, _: Int32) -> Int32 {
@@ -33,7 +30,6 @@
     }
 #else
     private let sendfileImpl = sendfile
-
 #endif
 
 extension Socket {

+ 40 - 50
Sources/Socket+Server.swift

@@ -5,11 +5,7 @@
 //  Created by Damian Kolakowski on 13/07/16.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 extension Socket {
     
@@ -33,53 +29,47 @@ extension Socket {
         }
         Socket.setNoSigPipe(socketFileDescriptor)
         
-        #if os(Linux)
-            var bindResult: Int32 = -1
-            if forceIPv4 {
-                var addr = sockaddr_in(sin_family: sa_family_t(AF_INET),
-                                       sin_port: port.bigEndian,
-                                       sin_addr: in_addr(s_addr: in_addr_t(0)),
-                                       sin_zero:(0, 0, 0, 0, 0, 0, 0, 0))
-                
-                bindResult = withUnsafePointer(&addr) {
-                    bind(socketFileDescriptor, UnsafePointer<sockaddr>($0), socklen_t(sizeof(sockaddr_in)))
-                }
-            } else {
-                var addr = sockaddr_in6(sin6_family: sa_family_t(AF_INET6),
-                                        sin6_port: port.bigEndian,
-                                        sin6_flowinfo: 0,
-                                        sin6_addr: in6addr_any,
-                                        sin6_scope_id: 0)
-                
-                bindResult = withUnsafePointer(&addr) {
-                    bind(socketFileDescriptor, UnsafePointer<sockaddr>($0), socklen_t(sizeof(sockaddr_in6)))
-                }
+
+        var bindResult: Int32 = -1
+        if forceIPv4 {
+            #if os(Linux)
+            var addr = sockaddr_in(
+                sin_family: sa_family_t(AF_INET),
+                sin_port: port.bigEndian,
+                sin_addr: in_addr(s_addr: in_addr_t(0)),
+                sin_zero:(0, 0, 0, 0, 0, 0, 0, 0))
+            #else
+            var addr = sockaddr_in(
+                sin_len: UInt8(MemoryLayout<sockaddr_in>.stride),
+                sin_family: UInt8(AF_INET),
+                sin_port: port.bigEndian,
+                sin_addr: in_addr(s_addr: in_addr_t(0)),
+                sin_zero:(0, 0, 0, 0, 0, 0, 0, 0))
+            #endif
+            bindResult = withUnsafePointer(to: &addr) {
+                bind(socketFileDescriptor, UnsafePointer<sockaddr>(OpaquePointer($0)), socklen_t(MemoryLayout<sockaddr_in>.size))
             }
-        #else
-            var bindResult: Int32 = -1
-            if forceIPv4 {
-                var addr = sockaddr_in(sin_len: UInt8(MemoryLayout<sockaddr_in>.stride),
-                                       sin_family: UInt8(AF_INET),
-                                       sin_port: port.bigEndian,
-                                       sin_addr: in_addr(s_addr: in_addr_t(0)),
-                                       sin_zero:(0, 0, 0, 0, 0, 0, 0, 0))
-                
-                bindResult = withUnsafePointer(to: &addr) {
-                    bind(socketFileDescriptor, UnsafePointer<sockaddr>(OpaquePointer($0)), socklen_t(MemoryLayout<sockaddr_in>.size))
-                }
-            } else {
-                var addr = sockaddr_in6(sin6_len: UInt8(MemoryLayout<sockaddr_in6>.stride),
-                                        sin6_family: UInt8(AF_INET6),
-                                        sin6_port: port.bigEndian,
-                                        sin6_flowinfo: 0,
-                                        sin6_addr: in6addr_any,
-                                        sin6_scope_id: 0)
-                
-                bindResult = withUnsafePointer(to: &addr) {
-                    bind(socketFileDescriptor, UnsafePointer<sockaddr>(OpaquePointer($0)), socklen_t(MemoryLayout<sockaddr_in6>.size))
-                }
+        } else {
+            #if os(Linux)
+            var addr = sockaddr_in6(
+                sin6_family: sa_family_t(AF_INET6),
+                sin6_port: port.bigEndian,
+                sin6_flowinfo: 0,
+                sin6_addr: in6addr_any,
+                sin6_scope_id: 0)
+            #else
+            var addr = sockaddr_in6(
+                sin6_len: UInt8(MemoryLayout<sockaddr_in6>.stride),
+                sin6_family: UInt8(AF_INET6),
+                sin6_port: port.bigEndian,
+                sin6_flowinfo: 0,
+                sin6_addr: in6addr_any,
+                sin6_scope_id: 0)
+            #endif
+            bindResult = withUnsafePointer(to: &addr) {
+                bind(socketFileDescriptor, UnsafePointer<sockaddr>(OpaquePointer($0)), socklen_t(MemoryLayout<sockaddr_in6>.size))
             }
-        #endif
+        }
         
         if bindResult == -1 {
             let details = Errno.description()

+ 4 - 9
Sources/Socket.swift

@@ -5,13 +5,8 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
-/* Low level routines for POSIX sockets */
 
 public enum SocketError: Error {
     case socketCreationFailed(String)
@@ -171,7 +166,7 @@ open class Socket: Hashable, Equatable {
     
     public class func shutdwn(_ socket: Int32) {
         #if os(Linux)
-            shutdown(socket, Int32(SHUT_RDWR))
+            let _ = Glibc.shutdown(socket, Int32(SHUT_RDWR))
         #else
             let _ = Darwin.shutdown(socket, SHUT_RDWR)
         #endif
@@ -179,8 +174,8 @@ open class Socket: Hashable, Equatable {
     
     public class func release(_ socket: Int32) {
         #if os(Linux)
-            shutdown(socket, Int32(SHUT_RDWR))
-            close(socket)
+            let _ = Glibc.shutdown(socket, Int32(SHUT_RDWR))
+            let _ = Glibc.close(socket)
         #else
             if Darwin.shutdown(socket, SHUT_RDWR) != -1 {
                 // If you close socket which was already closed it produces exception visible in TestFlight's crash log.

+ 1 - 5
Sources/String+BASE64.swift

@@ -5,11 +5,7 @@
 //  Copyright © 2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 
 extension String {

+ 3 - 2
Sources/String+File.swift

@@ -7,6 +7,7 @@
 
 import Foundation
 
+
 extension String {
     
     public enum FileError: Error {
@@ -15,7 +16,7 @@ extension String {
     
     public class File {
         
-        internal let pointer: UnsafeMutablePointer<FILE>
+        let pointer: UnsafeMutablePointer<FILE>
         
         public init(_ pointer: UnsafeMutablePointer<FILE>) {
             self.pointer = pointer
@@ -110,7 +111,7 @@ extension String {
             var name = ent.pointee.d_name
             let fileName = withUnsafePointer(to: &name) { (ptr) -> String? in
                 #if os(Linux)
-                    return String.fromCString([CChar](UnsafeBufferPointer<CChar>(start: UnsafePointer(unsafeBitCast(ptr, UnsafePointer<CChar>.self)), count: 256)))
+                    return String(validatingUTF8: [CChar](UnsafeBufferPointer<CChar>(start: UnsafePointer(unsafeBitCast(ptr, to: UnsafePointer<CChar>.self)), count: 256)))
                 #else
                     var buffer = [CChar](UnsafeBufferPointer(start: unsafeBitCast(ptr, to: UnsafePointer<CChar>.self), count: Int(ent.pointee.d_namlen)))
                     buffer.append(0)

+ 2 - 5
Sources/String+Misc.swift

@@ -5,11 +5,8 @@
 //  Copyright (c) 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
+
 
 extension String {
 

+ 1 - 5
Sources/String+SHA1.swift

@@ -5,11 +5,7 @@
 //  Copyright 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
 
 
 public struct SHA1 {

+ 2 - 5
Sources/WebSockets.swift

@@ -5,11 +5,8 @@
 //  Copyright © 2014-2016 Damian Kołakowski. All rights reserved.
 //
 
-#if os(Linux)
-    import Glibc
-#else
-    import Foundation
-#endif
+import Foundation
+
 
 public func websocket(
       _ text: ((WebSocketSession, String) -> Void)?,

+ 11 - 8
XCode/Swifter.xcodeproj/project.pbxproj

@@ -78,6 +78,9 @@
 		7C76B72C1D2C45950030FC98 /* WebSockets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B6F91D2C44F30030FC98 /* WebSockets.swift */; };
 		7CA4813E19A2EA8D0030B30D /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CA4813D19A2EA8D0030B30D /* main.swift */; };
 		7CB102E01A17381D00CBA3B4 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 7CB102DF1A17381D00CBA3B4 /* logo.png */; };
+		7CCB8C5E1D97B852008B9712 /* String+File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C377E161D964B6A009C6148 /* String+File.swift */; };
+		7CCB8C601D97B8CC008B9712 /* SwifterTestsHttpRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CCB8C5F1D97B8CC008B9712 /* SwifterTestsHttpRouter.swift */; };
+		7CCB8C621D97B8E9008B9712 /* SwifterTestsHttpRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CCB8C5F1D97B8CC008B9712 /* SwifterTestsHttpRouter.swift */; };
 		7CCD87611C66099B0068099B /* Swifter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AE893E71C05127900A29F63 /* Swifter.framework */; };
 		7CCD87701C660B250068099B /* SwifterTestsHttpParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CCD876D1C660B250068099B /* SwifterTestsHttpParser.swift */; };
 		7CCD87721C660B250068099B /* SwifterTestsStringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CCD876E1C660B250068099B /* SwifterTestsStringExtensions.swift */; };
@@ -103,8 +106,6 @@
 		7CEBB87D1D94612D00370A6B /* String+SHA1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B6F81D2C44F30030FC98 /* String+SHA1.swift */; };
 		7CEBB87E1D94612D00370A6B /* WebSockets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B6F91D2C44F30030FC98 /* WebSockets.swift */; };
 		7CEBB87F1D94612D00370A6B /* Errno.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C76B2A11D369C9D00D35BFB /* Errno.swift */; };
-		7CEBB8811D94675A00370A6B /* SwifterTestsHttpRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CEBB8801D94675A00370A6B /* SwifterTestsHttpRouter.swift */; };
-		7CEBB8821D94675A00370A6B /* SwifterTestsHttpRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CEBB8801D94675A00370A6B /* SwifterTestsHttpRouter.swift */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -181,6 +182,7 @@
 		7CA4813B19A2EA8D0030B30D /* SwifterSampleOSX */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SwifterSampleOSX; sourceTree = BUILT_PRODUCTS_DIR; };
 		7CA4813D19A2EA8D0030B30D /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
 		7CB102DF1A17381D00CBA3B4 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
+		7CCB8C5F1D97B8CC008B9712 /* SwifterTestsHttpRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwifterTestsHttpRouter.swift; sourceTree = "<group>"; };
 		7CCD875C1C66099B0068099B /* SwifteriOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwifteriOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
 		7CCD87601C66099B0068099B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		7CCD876D1C660B250068099B /* SwifterTestsHttpParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwifterTestsHttpParser.swift; sourceTree = "<group>"; };
@@ -192,7 +194,6 @@
 		7CDAB80F1BE2A1D400C8A977 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
 		7CDAB8101BE2A1D400C8A977 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		7CDAB8111BE2A1D400C8A977 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
-		7CEBB8801D94675A00370A6B /* SwifterTestsHttpRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwifterTestsHttpRouter.swift; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -309,7 +310,6 @@
 				7C76B6E91D2C44F30030FC98 /* Sources */,
 				7CA4815619A2EF2B0030B30D /* Resources */,
 				7CCD876C1C660B250068099B /* SwifterTestsCommon */,
-				7CCD875D1C66099B0068099B /* SwifteriOSTests */,
 				7CCD877A1C660EA30068099B /* SwifterOSXTests */,
 				7C839B6F19422CFF003A6950 /* Products */,
 				7AE893FC1C0512C400A29F63 /* SwifterMac */,
@@ -355,18 +355,20 @@
 			children = (
 				7CCD87601C66099B0068099B /* Info.plist */,
 			);
-			path = SwifteriOSTests;
+			name = SwifteriOSTests;
+			path = ../SwifteriOSTests;
 			sourceTree = "<group>";
 		};
 		7CCD876C1C660B250068099B /* SwifterTestsCommon */ = {
 			isa = PBXGroup;
 			children = (
+				7CCB8C5F1D97B8CC008B9712 /* SwifterTestsHttpRouter.swift */,
 				7CCD876D1C660B250068099B /* SwifterTestsHttpParser.swift */,
 				0858E7F61D68BC2600491CD1 /* PingServer.swift */,
 				7CCD876E1C660B250068099B /* SwifterTestsStringExtensions.swift */,
 				7C4785E81C71D15600A9FE73 /* SwifterTestsWebSocketSession.swift */,
 				0858E7F31D68BB2600491CD1 /* IOSafetyTests.swift */,
-				7CEBB8801D94675A00370A6B /* SwifterTestsHttpRouter.swift */,
+				7CCD875D1C66099B0068099B /* SwifteriOSTests */,
 			);
 			path = SwifterTestsCommon;
 			sourceTree = "<group>";
@@ -736,6 +738,7 @@
 				7C73C6921C26179C00AEF6CA /* AppDelegate.swift in Sources */,
 				7CDAB8161BE2A1D400C8A977 /* ViewController.swift in Sources */,
 				0858E7F71D68BC2600491CD1 /* PingServer.swift in Sources */,
+				7CCB8C601D97B8CC008B9712 /* SwifterTestsHttpRouter.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -752,7 +755,6 @@
 			buildActionMask = 2147483647;
 			files = (
 				7CCD87701C660B250068099B /* SwifterTestsHttpParser.swift in Sources */,
-				7CEBB8811D94675A00370A6B /* SwifterTestsHttpRouter.swift in Sources */,
 				0858E7F81D68BC2600491CD1 /* PingServer.swift in Sources */,
 				0858E7F41D68BB2600491CD1 /* IOSafetyTests.swift in Sources */,
 				7C4785E91C71D15600A9FE73 /* SwifterTestsWebSocketSession.swift in Sources */,
@@ -764,13 +766,14 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				7CCB8C621D97B8E9008B9712 /* SwifterTestsHttpRouter.swift in Sources */,
+				7CCB8C5E1D97B852008B9712 /* String+File.swift in Sources */,
 				7CEBB86F1D94612D00370A6B /* Files.swift in Sources */,
 				7CEBB8701D94612D00370A6B /* HttpParser.swift in Sources */,
 				7CEBB8711D94612D00370A6B /* HttpRequest.swift in Sources */,
 				7CEBB8721D94612D00370A6B /* HttpResponse.swift in Sources */,
 				7CEBB8731D94612D00370A6B /* HttpRouter.swift in Sources */,
 				7CEBB8741D94612D00370A6B /* HttpServer.swift in Sources */,
-				7CEBB8821D94675A00370A6B /* SwifterTestsHttpRouter.swift in Sources */,
 				7CEBB8751D94612D00370A6B /* HttpServerIO.swift in Sources */,
 				7CEBB8761D94612D00370A6B /* Process.swift in Sources */,
 				7CEBB8771D94612D00370A6B /* Scopes.swift in Sources */,

+ 0 - 1
XCode/SwifterTestsCommon/IOSafetyTests.swift

@@ -7,7 +7,6 @@
 //
 
 import XCTest
-import Swifter
 
 class IOSafetyTests: XCTestCase {
     var server: HttpServer!

+ 0 - 1
XCode/SwifterTestsCommon/PingServer.swift

@@ -7,7 +7,6 @@
 //
 
 import Foundation
-import Swifter
 
 // Server
 extension HttpServer {

+ 0 - 1
XCode/SwifterTestsCommon/SwifterTestsHttpParser.swift

@@ -6,7 +6,6 @@
 //
 
 import XCTest
-import Swifter
 
 class SwifterTestsHttpParser: XCTestCase {
     

+ 0 - 1
XCode/SwifterTestsCommon/SwifterTestsHttpRouter.swift

@@ -7,7 +7,6 @@
 //
 
 import XCTest
-import Swifter
 
 class SwifterTestsHttpRouter: XCTestCase {
     

+ 3 - 4
XCode/SwifterTestsCommon/SwifterTestsWebSocketSession.swift

@@ -6,7 +6,6 @@
 //
 
 import XCTest
-import Swifter
 
 class SwifterTestsWebSocketSession: XCTestCase {
     
@@ -82,7 +81,7 @@ class SwifterTestsWebSocketSession: XCTestCase {
         }
         
         do {
-            let session = WebSocketSession(TestSocket([0b0000_1000, 0b1000_0000, 0, 0, 0, 0]))
+            let session = WebSocketSession(TestSocket([0b1000_1000, 0b1000_0000, 0, 0, 0, 0]))
             let frame = try session.readFrame()
             XCTAssertEqual(frame.opcode, WebSocketSession.OpCode.close, "Parser should accept Close opcode.")
         } catch let e {
@@ -90,7 +89,7 @@ class SwifterTestsWebSocketSession: XCTestCase {
         }
         
         do {
-            let session = WebSocketSession(TestSocket([0b0000_1001, 0b1000_0000, 0, 0, 0, 0]))
+            let session = WebSocketSession(TestSocket([0b1000_1001, 0b1000_0000, 0, 0, 0, 0]))
             let frame = try session.readFrame()
             XCTAssertEqual(frame.opcode, WebSocketSession.OpCode.ping, "Parser should accept Ping opcode.")
         } catch let e {
@@ -98,7 +97,7 @@ class SwifterTestsWebSocketSession: XCTestCase {
         }
         
         do {
-            let session = WebSocketSession(TestSocket([0b0000_1010, 0b1000_0000, 0, 0, 0, 0]))
+            let session = WebSocketSession(TestSocket([0b1000_1010, 0b1000_0000, 0, 0, 0, 0]))
             let frame = try session.readFrame()
             XCTAssertEqual(frame.opcode, WebSocketSession.OpCode.pong, "Parser should accept Pong opcode.")
         } catch let e {