@@ -23,10 +23,12 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include + #include #include #include #include @@ -53,14 +55,18 @@ handle: handle] autorelease]; } - init { - Class c = [self class]; - [self release]; - @throw [OFNotImplementedException exceptionWithClass: c - selector: _cmd]; + @try { + [self doesNotRecognizeSelector: _cmd]; + } @catch (id e) { + [self release]; + @throw e; + } + + abort(); } - initWithPriority: (uint16_t)priority weight: (uint16_t)weight port: (uint16_t)port @@ -206,13 +212,11 @@ ns_rr resourceRecord; ns_msg handle; if (res_ninit(&_resState)) @throw [OFAddressTranslationFailedException - exceptionWithClass: [self class] - socket: nil - host: _domain]; + exceptionWithHost: _domain]; answer = [self allocMemoryWithSize: pageSize]; answerLen = res_nsearch(&_resState, [request cStringWithEncoding: OF_STRING_ENCODING_NATIVE], ns_c_in, ns_t_srv, answer, (int)pageSize); @@ -219,22 +223,17 @@ if ((answerLen == -1) && ((h_errno == HOST_NOT_FOUND) || (h_errno == NO_DATA))) return; - if (answerLen < 1 || answerLen > pageSize) { + if (answerLen < 1 || answerLen > pageSize) @throw [OFAddressTranslationFailedException - exceptionWithClass: [self class] - socket: nil - host: _domain]; - } + exceptionWithHost: _domain]; if (ns_initparse(answer, answerLen, &handle)) @throw [OFAddressTranslationFailedException - exceptionWithClass: [self class] - socket: nil - host: _domain]; + exceptionWithHost: _domain]; resourceRecordCount = ns_msg_count(handle, ns_s_an); for (i = 0; i < resourceRecordCount; i++) { if (ns_parserr(&handle, ns_s_an, i, &resourceRecord)) continue;