@@ -77,12 +77,11 @@
- (void)_parseConfig: (OFXMLElement *)config
{
void *pool = objc_autoreleasePoolPush();
- if ([config namespace] != nil ||
- ![[config name] isEqual: @"ObjWebServer"])
+ if (config.namespace != nil || ![config.name isEqual: @"ObjWebServer"])
[self _invalidConfig: @"Root element is not ObjWebServer"];
[self _parseListens: [config elementsForName: @"listen"]];
[self _parseModules: [config elementsForName: @"module"]];
@@ -95,50 +94,50 @@
[OFMutableArray array];
for (OFXMLElement *element in elements) {
ListenConfig *listenConfig =
[[[ListenConfig alloc] init] autorelease];
- OFString *host = [[element
- attributeForName: @"host"] stringValue];
- OFString *portString = [[element
- attributeForName: @"port"] stringValue];
+ OFString *host =
+ [element attributeForName: @"host"].stringValue;
+ OFString *portString =
+ [element attributeForName: @"port"].stringValue;
OFXMLElement *TLS = [element elementForName: @"tls"];
if (host == nil)
[self _invalidConfig:
@" is missing host attribute"];
if (portString == nil)
[self _invalidConfig:
@" is missing port attribute"];
- [listenConfig setHost: host];
+ listenConfig.host = host;
@try {
- intmax_t port = [portString decimalValue];
+ intmax_t port = portString.decimalValue;
if (port < 0 || port > 65535)
@throw [OFInvalidFormatException exception];
- [listenConfig setPort: port];
+ listenConfig.port = port;
} @catch (OFInvalidFormatException *e) {
[self _invalidConfig: @" has invalid port"];
}
if (TLS != nil) {
OFString *certificateFile =
- [[TLS attributeForName: @"cert"] stringValue];
+ [TLS attributeForName: @"cert"].stringValue;
OFString *keyFile =
- [[TLS attributeForName: @"key"] stringValue];
+ [TLS attributeForName: @"key"].stringValue;
if (certificateFile == nil)
[self _invalidConfig:
@" has no cert attribute"];
if (keyFile == nil)
[self _invalidConfig:
@" has no key attribute"];
- [listenConfig setTLSCertificateFile: certificateFile];
- [listenConfig setTLSKeyFile: keyFile];
+ listenConfig.TLSCertificateFile = certificateFile;
+ listenConfig.TLSKeyFile = keyFile;
}
[listenConfigs addObject: listenConfig];
}
@@ -150,14 +149,14 @@
{
OFMutableArray OF_GENERIC(OFXMLElement *) *modules =
[OFMutableArray array];
for (OFXMLElement *element in elements) {
- OFString *path = [[element
- attributeForName: @"path"] stringValue];
- OFString *prefix = [[element
- attributeForName: @"prefix"] stringValue];
+ OFString *path =
+ [element attributeForName: @"path"].stringValue;
+ OFString *prefix =
+ [element attributeForName: @"prefix"].stringValue;
if (path == nil || prefix == nil)
[self _invalidConfig:
@" has no path attribute"];