System.Net.Cache.HttpRequestCacheValidator.ParseStatusLine C# (CSharp) Method

ParseStatusLine() private method

private ParseStatusLine ( ) : string
return string
        private string ParseStatusLine() {

            // This will indicate an invalid result
            CacheStatusCode = (HttpStatusCode)0;

            if (CacheEntry.EntryMetadata == null || CacheEntry.EntryMetadata.Count == 0)
            {
                return null;
            }

            string s = CacheEntry.EntryMetadata[0];

            if (s == null) {
                return null;
            }

            int  idx = 0;
            char ch = (char)0;
            while (++idx < s.Length && (ch=s[idx]) != '/') {
                ;
            }

            if (idx == s.Length) {return s;}

            int major = -1;
            int minor = -1;
            int status= -1;

            while (++idx < s.Length && (ch=s[idx]) >= '0' && ch <= '9') {
                major = (major<0? 0: major*10) +(ch - '0');
            }

            if (major < 0 || ch != '.') {return s;}

            while (++idx < s.Length && (ch=s[idx]) >= '0' && ch <= '9') {
                minor = (minor<0? 0: minor*10) + (ch - '0');
            }

            if (minor < 0 || (ch != ' ' && ch != '\t')) {return s;}

            while (++idx < s.Length && ((ch=s[idx]) == ' ' || ch == '\t'))
                ;

            if (idx >= s.Length) {return s;}

            while (ch >= '0' && ch <= '9')
            {
                status = (status<0? 0: status*10) +(ch - '0');
                if (++idx == s.Length)
                    break;
                ch=s[idx];
            }

            if (status < 0 || (idx <= s.Length && (ch != ' ' && ch != '\t'))) {return s;}

            while (idx < s.Length && (s[idx] == ' ' || s[idx] == '\t'))
                ++idx;

            CacheStatusDescription = s.Substring(idx);

            CacheHttpVersion = new Version(major, minor);
            CacheStatusCode = (HttpStatusCode)status;
            return s;
        }
        //