Fossil

Check-in [76e8600b94]
Login

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

Overview
Comment:Correctly escape ZIP and Tarball filenames for URLs. Limit SHA1 hashs on diff URLs using %S instead of %s. Limit the number of links to follow off of each page in the many-www.tcl test script.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 76e8600b94210e4a83288264a278f423051e4b1d
User & Date: drh 2012-11-08 20:51:35.470
Context
2012-11-09
11:56
In html5, every table row is expected to have the same number of cells. check-in: cc746fc66c user: jan.nijtmans tags: trunk
09:01
Attempt to fix [fb3057f6ed]. Seems to work. check-in: b0917b1000 user: jan.nijtmans tags: ticket-fb3057f6ed
07:47
merge trunk check-in: 49f73889b3 user: jan.nijtmans tags: convert_before_commit
2012-11-08
20:51
Correctly escape ZIP and Tarball filenames for URLs. Limit SHA1 hashs on diff URLs using %S instead of %s. Limit the number of links to follow off of each page in the many-www.tcl test script. check-in: 76e8600b94 user: drh tags: trunk
20:28
Update the many-www.tcl test script to stage the URLs testing and to run more of them. check-in: 691f188402 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/finfo.c.
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
    hyperlink_to_uuid(zShortCkin);
    @ %h(zCom) (user: 
    hyperlink_to_user(zUser, zDate, "");
    @ branch: %h(zBr))
    if( g.perm.Hyperlink && zUuid ){
      const char *z = zFilename;
      if( fpid ){
        @ %z(href("%R/fdiff?v1=%s&v2=%s",zPUuid,zUuid))[diff]</a>
      }
      @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z))
      @ [annotate]</a>
    }
    @ </td></tr>
  }
  db_finalize(&q);







|







355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
    hyperlink_to_uuid(zShortCkin);
    @ %h(zCom) (user: 
    hyperlink_to_user(zUser, zDate, "");
    @ branch: %h(zBr))
    if( g.perm.Hyperlink && zUuid ){
      const char *z = zFilename;
      if( fpid ){
        @ %z(href("%R/fdiff?v1=%S&v2=%S",zPUuid,zUuid))[diff]</a>
      }
      @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z))
      @ [annotate]</a>
    }
    @ </td></tr>
  }
  db_finalize(&q);
Changes to src/info.c.
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
      }
      if( seenDiffTitle ){
        @ </td></tr>
      }

      /* The Download: line */
      if( g.perm.Zip ){
        char *zUrl = mprintf("%R/tarball/%s-%S.tar.gz?uuid=%s",
                             zProjName, zUuid, zUuid);
        @ </td></tr>
        @ <tr><th>Downloads:</th><td>
        @ %z(href("%s",zUrl))Tarball</a>
        @ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid))
        @         ZIP archive</a>
        fossil_free(zUrl);
      }
      @ </td></tr>
      @ <tr><th>Other&nbsp;Links:</th>
      @   <td>
      @     %z(href("%R/dir?ci=%S",zUuid))files</a>







|




|







615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
      }
      if( seenDiffTitle ){
        @ </td></tr>
      }

      /* The Download: line */
      if( g.perm.Zip ){
        char *zUrl = mprintf("%R/tarball/%t-%S.tar.gz?uuid=%s",
                             zProjName, zUuid, zUuid);
        @ </td></tr>
        @ <tr><th>Downloads:</th><td>
        @ %z(href("%s",zUrl))Tarball</a>
        @ | %z(href("%R/zip/%t-%S.zip?uuid=%s",zProjName,zUuid,zUuid))
        @         ZIP archive</a>
        fossil_free(zUrl);
      }
      @ </td></tr>
      @ <tr><th>Other&nbsp;Links:</th>
      @   <td>
      @     %z(href("%R/dir?ci=%S",zUuid))files</a>
Changes to test/many-www.tcl.
62
63
64
65
66
67
68

69
70


71
72
73
74
75
76
77
  set tm [time {set x [run_query $url]}]
  set ms [lindex $tm 0]
  puts [format {%.3fs} [expr {$ms/1000000.0}]]
  flush stdout
  if {[string length $x]>1000000} {
    set x [string range $x 0 1000000]
  }

  while {[regexp {<[aA] .*?href="(/[a-z].*?)".*?>(.*)$} $x all url tail]} {
    # if {$npending>2*($limit - $i)} break


    set u2 [string map {&lt; < &gt; > &quot; \" &amp; &} $url]
    if {![info exists seen($u2)]} {
      set next($u2) 1
      set seen($u2) 1
    }
    set x $tail
  }







>


>
>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  set tm [time {set x [run_query $url]}]
  set ms [lindex $tm 0]
  puts [format {%.3fs} [expr {$ms/1000000.0}]]
  flush stdout
  if {[string length $x]>1000000} {
    set x [string range $x 0 1000000]
  }
  set k 0
  while {[regexp {<[aA] .*?href="(/[a-z].*?)".*?>(.*)$} $x all url tail]} {
    # if {$npending>2*($limit - $i)} break
    incr k
    if {$k>100} break
    set u2 [string map {&lt; < &gt; > &quot; \" &amp; &} $url]
    if {![info exists seen($u2)]} {
      set next($u2) 1
      set seen($u2) 1
    }
    set x $tail
  }