Index: misc/althttpd.c ================================================================== --- misc/althttpd.c +++ misc/althttpd.c @@ -146,23 +146,29 @@ static int useTimeout = 1; /* True to use times */ static int ipv6Only = 0; /* Use IPv6 only */ static int ipv4Only = 0; /* Use IPv4 only */ /* -** Change every space or unprintable character in the zAgent[] string -** into an _. -** -** If the user agent string contains certain prohibited string, then -** exit immediately. +** Double any double-quote characters in a string. */ -static void FixupUserAgent(void){ - int i; - if( zAgent==0 || zAgent[0]==0 ) zAgent = "*"; - for(i=0; zAgent[i]; i++){ - int c = zAgent[i]; - if( c<'!' || c>'~' ){ zAgent[i] = '_'; } +static char *Escape(char *z){ + int i, j; + int n; + char c; + char *zOut; + for(i=0; (c=z[i])!=0 && c!='"'; i++){} + if( c==0 ) return z; + n = 1; + for(i++; (c=z[i])!=0; i++){ if( c=='"' ) n++; } + zOut = malloc( i+n+1 ); + if( zOut==0 ) return ""; + for(i=j=0; (c=z[i])!=0; i++){ + zOut[j++] = c; + if( c=='"' ) zOut[j++] = c; } + zOut[j] = 0; + return zOut; } /* ** Make an entry in the log file. If the HTTP connection should be ** closed, then terminate this process. Otherwise return. @@ -174,23 +180,19 @@ } if( zLogFile && !omitLog ){ time_t now; struct tm *pTm; struct rusage self, children; - int i; int waitStatus; char zDate[200]; - char *zRM = zRemoteUser ? zRemoteUser : "*"; - - if( zScript==0 || zScript[0]==0 ) zScript = "*"; - if( zRemoteAddr==0 || zRemoteAddr[0]==0 ) zRemoteAddr = "*"; - if( zHttpHost==0 || zHttpHost[0]==0 ) zHttpHost = "*"; - if( zReferer==0 || zReferer[0]==0 ) zReferer = "*"; - for(i=0; zReferer[i]; i++){ - if( isspace(zReferer[i]) ){ zReferer = "*"; break; } - } - if( zAgent==0 || zAgent[0]==0 ) zAgent = "*"; + char *zRM = zRemoteUser ? zRemoteUser : ""; + + if( zScript==0 || zScript[0]==0 ) zScript = ""; + if( zRemoteAddr==0 || zRemoteAddr[0]==0 ) zRemoteAddr = ""; + if( zHttpHost==0 || zHttpHost[0]==0 ) zHttpHost = ""; + if( zReferer==0 || zReferer[0]==0 ) zReferer = ""; + if( zAgent==0 || zAgent[0]==0 ) zAgent = ""; time(&now); pTm = localtime(&now); strftime(zDate, sizeof(zDate), "%Y-%m-%d %H:%M:%S", pTm); waitpid(-1, &waitStatus, WNOHANG); getrusage(RUSAGE_SELF, &self); @@ -201,19 +203,37 @@ fprintf(log, "%s - - [%s] \"%s %s %s\" %s %d \"%s\" \"%s\"\n", zRemoteAddr, zDate, zMethod, zScript, zProtocol, zReplyStatus, nOut, zReferer, zAgent); #else strftime(zDate, sizeof(zDate), "%Y-%m-%d %H:%M:%S", pTm); - fprintf(log, "%s %s %s://%s%s %s %s %d %d %d %d %d %d %d %d %s %s\n", - zDate, zRemoteAddr, zHttp, zHttpHost, zScript, zReferer, - zReplyStatus, nIn, nOut, - (int)(self.ru_utime.tv_sec*1000000 + self.ru_utime.tv_usec), - (int)(self.ru_stime.tv_sec*1000000 + self.ru_stime.tv_usec), - (int)(children.ru_utime.tv_sec*1000000 + children.ru_utime.tv_usec), - (int)(children.ru_stime.tv_sec*1000000 + children.ru_stime.tv_usec), - (int)(now - beginTime), - nRequest, zAgent, zRM + /* Log record files: + ** (1) Date and time + ** (2) IP address + ** (3) URL being accessed + ** (4) Referer + ** (5) Reply status + ** (6) Bytes received + ** (7) Bytes sent + ** (8) Self user time + ** (9) Self system time + ** (10) Children user time + ** (11) Children system time + ** (12) Total wall-clock time + * (13) Request number for same TCP/IP connection + ** (14) User agent + ** (15) Remote user + */ + fprintf(log, + "%s,%s,\"%s://%s%s\",\"%s\",%s,%d,%d,%d,%d,%d,%d,%d,%d,\"%s\",\"%s\"\n", + zDate, zRemoteAddr, zHttp, Escape(zHttpHost), Escape(zScript), + Escape(zReferer), zReplyStatus, nIn, nOut, + (int)(self.ru_utime.tv_sec*1000000 + self.ru_utime.tv_usec), + (int)(self.ru_stime.tv_sec*1000000 + self.ru_stime.tv_usec), + (int)(children.ru_utime.tv_sec*1000000 + children.ru_utime.tv_usec), + (int)(children.ru_stime.tv_sec*1000000 + children.ru_stime.tv_usec), + (int)(now - beginTime), + nRequest, Escape(zAgent), Escape(zRM) ); #endif fclose(log); nIn = nOut = 0; } @@ -943,11 +963,10 @@ zFieldName = GetFirstElement(zLine,&zVal); if( zFieldName==0 || *zFieldName==0 ) break; RemoveNewline(zVal); if( strcasecmp(zFieldName,"User-Agent:")==0 ){ zAgent = StrDup(zVal); - FixupUserAgent(); }else if( strcasecmp(zFieldName,"Accept:")==0 ){ zAccept = StrDup(zVal); }else if( strcasecmp(zFieldName,"Content-length:")==0 ){ zContentLength = StrDup(zVal); }else if( strcasecmp(zFieldName,"Content-type:")==0 ){ Index: pages/changes.in ================================================================== --- pages/changes.in +++ pages/changes.in @@ -9,12 +9,13 @@ http://www.sqlite.org/src/timeline?t=release

+set nChng 0 proc chng {date desc} { - global DEST + global DEST nChng if {[regexp {\(([0-9.]+)\)} $date all vers]} { set label [string map {. _} $vers] hd_fragment version_$label } hd_puts "

$date

" @@ -37,10 +38,14 @@ http://www.sqlite.org/src/timeline.

} hd_close_aux hd_enable_main 1 + incr nChng + if {$nChng==1 && [file exists $DEST/$filename]} { + file copy -force $DEST/$filename $DEST/releaselog/current.html + } } } chng {2013-05-20 (3.7.17)} {
  • Add support for [memory-mapped I/O].
  • Add the [sqlite3_strglob()] convenience interface. Index: pages/download.in ================================================================== --- pages/download.in +++ pages/download.in @@ -1,13 +1,17 @@ SQLite Download Page

    SQLite Download Page

    - +
    hd_keywords {download page} set nDownload 0 +set BG {} +unset -nocomplain href +unset -nocomplain href_cnt +set href_cnt 0 proc Product {pattern desc {frag {}}} { regsub VVV $pattern {*} p3 regsub DATE $p3 {20*} p3 regsub YEAR $p3 {20[134][0-9]} p3 regsub VVV $pattern {(30\d{5})} pattern @@ -38,28 +42,36 @@ set units MiB } elseif {$size>1024} { set size [format %.2f [expr {$size/(1024.0)}]] set units KiB } - global pending_heading pending_tag + global pending_heading pending_tag BG + if {$BG!=""} { + set tr "" + } else { + set tr "" + } if {$pending_heading!=""} { if {$pending_tag!=""} { set tg "" set pending_tag {} } else { set tg "" } - hd_puts "\n" + hd_puts "$tr\n" set pending_heading {} } - hd_puts "" + hd_puts "$tr" hd_puts "\n" + global href href_cnt + incr href_cnt + set href(a$href_cnt) $file + hd_puts "[file tail $file]
    ($size $units)\n" hd_puts "" regsub -all VERSION $desc $version d2 hd_puts "\n\n" @@ -69,30 +81,41 @@ eval hd_keywords [lrange $frag 1 end] } } cd $::DEST -proc Heading {title {tag {}}} { +proc Heading {title {tag {}} {bgcolor {}}} { set ::pending_heading $title set ::pending_tag $tag + set ::BG $bgcolor # hd_puts "" } -Heading {Pre-release Source Code Snapshots} +set Caution #fff1c8 + +Heading {Pre-release Source-Code Snapshots} {} $Caution Product {snapshot/sqlite-amalgamation-DATE.zip} { - This is a snapshot (as of VERSION) of the current SQLite code under - development. Use this snapshot for testing only. This is not a release. + This is a snapshot (as of VERSION) of the current SQLite source code under + development. + See the pending + change log or the + timeline + for a summary of updates since the last release. This ZIP archive contains all preprocessed C code combined into a single source file (the [amalgamation]). } Product {snapshot/sqlite-amalgamation32k-DATE.zip} { - This is a snapshot (as of VERSION) of the current SQLite code under - development. The code is split into a small number of source files, + This is a snapshot (as of VERSION) of the current SQLite source code under + development. + See the pending + change log or the + timeline + for a summary of updates since the last release. + The code in this ZIP archive is split into a small number of source files, such that no single source file is longer than 32767 lines of code. - Use this snapshot for testing only. This is not a release. } Product {snapshot/sqlite-tea-DATE.zip} { This is a snapshot (as of VERSION) of the current SQLite code under development, packaged and ready to build using the Tcl Extension Architecture (TEA). @@ -106,10 +129,17 @@ Product {snapshot/sqlite-shell-win64-x64-DATE.zip} { This is a snapshot (as of VERSION) build of the sqlite3.exe command-line shell shell program for 64-bit windows. } + +Product {snapshot/sqlite-winrt81-DATE.vsix} { + This is a snapshot (as of VERSION) for + a complete VSIX package with an extension SDK and all other components + needed to use SQLite for WinRT 8.1 application development with Visual Studio + 2013. This is not a release. +} Heading {Source Code} Product {YEAR/sqlite-amalgamation-VVV.zip} { @@ -218,11 +248,10 @@ needed to use SQLite for application development with Visual Studio 2012 targeting Windows Phone 8.0. This particular VSIX uses a snapshot of SQLite as of VERSION. } - Heading {Precompiled Binaries for Windows Runtime} winrt Product YEAR/sqlite-dll-winrt-x86-VVV.zip { This ZIP archive contains a DLL for the SQLite library version VERSION for 32-bit x86 processors using the WinRT API. @@ -277,18 +306,17 @@ }
    $tg$pending_heading
    $tg$pending_heading
    " if {$frag!=""} { eval hd_fragment $frag set frag {} } - hd_puts "[file tail $file]
    ($size $units)
    " hd_resolve [string trim $d2] hd_puts "
    (sha1: $sha1sum)
    $title
    +
    hd_fragment encoding {build product names}

    Build Product Names

    -

    Beginning with SQLite [version 3.7.4], the names of the build products -have changed to be more consistent. (Prior to version 3.7.4, the -names of build products were seemingly random.) Build products are named -using one of the following templates: +

    +Build products are named using one of the following templates:

    1. sqlite-product-version.zip
    2. sqlite-product-version.tar.gz
    3. sqlite-product-os-cpu-version.zip @@ -308,22 +336,25 @@

      The date in template (4) is of the form: YYYYMMDDHHMM -

      Canonical Source Code

      +

      Source Code Repositories

      -The canonical SQLite source code is maintained in three self-synchronizing +The SQLite source code is maintained in three geographically-dispersed +self-synchronizing [http://www.fossil-scm.org/ | Fossil] repositories that are available for anonymous read-only access. Anyone can view the repository contents and download historical versions of individual files or ZIP archives of historical check-ins.

      Note that a unix-like development environment, including a recent version of Tcl, is required in order to -build from the canonical sources.

      +build from the repository sources. The [amalgamation] source code files +(the "sqlite3.c" and "sqlite3.h" files) are not contained in +the repository.

      http://www.sqlite.org/cgi/src (Dallas)
      http://www2.sqlite.org/cgi/src (Newark)
      http://www3.sqlite.org/cgi/src (Fremont)
      @@ -336,5 +367,21 @@
      http://www.sqlite.org/cgi/docsrc (Dallas)
      http://www2.sqlite.org/cgi/docsrc (Newark)
      http://www3.sqlite.org/cgi/docsrc (Fremont)
      + +proc set_download_hyperlinks {} { + set script "\n" + hd_puts $script +} +set_download_hyperlinks +