Developer Area

Changeset 313 for apps/iphone/my.tel

Show
Ignore:
Timestamp:
04/17/09 07:14:20 (5 years ago)
Author:
henri
Message:

Many updates to get to version 1.0.0, live on app store.

Location:
apps/iphone/my.tel/trunk
Files:
4 added
23 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/DnsResolver.h

    r299 r313  
    44// 
    55//  Created by Henri Asseily on 9/14/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828//  
     
    1838#import <UIKit/UIKit.h> 
    1939#import "ldns.h" 
     40#import "NetworkUtility.h" 
    2041#import "RecordNaptr.h" 
    2142#import "RecordTxt.h" 
     
    4869 *  
    4970 * @param aDom       the domain to query 
    50  * @param naptrArray   the array to add the naptrs to 
     71 * @param naptrArray the array to add the naptrs to 
     72 * @return           the number of NAPTR records in the domain. 0 should mean error 
    5173 * 
    5274 */ 
    53 - (void)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error; 
     75- (NSUInteger)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error; 
    5476 
    5577/** 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/DnsResolver.m

    r299 r313  
    44// 
    55//  Created by Henri Asseily on 9/14/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828 
     
    2949} 
    3050 
    31 - (void)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error { 
     51- (NSUInteger)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error { 
    3252        [aDom retain]; 
    3353        ldns_rr_list *naptrs = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_NAPTR fromDomain:aDom withError:error]; 
    3454        [aDom release]; 
    3555        if (!naptrs) { 
    36                 return; 
     56                return 0; 
    3757        } 
    3858         
    3959        NSDate *lookupDate = [[NSDate date] retain]; 
    40         NSUInteger i, count = ldns_rr_list_rr_count(naptrs); 
     60        NSUInteger i; 
     61        NSUInteger count = ldns_rr_list_rr_count(naptrs); 
    4162         
    4263        for (i = 0; i < count; i++) { 
     
    5374        [lookupDate release]; 
    5475         
    55         return; 
     76        return count; 
    5677         
    5778} 
     
    6485        ldns_rr_list *txts = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_TXT fromDomain:domain withError:error]; 
    6586        if (!txts) { 
    66                 _headerText = [NSMutableString stringWithString:@""]; 
    6787                return _headerText; 
    6888        } 
    6989         
    7090        NSDate *lookupDate = [[NSDate date] retain]; 
    71         NSUInteger i, count = ldns_rr_list_rr_count(txts); 
     91        NSUInteger i; 
     92        NSUInteger count = ldns_rr_list_rr_count(txts); 
    7293         
    7394        for (i = 0; i < count; i++) { 
     
    7899                                        _headerText = [NSMutableString stringWithString:theRec.textValue]; 
    79100                                } else { 
    80                                         NSLog(theRec.textValue); 
     101                                        //NSLog(theRec.textValue); 
    81102                                        [_headerText appendFormat:@"\n %@", theRec.textValue]; 
    82103                                } 
     
    140161                ldns_resolver_set_debug(resolver, TRUE); 
    141162#endif 
    142                 ldns_resolver_set_edns_udp_size(resolver, 8000); 
     163                // Set ldns defaults. Here's how it'll work: 
     164                 
     165                ldns_resolver_set_usevc(resolver, TRUE);                        // use TCP by default for now. TODO: look at UDP behavior in GPRS/EDGE 
     166                ldns_resolver_set_edns_udp_size(resolver, 4096);        // with a 4k max packet size when in UDP EDNS0 
     167                ldns_resolver_set_fallback(resolver, TRUE);                     // fallback to EDNS0 UDP, and then to TCP 
     168                ldns_resolver_set_fail(resolver, FALSE);                        // do not allow to fail to next nameserver 
     169                ldns_resolver_set_retry(resolver, 4);                           // Max number of retries 
     170                ldns_resolver_set_retrans(resolver, 2);                         // Seconds between retries 
    143171                return resolver; 
    144172        } else { 
     
    158186                dict = [NSDictionary dictionaryWithObject:@"DNS Error: Can't parse resolver name" forKey:NSLocalizedDescriptionKey]; 
    159187                err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_NAME userInfo:dict]; 
    160                 *error = err2; 
     188                if (error) 
     189                        *error = err2; 
    161190                return NULL; 
    162191        } 
     
    164193        ldns_pkt *p; 
    165194         
     195//      @synchronized([self class]) { 
     196                         
    166197        p = ldns_resolver_query(res, 
    167198                                                        ldnsdomain, 
     
    169200                                                        LDNS_RR_CLASS_IN, 
    170201                                                        LDNS_RD); 
    171          
    172         if (!p)  { 
    173                 //NSLog(@"Can't do ldns_resolver_query"); 
    174                 dict = [NSDictionary dictionaryWithObject:@"Network Error: No Internet Connection" forKey:NSLocalizedDescriptionKey]; 
    175                 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_CONNECTION userInfo:dict]; 
    176                 *error = err2; 
    177                 return NULL; 
    178         } 
    179          
    180         /* retrieve the records from the answer section of that 
    181          * packet 
    182          */ 
    183         rrlist = ldns_pkt_rr_list_by_type(p, 
    184                                                                           rrType, 
    185                                                                           LDNS_SECTION_ANSWER); 
    186         if (!rrlist) { 
    187                 //NSLog(@" *** invalid answer name after query\n"); 
    188                 ldns_pkt_free(p); 
    189                 dict = [NSDictionary dictionaryWithObject:@"Data Error: Invalid DNS Answer" forKey:NSLocalizedDescriptionKey]; 
    190                 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_INVALID_ANSWER userInfo:dict]; 
    191                 *error = err2; 
    192                 return NULL; 
    193         } 
    194          
    195         // Check if rrlist is really ok 
    196         @try { 
    197                 ldns_rr_list_rr_count(rrlist); 
    198         } 
    199         @catch (NSException * e) { 
    200                 dict = [NSDictionary dictionaryWithObject:@"Network Error: Bad data returned" forKey:NSLocalizedDescriptionKey]; 
    201                 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_BAD_DATA userInfo:dict]; 
    202                 *error = err2; 
    203                 rrlist = NULL; 
    204         } 
    205  
    206         ldns_pkt_free(p); 
     202 
     203        ldns_rdf_free(ldnsdomain); 
     204 
     205        // Have to play the switch game to encapsulate everything in one potentially synchronized block, with one return statement 
     206        switch (1) { 
     207                case 1: // always check for existence of p 
     208                        if (!p)  { 
     209                                //NSLog(@"Can't do ldns_resolver_query"); 
     210                                dict = [NSDictionary dictionaryWithObject:@"Network Error: Could not connect to server" forKey:NSLocalizedDescriptionKey]; 
     211                                err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_CONNECTION userInfo:dict]; 
     212                                if (error) 
     213                                        *error = err2; 
     214                                // recreate a resolver for later 
     215                                ldns_resolver_deep_free(res); 
     216                                res = [self createLdnsResolver]; 
     217                                rrlist = NULL; 
     218                                break; 
     219                        } 
     220                case 2: // p exists, check for existence of rrlist answer 
     221                        /* retrieve the records from the answer section of that 
     222                         * packet 
     223                         */ 
     224                        rrlist = ldns_pkt_rr_list_by_type(p, 
     225                                                                                          rrType, 
     226                                                                                          LDNS_SECTION_ANSWER); 
     227                        if (!rrlist) { 
     228                                //NSLog(@" *** invalid answer name after query\n"); 
     229                                ldns_pkt_free(p); 
     230                                dict = [NSDictionary dictionaryWithObject:@"Data Error: Invalid DNS Answer" forKey:NSLocalizedDescriptionKey]; 
     231                                err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_INVALID_ANSWER userInfo:dict]; 
     232                                if (error) 
     233                                        *error = err2; 
     234                                rrlist = NULL; 
     235                                break; 
     236                        } 
     237                case 3: // rrlist exists, make sure it's ok 
     238                        @try { 
     239                                ldns_rr_list_rr_count(rrlist); 
     240                        } 
     241                        @catch (NSException * e) { 
     242                                dict = [NSDictionary dictionaryWithObject:@"Network Error: Bad data returned" forKey:NSLocalizedDescriptionKey]; 
     243                                err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_BAD_DATA userInfo:dict]; 
     244                                if (error) 
     245                                        *error = err2; 
     246                                rrlist = NULL; 
     247                        } 
     248                        ldns_pkt_free(p);                        
     249                        break; 
     250                default: 
     251                        break; 
     252        } 
     253//      } // end @synchronized 
     254                 
    207255        return rrlist; 
    208256} 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordLoc.h

    r217 r313  
    44// 
    55//  Created by Henri Asseily on 9/13/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordLoc.m

    r217 r313  
    44// 
    55//  Created by Henri Asseily on 9/13/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828 
     
    5878        } 
    5979         
    60         uint8_t size; 
     80        // uint8_t size; 
    6181        uint32_t horizontal_precision; 
    6282        uint32_t vertical_precision; 
     
    7090        uint32_t equator = (uint32_t) ldns_power(2, 31); 
    7191         
    72         size = ldns_rdf_data(rdf)[1]; // CLLocation doesn't use it 
     92        // size = ldns_rdf_data(rdf)[1]; // CLLocation doesn't use it 
    7393        horizontal_precision = ldns_rdf_data(rdf)[2]; 
    7494        vertical_precision = ldns_rdf_data(rdf)[3]; 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordNaptr.h

    r217 r313  
    44// 
    55//  Created by Henri Asseily on 9/12/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordNaptr.m

    r299 r313  
    44// 
    55//  Created by Henri Asseily on 9/12/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828 
     
    99119                } else { 
    100120                        // Clean Regexp (don't bother with regex, just assume it's a full overwrite) 
    101                         NSArray *regexParts = [regexp componentsSeparatedByString:@"!"]; 
    102                         uriContent = [[NSString stringWithString:[regexParts objectAtIndex:2]] retain]; 
    103                 } 
     121                        NSString *regexSeparator = [regexp substringToIndex:1]; 
     122                        NSArray *regexParts = [regexp componentsSeparatedByString:regexSeparator]; 
     123                        if ([regexParts count] == 4) { 
     124                                // looks like a regex 
     125                                // TODO: Should check that index 3 is empty or the flag "i" 
     126                                // http://www.ietf.org/rfc/rfc2915.txt 
     127                                uriContent = [NSString stringWithString:[regexParts objectAtIndex:2]]; 
     128                        } else {        // Not valid 
     129                                return self; 
     130                        } 
     131                } 
     132                labelDescription = [[self generateLabelDescription] retain]; 
    104133                 
    105134        } else if ([flags isEqualToString:@""]) { // Non-terminal naptr 
    106135                isTerminal = NO; 
    107136                replacement = [self stringFromDnameRdf:ldns_rr_rdf(rr,5)]; 
    108                 uriContent = [replacement retain]; 
     137                labelDescription = [[[replacement stringByReplacingOccurrencesOfString:@"-" withString:@" "] capitalizedString] retain]; 
     138                uriContent = replacement; 
    109139                 
    110140        } else { // Not valid 
     
    113143         
    114144        serviceDescription = [[self generateServiceDescription] retain]; 
    115         labelDescription = [[self generateLabelDescription] retain]; 
    116          
     145        [uriContent retain];     
    117146        isValid = YES; 
    118147        return self; 
     
    179208        } 
    180209 
     210        i = 0; 
    181211        for (aPart in serviceTypeArray) { 
    182212                NSMutableString *strVal = [NSMutableString stringWithString:LocTelStr(aPart)]; 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordTxt.h

    r217 r313  
    44// 
    55//  Created by Henri Asseily on 9/13/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordTxt.m

    r299 r313  
    44// 
    55//  Created by Henri Asseily on 9/13/08. 
    6 //  Copyright 2008 Telnic Ltd. All rights reserved. 
     6/* 
     7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 
     8  
     9 Redistribution and use in source and binary forms, with or without modification, 
     10 are permitted provided that the following conditions are met: 
     11  
     12 Redistributions of source code must retain the above copyright notice, this list of conditions 
     13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 
     14 notice, this list of conditions and the following disclaimer in the documentation and/or other 
     15 materials provided with the distribution. 
     16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 
     17 promote products derived from this software without specific prior written permission. 
     18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
     19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
     20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
     21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
     25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     26 */ 
    727// 
    828 
     
    7595                } 
    7696 
    77                 textValue = [[stringComponents componentsJoinedByString:@", "] retain]; 
     97                textValue = [stringComponents componentsJoinedByString:@", "]; 
    7898                isValid = YES; 
    7999        } 
  • apps/iphone/my.tel/trunk/Classes/DotTel_SDK/README DotTel SDK

    r217 r313  
    1515- Allocate and initialize an instance of DnsResolver 
    1616- Create empty mutable arrays to hold NAPTR, TXT and LOC records 
    17 - Call the DnsResolver methods getNaptrForTel:inArray: and related 
     17- Call the DnsResolver methods getNaptrForTel:inArray:withError: and related 
    1818 
    1919You now have easy access to all relevant .tel data for a domain. 
  • apps/iphone/my.tel/trunk/Classes/GroupFriendsController.h

    r273 r313  
    2727        NSMutableArray *allFriendsArray; // array with all the friends (raw JSON of getgroupfriends on allfriends group) 
    2828        NSMutableArray *selectedFriends;        // 0/1 flags for each object of allFriendsArray to say if they're selected or not 
    29         NSMutableArray *tableData;              // actual table datasource 
    3029        NSString *newGroupName; 
    3130        UIButton *renameButton; 
  • apps/iphone/my.tel/trunk/Classes/GroupFriendsController.m

    r273 r313  
    531531                NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; 
    532532                for (i = 0; i < count; i++) { 
    533                         NSLog(@"working on index: %d", i); 
    534533                        if ([selectedFriends objectAtIndex:i] == nFalse) { 
    535534                                [indexes addIndex:i]; 
  • apps/iphone/my.tel/trunk/Classes/HeaderViewController.h

    r266 r313  
    2727        NSString *previousHeaderString; 
    2828        // Below for keyboard notification 
    29         UIView *activeField; 
    3029        BOOL keyboardShown; 
    3130} 
  • apps/iphone/my.tel/trunk/Classes/HeaderViewController.m

    r266 r313  
    215215 
    216216        NSMutableDictionary *requestData = [[NSMutableDictionary dictionaryWithCapacity:2] retain]; 
    217         NSLog([[VIPConnect sharedInstance].selectedDomain description]); 
    218217        [requestData setObject:[VIPConnect sharedInstance].selectedDomain forKey:@"domainName"]; 
    219218        [requestData setObject:[VIPConnect sharedInstance].selectedProfileId forKey:@"profileId"]; 
  • apps/iphone/my.tel/trunk/Classes/JsonConnection.m

    r271 r313  
    164164                } 
    165165                NSString *theJSONResult; 
    166                 theJSONResult = [[NSString alloc] initWithData:reqResults encoding:NSUTF8StringEncoding]; 
     166                theJSONResult = [[[NSString alloc] initWithData:reqResults encoding:NSUTF8StringEncoding] autorelease]; 
    167167 
    168168#ifdef JSONDEBUG 
  • apps/iphone/my.tel/trunk/Classes/KeywordViewController.m

    r286 r313  
    231231        NSMutableDictionary *uiItem; 
    232232        if (!jsonItem) { 
    233                 return uiItem; 
     233                return NULL; 
    234234        } 
    235235        uiItem = [NSMutableDictionary dictionaryWithCapacity:7]; 
     
    365365                return; 
    366366 
    367         NSString *newId; 
     367        NSString *newId = NULL; 
    368368        if ([[aRec objectForKey:@"primaryKeywordId"] integerValue] == 0) { 
    369369                // new keyword 
  • apps/iphone/my.tel/trunk/Classes/LoginViewController.m

    r299 r313  
    170170        if (!aDomain) 
    171171                return nil; 
    172         // activate a connection 
    173         NSMutableURLRequest *urlReq = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]; 
    174         [urlReq setHTTPMethod:@"HEAD"]; 
    175         [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 
    176         NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:urlReq delegate:self startImmediately:YES]; 
    177         if (!theConnection) { 
    178                 [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 
    179                 NSDictionary *dict = [NSDictionary dictionaryWithObject:@"Network Error: No Internet Connection" forKey:NSLocalizedDescriptionKey]; 
    180                 NSError *err2; 
    181                 err2 = [NSError errorWithDomain:@"org.telnic.my.tel" code:666 userInfo:dict]; 
    182                 *error = err2; 
    183                 return nil; 
    184         }                
    185         // Data connection activation is now started 
     172        if ([aDomain hasSuffix:@".vip.tel"]) { 
     173                return @"https://demo.vip.tel/g2/json"; 
     174        } 
    186175        // try to autoprovision apiRootUrl 
    187176        NSMutableArray *naptrArray = [[NSMutableArray arrayWithCapacity:1] retain]; 
  • apps/iphone/my.tel/trunk/Classes/ProfileViewController.m

    r266 r313  
    350350//      }; 
    351351         
    352         NSDecimalNumber *newProfileId; 
     352        NSDecimalNumber *newProfileId = NULL; 
    353353        if (!aProfName) { 
    354                 return newProfileId; 
     354                return NULL; 
    355355        } 
    356356        [aProfName retain]; 
  • apps/iphone/my.tel/trunk/Classes/RecordGroupsController.m

    r266 r313  
    236236        } 
    237237        [tableView deselectRowAtIndexPath:indexPath animated:YES]; 
    238         NSLog(@"GROUP COUNT: %d\n", ctGroups); 
    239238} 
    240239 
  • apps/iphone/my.tel/trunk/Classes/RecordViewController.m

    r287 r313  
    263263        [aiV startAnimating]; 
    264264        UIBarButtonItem *savingButton = [[UIBarButtonItem alloc] initWithCustomView:aiV]; 
     265        [aiV release]; 
    265266        self.navigationItem.rightBarButtonItem = savingButton; 
    266267        [self orderRecords]; 
     
    340341        NSMutableDictionary *uiItem; 
    341342        if (!jsonItem) { 
    342                 return uiItem; 
     343                return NULL; 
    343344        } 
    344345        uiItem = [NSMutableDictionary dictionaryWithCapacity:7]; 
  • apps/iphone/my.tel/trunk/Classes/VIPConnect.m

    r243 r313  
    4040         
    4141        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 
     42        NSString *aaa = [defaults stringForKey:@"apiRootUrl"]; 
     43        if ((!aaa) || (![aaa hasPrefix:@"http"])) { 
     44                return; 
     45        } 
    4246        NSDictionary *loginInfo = [NSDictionary dictionaryWithObjectsAndKeys: 
    4347                                                           [defaults stringForKey:@"loginName"], @"userName", 
     
    5256        NSURL *theUrl = [NSURL URLWithString:loginString]; 
    5357         
    54         JsonConnection *conn = [[[JsonConnection alloc] init] retain]; 
     58        JsonConnection *conn = [[[JsonConnection alloc] init] autorelease]; 
    5559        if ([conn.delegate offlineMode]) { 
    5660                // auto-login in offline debugging mode 
     
    9094 
    9195- (void)retrieveProfiles { 
    92         Profile *conn = [[[Profile alloc] init] retain]; 
     96        Profile *conn = [[[Profile alloc] init] autorelease]; 
    9397        [conn setTheDelegate:self]; 
    9498        [conn setActionSel:@selector(doNothing:)]; 
  • apps/iphone/my.tel/trunk/Classes/VIP_telAppDelegate.h

    r241 r313  
    1010#import "VIPConnect.h" 
    1111#import "LoginViewController.h" 
     12#import "NetworkUtility.h" 
    1213 
    1314@interface VIP_telAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate, JsonConnectionDelegate> { 
  • apps/iphone/my.tel/trunk/Classes/VIP_telAppDelegate.m

    r299 r313  
    2727                } 
    2828        } 
     29        if (!offlineMode) { 
     30                // Start the networking by opening a write stream 
     31                NetworkUtility *nUtil = [NetworkUtility sharedInstance]; 
     32                if ([nUtil startNetwork] == NotReachable) { 
     33                        NSDictionary *dict = [NSDictionary dictionaryWithObject:@"Network Error: No Internet Connection" forKey:NSLocalizedDescriptionKey]; 
     34                        NSError *error; 
     35                        error = [NSError errorWithDomain:@"org.telnic.my.tel" code:666 userInfo:dict]; 
     36                        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"" 
     37                                                                                                                                                message:[error localizedDescription] 
     38                                                                                                                                           delegate:nil 
     39                                                                                                                          cancelButtonTitle:NSLocalizedString(@"OK", nil) 
     40                                                                                                                          otherButtonTitles:nil]; 
     41                        [alertView show]; 
     42                        [alertView release]; 
     43                } 
     44        }                
    2945         
    3046        [window addSubview:loginController.view]; 
  • apps/iphone/my.tel/trunk/VIP.tel.xcodeproj/project.pbxproj

    r299 r313  
    164164                389604F30ECF2A99003F8B10 /* APILocRecord.plist in Resources */ = {isa = PBXBuildFile; fileRef = 389604F00ECF2A99003F8B10 /* APILocRecord.plist */; }; 
    165165                389604F40ECF2A99003F8B10 /* APINaptrRecord.plist in Resources */ = {isa = PBXBuildFile; fileRef = 389604F10ECF2A99003F8B10 /* APINaptrRecord.plist */; }; 
     166                389AC2AF0F8D3C2200400977 /* NetworkUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 389AC2AB0F8D3C2200400977 /* NetworkUtility.m */; }; 
     167                389AC2B00F8D3C2200400977 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 389AC2AC0F8D3C2200400977 /* Reachability.m */; }; 
    166168                38B8E7D90F6349F000373333 /* RecordGroupsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E7D80F6349F000373333 /* RecordGroupsController.m */; }; 
    167169                38B8E7DD0F634B0800373333 /* RecordGroups.xib in Resources */ = {isa = PBXBuildFile; fileRef = 38B8E7DC0F634B0800373333 /* RecordGroups.xib */; }; 
     
    409411                389604F00ECF2A99003F8B10 /* APILocRecord.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = APILocRecord.plist; sourceTree = "<group>"; }; 
    410412                389604F10ECF2A99003F8B10 /* APINaptrRecord.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = APINaptrRecord.plist; sourceTree = "<group>"; }; 
     413                389AC2AB0F8D3C2200400977 /* NetworkUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkUtility.m; sourceTree = "<group>"; }; 
     414                389AC2AC0F8D3C2200400977 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; }; 
     415                389AC2AD0F8D3C2200400977 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; }; 
     416                389AC2AE0F8D3C2200400977 /* NetworkUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkUtility.h; sourceTree = "<group>"; }; 
    411417                38B8E7D70F6349F000373333 /* RecordGroupsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordGroupsController.h; sourceTree = "<group>"; }; 
    412418                38B8E7D80F6349F000373333 /* RecordGroupsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecordGroupsController.m; sourceTree = "<group>"; }; 
     
    568574                                383FE4710F333380008A9342 /* DnsResolver.h */, 
    569575                                383FE4720F333380008A9342 /* DnsResolver.m */, 
     576                                389AC2AB0F8D3C2200400977 /* NetworkUtility.m */, 
     577                                389AC2AC0F8D3C2200400977 /* Reachability.m */, 
     578                                389AC2AD0F8D3C2200400977 /* Reachability.h */, 
     579                                389AC2AE0F8D3C2200400977 /* NetworkUtility.h */, 
    570580                                383FE4730F333380008A9342 /* RecordLoc.h */, 
    571581                                383FE4740F333380008A9342 /* RecordLoc.m */, 
     
    10961106                                382FDD450F3C547E0021A935 /* GroupFriendsController.m in Sources */, 
    10971107                                38B8E7D90F6349F000373333 /* RecordGroupsController.m in Sources */, 
     1108                                389AC2AF0F8D3C2200400977 /* NetworkUtility.m in Sources */, 
     1109                                389AC2B00F8D3C2200400977 /* Reachability.m in Sources */, 
    10981110                        ); 
    10991111                        runOnlyForDeploymentPostprocessing = 0; 
     
    11561168                                GCC_WARN_UNUSED_VARIABLE = YES; 
    11571169                                PREBINDING = NO; 
     1170                                PROVISIONING_PROFILE = "DC881623-4681-45BB-B714-179F016CBFD9"; 
    11581171                                SDKROOT = iphoneos2.1; 
    11591172                        }; 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us