SQLite

Check-in [008cd0ef6b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove some unused code related to URI parsing.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | uri
Files: files | file ages | folders
SHA1: 008cd0ef6b504cf4549468f795aa46f8472f0130
User & Date: dan 2011-05-03 15:09:05.969
Context
2011-05-04
17:35
Merge latest trunk changes with uri branch. (check-in: af279f367e user: dan tags: uri)
2011-05-03
15:09
Remove some unused code related to URI parsing. (check-in: 008cd0ef6b user: dan tags: uri)
11:53
Allow only "localhost" and "" as authorities in URIs. Do not allow escapes (%HH) in the authority part of a URI. (check-in: b8a0f1b523 user: dan tags: uri)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
    eState = 0;
    while( zUri[iIn] && zUri[iIn]!='#' ){
      char c = zUri[iIn++];
      if( c=='%' 
       && sqlite3Isxdigit(zUri[iIn]) 
       && sqlite3Isxdigit(zUri[iIn+1]) 
      ){
        int codepoint = (sqlite3HexToInt(zUri[iIn++]) << 4);
        codepoint += sqlite3HexToInt(zUri[iIn++]);

        assert( codepoint>=0 && codepoint<256 );
        if( codepoint>=128 ){
          *pzErrMsg = sqlite3_mprintf("invalid uri escape: %.3s", &zUri[-3]);
          rc = SQLITE_ERROR;
          goto parse_uri_out;
        }
        else if( codepoint==0 ){
          /* This branch is taken when "%00" appears within the URI. In this
          ** case we ignore all text in the remainder of the path, name or
          ** value currently being parsed. So ignore the current character
          ** and skip to the next "?", "=" or "&", as appropriate. */
          while( zUri[iIn] && zUri[iIn]!='#' 
              && (eState!=0 || zUri[iIn]!='?')
              && (eState!=1 || (zUri[iIn]!='=' && zUri[iIn]!='&'))
              && (eState!=2 || zUri[iIn]!='&')
          ){
            iIn++;
          }
          continue;
        }
        c = codepoint;
      }else if( eState==1 && (c=='&' || c=='=') ){
        if( zFile[iOut-1]==0 ){
          /* An empty option name. Ignore this option altogether. */
          while( zUri[iIn] && zUri[iIn]!='#' && zUri[iIn-1]!='&' ) iIn++;
          continue;
        }
        if( c=='&' ){







|
|

|
<
<
<
<
<
|













|







1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862





1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
    eState = 0;
    while( zUri[iIn] && zUri[iIn]!='#' ){
      char c = zUri[iIn++];
      if( c=='%' 
       && sqlite3Isxdigit(zUri[iIn]) 
       && sqlite3Isxdigit(zUri[iIn+1]) 
      ){
        int octet = (sqlite3HexToInt(zUri[iIn++]) << 4);
        octet += sqlite3HexToInt(zUri[iIn++]);

        assert( octet>=0 && octet<256 );





        if( octet==0 ){
          /* This branch is taken when "%00" appears within the URI. In this
          ** case we ignore all text in the remainder of the path, name or
          ** value currently being parsed. So ignore the current character
          ** and skip to the next "?", "=" or "&", as appropriate. */
          while( zUri[iIn] && zUri[iIn]!='#' 
              && (eState!=0 || zUri[iIn]!='?')
              && (eState!=1 || (zUri[iIn]!='=' && zUri[iIn]!='&'))
              && (eState!=2 || zUri[iIn]!='&')
          ){
            iIn++;
          }
          continue;
        }
        c = octet;
      }else if( eState==1 && (c=='&' || c=='=') ){
        if( zFile[iOut-1]==0 ){
          /* An empty option name. Ignore this option altogether. */
          while( zUri[iIn] && zUri[iIn]!='#' && zUri[iIn-1]!='&' ) iIn++;
          continue;
        }
        if( c=='&' ){