Fix a typo when casting the allowLocalEndpointReuse channel option value (#186)

Motivation:

There was a typo when setting the allowLocalEndpointReuse channel option, where it was cast to NIOTSEnablePeerToPeerOption.Value
instead of NIOTSAllowLocalEndpointReuse.Value. Both of these types are Bools, so this wouldn't cause any actual issues, this change
is to more to keep the code consistent, and reduce confusion for future contributors or others reading the code base.

Modifications:

This commit casts the allowLocalEndpointReuse property in StateManagedListenerChannel and StateManagedNWConnectionChannel.

Result:

The typo is fixed after this change.
This commit is contained in:
Rayman Rosevear 2023-09-25 08:34:20 +02:00 committed by GitHub
parent 251e9e7613
commit e4f1815b6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -240,7 +240,7 @@ extension StateManagedListenerChannel {
case is NIOTSChannelOptions.Types.NIOTSEnablePeerToPeerOption:
self.enablePeerToPeer = value as! NIOTSChannelOptions.Types.NIOTSEnablePeerToPeerOption.Value
case is NIOTSChannelOptions.Types.NIOTSAllowLocalEndpointReuse:
self.allowLocalEndpointReuse = value as! NIOTSChannelOptions.Types.NIOTSEnablePeerToPeerOption.Value
self.allowLocalEndpointReuse = value as! NIOTSChannelOptions.Types.NIOTSAllowLocalEndpointReuse.Value
case is NIOTSChannelOptions.Types.NIOTSMultipathOption:
self.multipathServiceType = value as! NIOTSChannelOptions.Types.NIOTSMultipathOption.Value
default:

View File

@ -538,7 +538,7 @@ extension StateManagedNWConnectionChannel {
case _ as ChannelOptions.Types.AllowRemoteHalfClosureOption:
self.options.supportRemoteHalfClosure = value as! Bool
case is NIOTSChannelOptions.Types.NIOTSAllowLocalEndpointReuse:
self.allowLocalEndpointReuse = value as! NIOTSChannelOptions.Types.NIOTSEnablePeerToPeerOption.Value
self.allowLocalEndpointReuse = value as! NIOTSChannelOptions.Types.NIOTSAllowLocalEndpointReuse.Value
default:
try self.setChannelSpecificOption0(option: option, value: value)
}