mirror of
https://github.com/swisspol/GCDWebServer.git
synced 2026-04-24 00:00:04 +08:00
Fixed behavior of GCDWebServerOption_BonjourName option
This commit is contained in:
@@ -79,7 +79,7 @@ extern NSString* const GCDWebServerOption_Port;
|
|||||||
* the name will automatically take the value of the GCDWebServerOption_ServerName
|
* the name will automatically take the value of the GCDWebServerOption_ServerName
|
||||||
* option. If this option is set to nil, Bonjour will be disabled.
|
* option. If this option is set to nil, Bonjour will be disabled.
|
||||||
*
|
*
|
||||||
* The default value is an empty string.
|
* The default value is nil.
|
||||||
*/
|
*/
|
||||||
extern NSString* const GCDWebServerOption_BonjourName;
|
extern NSString* const GCDWebServerOption_BonjourName;
|
||||||
|
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ static inline NSString* _EncodeBase64(NSString* string) {
|
|||||||
_source6 = [self _createDispatchSourceWithListeningSocket:listeningSocket6 isIPv6:YES];
|
_source6 = [self _createDispatchSourceWithListeningSocket:listeningSocket6 isIPv6:YES];
|
||||||
_port = port;
|
_port = port;
|
||||||
|
|
||||||
NSString* bonjourName = _GetOption(_options, GCDWebServerOption_BonjourName, @"");
|
NSString* bonjourName = _GetOption(_options, GCDWebServerOption_BonjourName, nil);
|
||||||
NSString* bonjourType = _GetOption(_options, GCDWebServerOption_BonjourType, @"_http._tcp");
|
NSString* bonjourType = _GetOption(_options, GCDWebServerOption_BonjourType, @"_http._tcp");
|
||||||
if (bonjourName) {
|
if (bonjourName) {
|
||||||
_registrationService = CFNetServiceCreate(kCFAllocatorDefault, CFSTR("local."), (__bridge CFStringRef)bonjourType, (__bridge CFStringRef)(bonjourName.length ? bonjourName : _serverName), (SInt32)_port);
|
_registrationService = CFNetServiceCreate(kCFAllocatorDefault, CFSTR("local."), (__bridge CFStringRef)bonjourType, (__bridge CFStringRef)(bonjourName.length ? bonjourName : _serverName), (SInt32)_port);
|
||||||
|
|||||||
Reference in New Issue
Block a user