@@ -62,7 +62,7 @@ public final class NIOHTTP1ProxyConnectHandler: ChannelDuplexHandler, RemovableC
62
62
targetPort: Int ,
63
63
headers: HTTPHeaders ,
64
64
deadline: NIODeadline ,
65
- promise: EventLoopPromise < Void > ) {
65
+ promise: EventLoopPromise < Void > ? ) {
66
66
self . targetHost = targetHost
67
67
self . targetPort = targetPort
68
68
self . headers = headers
@@ -349,22 +349,7 @@ public final class NIOHTTP1ProxyConnectHandler: ChannelDuplexHandler, RemovableC
349
349
extension NIOHTTP1ProxyConnectHandler . Error : Hashable {
350
350
// compare only the kind of error, not the associated response head
351
351
public static func == ( lhs: Self , rhs: Self ) -> Bool {
352
- switch ( lhs. store. details, rhs. store. details) {
353
- case ( . proxyAuthenticationRequired, . proxyAuthenticationRequired) :
354
- return true
355
- case ( . invalidProxyResponseHead, . invalidProxyResponseHead) :
356
- return true
357
- case ( . invalidProxyResponse, . invalidProxyResponse) :
358
- return true
359
- case ( . remoteConnectionClosed, . remoteConnectionClosed) :
360
- return true
361
- case ( . httpProxyHandshakeTimeout, . httpProxyHandshakeTimeout) :
362
- return true
363
- case ( . noResult, . noResult) :
364
- return true
365
- default :
366
- return false
367
- }
352
+ return lhs. errorCode == rhs. errorCode
368
353
}
369
354
370
355
public func hash( into hasher: inout Hasher ) {
@@ -375,7 +360,7 @@ extension NIOHTTP1ProxyConnectHandler.Error: Hashable {
375
360
376
361
extension NIOHTTP1ProxyConnectHandler . Error : CustomStringConvertible {
377
362
public var description : String {
378
- self . store. details. description
363
+ " \( self . store. details. description) ( \( self . store . file ) : \( self . store . line ) ) "
379
364
}
380
365
}
381
366
@@ -384,8 +369,8 @@ extension NIOHTTP1ProxyConnectHandler.Error.Details: CustomStringConvertible {
384
369
switch self {
385
370
case . proxyAuthenticationRequired:
386
371
return " Proxy Authentication Required "
387
- case . invalidProxyResponseHead:
388
- return " Invalid Proxy Response Head "
372
+ case . invalidProxyResponseHead( let head ) :
373
+ return " Invalid Proxy Response Head: \( head ) "
389
374
case . invalidProxyResponse:
390
375
return " Invalid Proxy Response "
391
376
case . remoteConnectionClosed:
0 commit comments