Tcl Source Code

Hex Artifact Content
Login

Artifact fb690fa020916bb9653486ac38ecef79a8364fd7:

Attachment "tst-http.tcl" to ticket [2911139fff] added by kakaroto 2009-12-09 09:33:27.
0000: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20  package require 
0010: 68 74 74 70 0a 0a 70 72 6f 63 20 74 73 74 20 7b  http..proc tst {
0020: 20 7b 64 65 70 74 68 20 30 7d 7d 20 7b 0a 20 20   {depth 0}} {.  
0030: 69 66 20 7b 20 24 64 65 70 74 68 20 3d 3d 20 35  if { $depth == 5
0040: 20 7d 20 20 7b 0a 20 20 20 20 67 65 74 75 72 6c   }  {.    geturl
0050: 0a 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20  .  } else {.    
0060: 69 6e 63 72 20 64 65 70 74 68 20 31 0a 20 20 20  incr depth 1.   
0070: 20 74 73 74 20 24 64 65 70 74 68 0a 20 20 7d 0a   tst $depth.  }.
0080: 7d 0a 0a 70 72 6f 63 20 64 75 6d 6d 79 20 7b 20  }..proc dummy { 
0090: 61 72 67 73 20 7d 20 20 7b 7d 0a 0a 70 72 6f 63  args }  {}..proc
00a0: 20 67 65 74 75 72 6c 20 7b 20 7d 20 7b 0a 20 20   geturl { } {.  
00b0: 3a 3a 68 74 74 70 3a 3a 67 65 74 75 72 6c 20 22  ::http::geturl "
00c0: 68 74 74 70 3a 2f 2f 67 6f 6f 67 6c 65 2e 63 6f  http://google.co
00d0: 6d 22 20 2d 74 69 6d 65 6f 75 74 20 36 30 30 30  m" -timeout 6000
00e0: 30 30 20 2d 63 6f 6d 6d 61 6e 64 20 64 75 6d 6d  00 -command dumm
00f0: 79 0a 7d 0a 0a 66 6f 72 20 7b 73 65 74 20 69 20  y.}..for {set i 
0100: 30 7d 20 7b 24 69 20 3c 20 31 30 30 20 7d 20 7b  0} {$i < 100 } {
0110: 20 69 6e 63 72 20 69 20 7d 20 7b 0a 20 20 20 61   incr i } {.   a
0120: 66 74 65 72 20 69 64 6c 65 20 74 73 74 0a 7d 0a  fter idle tst.}.