Developer Area

Changeset 588

Show
Ignore:
Timestamp:
11/27/09 09:51:15 (4 months ago)
Author:
jonmaycock
Message:
 
Location:
apps/outlook/branches/1.5/DotTelSystem
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • apps/outlook/branches/1.5/DotTelSystem/DNS/DNSInputStream.cs

    r577 r588  
    463463                return null; 
    464464            } 
     465              try 
     466            { 
     467                while (this.Position < end) 
     468                { 
     469                    txtStr = txtStr + this.ReadString(); 
     470                } 
     471            } 
     472            catch (EndOfStreamException) { } 
    465473            return new DNSTxtResourceRecord(ttl, txtStr); 
    466474                } 
     
    521529        private DNSNInfoResourceRecord ReadNInfo(long rrTTL, int rrDataLen) 
    522530        { 
    523             string txtStr = ReadString(); 
     531            long end = this.Position + rrDataLen; 
     532            string txtStr = ""; 
     533            try 
     534            { 
     535                while (this.Position < end) 
     536                { 
     537                    txtStr = txtStr + this.ReadString(); 
     538                } 
     539            } 
     540            catch (EndOfStreamException) { } 
    524541            if (txtStr.Trim() == DNSStructuredKeywordsTxtResourceRecord.TXTTYPE 
    525542                            || txtStr.Trim() == DNSTxtServiceMessageResourceRecord.TXTTYPE) 
  • apps/outlook/branches/1.5/DotTelSystem/DNS/Records/DNSUnlinkedTelnameNaptrResourceRecord.cs

    r580 r588  
    8484            this.serviceType = naptr.ServiceType; 
    8585            this.catagories = naptr.Catagories; 
     86            Logger.Log(Logger.Section.Lookups,"URI Path: " + naptr.UriPath); 
    8687            this.uriPath = naptr.UriPath; 
     88            Logger.Log(Logger.Section.Lookups, "URI Scheme: " + naptr.UriScheme); 
    8789            this.uriScheme = naptr.UriScheme; 
    8890            this.labels = naptr.Labels; 
    89             if (this.uriPath.StartsWith(";base64")) 
     91            string[] split = this.uriPath.Split(new char[] { ',' }, 2); 
     92            string stuff = split[0]; 
     93            string txtStr = ""; 
     94            if (split.Length > 1) 
     95            { 
     96                txtStr = split[1]; 
     97            } 
     98            else 
     99            { 
     100                txtStr = split[0]; 
     101            } 
     102            if (stuff == "" || split.Length <= 1 || this.uriScheme != "data:") 
     103            { 
     104                this.text = System.Uri.UnescapeDataString(txtStr); 
     105                this.display = true; 
     106            } 
     107            else if (stuff.StartsWith(";base64")) 
    90108            { 
    91109                System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); 
    92110                System.Text.Decoder utf8Decode = encoder.GetDecoder(); 
    93111 
    94                 byte[] todecode_byte = Convert.FromBase64String(this.uriPath.Substring(8, this.uriPath.Length-8)); 
    95                 int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); 
    96                 char[] decoded_char = new char[charCount]; 
    97                 utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0); 
    98                 this.text = new string(decoded_char); 
    99  
     112                Logger.Log(Logger.Section.Lookups, "Base 64 String to decode: " + txtStr); 
     113                try 
     114                { 
     115                    byte[] todecode_byte = Convert.FromBase64String(txtStr); 
     116                    int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); 
     117                    char[] decoded_char = new char[charCount]; 
     118                    utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0); 
     119                    this.text = new string(decoded_char); 
     120                    if (UriHandler.getInstance().Displayable(this.serviceType, this.uriScheme) || !UriHandler.getInstance().KnownService(this.serviceType)) 
     121                        this.display = true; 
     122                    else 
     123                        this.display = false; 
     124                } 
     125                catch (FormatException e) 
     126                { 
     127                    this.text = txtStr; 
     128                } 
    100129            } 
    101130            else 
    102131            { 
    103                 if (this.uriScheme.StartsWith("data:")) 
    104                     this.text = this.uriPath.Substring(1, this.uriPath.Length - 1); 
    105                 else 
    106                     this.text = this.uriPath; 
     132                this.display = false; 
    107133            } 
    108             if (UriHandler.getInstance().Displayable(this.serviceType, this.uriScheme) || !UriHandler.getInstance().KnownService(this.serviceType)) 
    109                 this.display = true; 
    110             else 
    111                 this.display = false; 
    112134 
    113135        } 
  • apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/CacheUpdater.cs

    r577 r588  
    128128                try 
    129129                { 
    130                      
    131130                    string privateTelname = Publishers.Instance.GetPrivateTelname(telname); 
    132131 
  • apps/outlook/branches/1.5/DotTelSystem/Lookup/Cache/LookupCache.cs

    r577 r588  
    121121            lock (cache) 
    122122            { 
    123                string  privateTelname = Publishers.Instance.GetPrivateTelname(telname); 
    124                if (cache.ContainsKey(privateTelname)) 
    125                 { 
    126                     return cache[privateTelname]; 
     123                //Commented out because it is unnecessary 
     124                //string  privateTelname = Publishers.Instance.GetPrivateTelname(telname); 
     125               if (cache.ContainsKey(telname)) 
     126                { 
     127                    return cache[telname]; 
    127128                } 
    128129            } 
  • apps/outlook/branches/1.5/DotTelSystem/Lookup/Lookup.cs

    r577 r588  
    169169            } 
    170170            completeListener = lc; 
    171  
    172171            string privateTelname = Publishers.Instance.GetPrivateTelname(telname); 
    173172            this.PerformLookup(privateTelname, telname); 
  • apps/outlook/branches/1.5/DotTelSystem/Lookup/LookupResult.cs

    r577 r588  
    148148            } 
    149149        } 
    150         /// <summary> The keyword records.</summary> 
    151         private System.Collections.ArrayList newKeywordRecords; 
    152150 
    153151        /// <summary> The keyword records.</summary> 
     
    10881086 
    10891087                        XmlElement uriElement = doc.CreateElement("Uri"); 
    1090                         uriElement.InnerText = rr.ReplaceStr.Replace("\\", "\\\\"); 
     1088                        uriElement.InnerText = Uri.UnescapeDataString(rr.Uri).Replace("\\", "\\\\"); 
    10911089                        naptrRecord.AppendChild(uriElement); 
    10921090 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us