Skip to content

Commit

Permalink
Merge pull request #116 from vapor/2.0
Browse files Browse the repository at this point in the history
2.0 + remove nonblocking
  • Loading branch information
tanner0101 committed Mar 7, 2017
2 parents 8c3cfaa + d46e0ac commit 2b9312e
Show file tree
Hide file tree
Showing 47 changed files with 148 additions and 1,216 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ Carthage/Build
fastlane/report.xml
fastlane/screenshots

Package.pins

74 changes: 0 additions & 74 deletions CODE_OF_CONDUCT.md

This file was deleted.

7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Honza Dvorsky
Copyright (c) 2016 Qutheory, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 1 addition & 23 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
import PackageDescription

let package = Package(
name: "Socks",
targets: [
Target(name: "SocksCore"),
Target(name: "Socks", dependencies: ["SocksCore"]),
//Target(name: "SocksCoreExampleTCPServer", dependencies: ["SocksCore"]),
//Target(name: "SocksCoreExampleTCPKeepAliveServer", dependencies: ["Socks"]),
//Target(name: "SocksCoreExampleTCPClient", dependencies: ["SocksCore"]),
//Target(name: "SocksExampleTCPServer", dependencies: ["Socks"]),
//Target(name: "SocksExampleTCPClient", dependencies: ["Socks"]),
//Target(name: "SocksExampleUDPClient", dependencies: ["Socks"]),
//Target(name: "SocksExampleUDPServer", dependencies: ["Socks"]),
],
exclude: [
"Sources/SocksCoreExampleTCPServer",
"Sources/SocksCoreExampleTCPKeepAliveServer",
"Sources/SocksCoreExampleTCPClient",
"Sources/SocksExampleTCPServer",
"Sources/SocksExampleTCPClient",
"Sources/SocksExampleUDPClient",
"Sources/SocksExampleUDPServer",
]
)
let package = Package(name: "Socks")
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
//
// TCPClient.swift
// Socks
//
// Created by Honza Dvorsky on 1/6/16.
//
//

import SocksCore

/// Represents an established TCP connection.
public class TCPClient {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
//
// UDPClient.swift
// Socks
//
// Created by Honza Dvorsky on 6/1/16.
//
//

import SocksCore

public class UDPClient {

public let socket: UDPInternetSocket
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// Address.swift
// Socks
//
// Created by Matthias Kreileder on 3/20/16.
//
//

#if os(Linux)
import Glibc
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// Bytes.swift
// Socks
//
// Created by Honza Dvorsky on 3/20/16.
//
//

#if os(Linux)
import Glibc
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// Conversions.swift
// Socks
//
// Created by Honza Dvorsky on 3/20/16.
//
//

//convert little-endian to big-endian for network transfer
//aka Host TO Network Short
func htons(_ value: CUnsignedShort) -> CUnsignedShort {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// SocksError.swift
// Socks
//
// Created by Honza Dvorsky on 3/20/16.
//
//

#if os(Linux)
import Glibc
#else
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// InternetSocket.swift
// Socks
//
// Created by Honza Dvorsky on 3/20/16.
//
//

#if os(Linux)
import Glibc
private let socket_bind = Glibc.bind
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ extension timeval {
}
}

extension timeval: Equatable { }
public func ==(lhs: timeval, rhs: timeval) -> Bool {
return lhs.tv_sec == rhs.tv_sec && lhs.tv_usec == rhs.tv_usec
}

private func filter(_ sockets: [Descriptor]?, _ set: inout fd_set) -> [Descriptor] {
return sockets?.filter {
fdIsSet($0, &set)
Expand Down
13 changes: 0 additions & 13 deletions Sources/SocksCore/Socket.swift → Sources/Socks/Core/Socket.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// Socket.swift
// Socks
//
// Created by Honza Dvorsky on 3/20/16.
//
//

#if os(Linux)
import Glibc
private let s_socket = Glibc.socket
Expand All @@ -32,11 +24,6 @@ extension RawSocket {
throw SocksError(.closeSocketFailed)
}
}

@available(*, deprecated: 1.2.6, renamed: "isClosed", message: "use isClosed instead")
public var closed: Bool {
return isClosed
}
}

extension Socket {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// SocketOptions.swift
// Socks
//
// Created by Honza Dvorsky on 6/7/16.
//
//

#if os(Linux)
import Glibc
private let s_socket = Glibc.socket
Expand Down Expand Up @@ -130,9 +122,3 @@ extension RawSocket {
return val.pointee
}
}

extension timeval: Equatable { }
public func ==(lhs: timeval, rhs: timeval) -> Bool {
return lhs.tv_sec == rhs.tv_sec && lhs.tv_usec == rhs.tv_usec
}

0 comments on commit 2b9312e

Please sign in to comment.