Developer Area

Show
Ignore:
Timestamp:
07/27/09 16:14:25 (5 years ago)
Author:
henri
Message:

Added debugging

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/superbook/trunk/DotTel_SDK/Classes/DnsResolver.m

    r461 r469  
    4949} 
    5050 
    51 - (NSUInteger)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error { 
    52         [aDom retain]; 
    53         ldns_rr_list *naptrs = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_NAPTR fromDomain:aDom withError:error]; 
    54         [aDom release]; 
     51- (NSUInteger)getNAPTRForTel:(NSString *)domain inArray:(NSMutableArray *)naptrArray withError:(NSError **)error { 
     52#ifdef DEBUG 
     53        NSLog(@"Domain %@: Retrieving NAPTR Records", domain); 
     54#endif 
     55        ldns_rr_list *naptrs = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_NAPTR fromDomain:domain withError:error]; 
    5556        if (!naptrs) { 
    5657                return 0; 
     
    8384        NSMutableString *_headerText = nil;      
    8485         
     86#ifdef DEBUG 
     87        NSLog(@"Domain %@: Retrieving TXT Records", domain); 
     88#endif 
    8589        ldns_rr_list *txts = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_TXT fromDomain:domain withError:error]; 
    8690        if (!txts) { 
     
    122126        // It's the responsibility of the caller to make sure the array is sent empty 
    123127                 
     128#ifdef DEBUG 
     129        NSLog(@"Domain %@: Retrieving LOC Records", domain); 
     130#endif 
    124131        ldns_rr_list *locs = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_LOC fromDomain:domain withError:error]; 
    125132        if (!locs) { 
     
    183190         
    184191        if (!ldnsdomain) { 
    185                 //NSLog(@"Can't do ldns_dname_new_frm_str"); 
     192#ifdef DEBUG 
     193                NSLog(@"Domain %@: Can't do ldns_dname_new_frm_str", domain); 
     194#endif 
    186195                dict = [NSDictionary dictionaryWithObject:NSLocalizedString(@"DNS Error: Can't parse resolver name", @"DNS Error resolver parsing") forKey:NSLocalizedDescriptionKey]; 
    187196                err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_NAME userInfo:dict]; 
     
    207216                case 1: // always check for existence of p 
    208217                        if (!p)  { 
    209                                 //NSLog(@"Can't do ldns_resolver_query"); 
     218#ifdef DEBUG 
     219                                NSLog(@"Domain %@: Can't do ldns_resolver_query (rr type %d)", domain, rrType); 
     220#endif 
    210221                                dict = [NSDictionary dictionaryWithObject:NSLocalizedString(@"Network Error: No Internet Connection", @"Network error, no net connect") forKey:NSLocalizedDescriptionKey]; 
    211222                                err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_CONNECTION userInfo:dict]; 
     
    226237                                                                                          LDNS_SECTION_ANSWER); 
    227238                        if (!rrlist) { 
    228                                 //NSLog(@" *** invalid answer name after query\n"); 
     239#ifdef DEBUG 
     240                                NSLog(@"Domain %@: invalid answer name after query (rr type %d)", domain, rrType); 
     241#endif 
    229242                                if (ldns_pkt_get_rcode(p) == LDNS_RCODE_NXDOMAIN) { 
    230243                                        dict = [NSDictionary dictionaryWithObject:NSLocalizedString(@"Domain does not exist", @"Non-existent domain") forKey:NSLocalizedDescriptionKey]; 
     
    245258                        } 
    246259                        @catch (NSException * e) { 
     260#ifdef DEBUG 
     261                                NSLog(@"Domain %@: ldns_rr_list_rr_count exception caught! (rr type %d)", domain, rrType); 
     262#endif 
    247263                                // Exception is caught if there's no data in the rrlist, 
    248264                                // i.e. if there are no records. That's BAD. 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us