Bladeren bron

Removed unneeded API. If custom Bonjour type is needed, startWithOptions should be used to specify an options dictionary with the custom type.

jaanus 11 jaren geleden
bovenliggende
commit
93bfe65211
2 gewijzigde bestanden met toevoegingen van 1 en 36 verwijderingen
  1. 0 24
      GCDWebServer/Core/GCDWebServer.h
  2. 1 12
      GCDWebServer/Core/GCDWebServer.m

+ 0 - 24
GCDWebServer/Core/GCDWebServer.h

@@ -356,18 +356,6 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
  */
 - (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name;
 
-/**
- *  Starts the server on a given port and with a specific Bonjour name and type.
- *  Pass a nil Bonjour name to disable Bonjour entirely or an empty string to
- *  use the computer / device name.
- *  Pass a nil or empty string to Bonjour type to use the standard
- *  HTTP web server type "_http._tcp".
- *
- *  Returns NO if the server failed to start.
- */
-- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name bonjourType:(NSString*)bonjourType;
-
-
 #if !TARGET_OS_IPHONE
 
 /**
@@ -381,18 +369,6 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
  */
 - (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name;
 
-/**
- *  Runs the server synchronously using -startWithPort:bonjourName:bonjourType:
- *  until a SIGINT signal is received i.e. Ctrl-C. This method is intended
- *  to be used by command line tools.
- *
- *  Returns NO if the server failed to start.
- *
- *  @warning This method must be used from the main thread only.
- */
-- (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name bonjourType:(NSString*)bonjourType;
-
-
 /**
  *  Runs the server synchronously using -startWithOptions: until a SIGTERM or
  *  SIGINT signal is received i.e. Ctrl-C in Terminal. This method is intended to

+ 1 - 12
GCDWebServer/Core/GCDWebServer.m

@@ -681,29 +681,18 @@ static inline NSString* _EncodeBase64(NSString* string) {
 }
 
 - (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name {
-  return [self startWithPort:port bonjourName:name bonjourType:nil];
-}
-
-- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name bonjourType:(NSString *)bonjourType {
   NSMutableDictionary* options = [NSMutableDictionary dictionary];
   [options setObject:[NSNumber numberWithInteger:port] forKey:GCDWebServerOption_Port];
   [options setValue:name forKey:GCDWebServerOption_BonjourName];
-  if (bonjourType.length) { [options setObject:bonjourType forKey:GCDWebServerOption_BonjourType]; }
   return [self startWithOptions:options error:NULL];
 }
 
 #if !TARGET_OS_IPHONE
 
-- (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name
-{
-  return [self runWithPort:port bonjourName:name bonjourType:nil];
-}
-
-- (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name bonjourType:(NSString*)bonjourType {
+- (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name {
   NSMutableDictionary* options = [NSMutableDictionary dictionary];
   [options setObject:[NSNumber numberWithInteger:port] forKey:GCDWebServerOption_Port];
   [options setValue:name forKey:GCDWebServerOption_BonjourName];
-  if (bonjourType.length) { [options setObject:bonjourType forKey:GCDWebServerOption_BonjourType]; }
   return [self runWithOptions:options error:NULL];
 }