Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
Fix error when parsing ip address
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuhaow committed Dec 11, 2016
1 parent dca33b4 commit cae80cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
I will do my best to guarantee that this project adheres to [Semantic Versioning](http://semver.org/) after 1.0.0, but please do read change log before updating.

## 0.10.4

### Fixed
- Fix an error when parsing literal IP address.

## 0.10.3

### Fixed
Expand Down
8 changes: 6 additions & 2 deletions src/Socket/ProxySocket/SOCKS5ProxySocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public class SOCKS5ProxySocket: ProxySocket {
}
}

destinationHost = String(data: address, encoding: .utf8)
address.withUnsafeBytes {
destinationHost = String(cString: $0, encoding: .utf8)
}

readStatus = .readingPort
socket.readDataTo(length: 2)
Expand All @@ -172,7 +174,9 @@ public class SOCKS5ProxySocket: ProxySocket {
}
}

destinationHost = String(data: address, encoding: .utf8)
address.withUnsafeBytes {
destinationHost = String(cString: $0, encoding: .utf8)
}

readStatus = .readingPort
socket.readDataTo(length: 2)
Expand Down

0 comments on commit cae80cc

Please sign in to comment.