Fossil

Check-in [7ce35a04]
Login

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

Overview
Comment:In fossil-stress.tcl, retry connection failures after a 1-second delay.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:7ce35a048d450a78f41130f8348a7ed86973a5954be59230f8e78f84b3d4b1f9
User & Date: drh 2017-12-28 16:04:19
Context
2017-12-28
17:16
In the Win32 server code, prevent fclose() from being called on an already closed FILE. check-in: 8d60cd57 user: mistachkin tags: trunk
16:04
In fossil-stress.tcl, retry connection failures after a 1-second delay. check-in: 7ce35a04 user: drh tags: trunk
15:49
Add the "--threads N" option to the fossil-stress.tcl script. Default value is 10. check-in: 08f5fb62 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/fossil-stress.tcl.

31
32
33
34
35
36
37

38
39
40
41
42
43
44
45
46
47
48
49
50
51




52
53
54
55
56
57
58
}
set useragent {Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0}
set path [string trimright $path /]
set port [string trimleft $port :]
if {$port==""} {set port 80}

proc send_one_request {tid domain port path} {

  set x [socket $domain $port]
  fconfigure $x -translation binary
  puts $x "GET $path HTTP/1.0\r"
  if {$port==80} {
    puts $x "Host: $domain\r"
  } else {
    puts $x "Host: $domain:$port\r"
  }
  puts $x "User-Agent: $::useragent\r"
  puts $x "Accept: text/html,q=0.9,*/*;q=0.8\r"
  puts $x "Accept-Language: en-US,en;q=0.5\r"
  puts $x "Connection: close\r"
  puts $x "\r"
  flush $x




  global cnt
  set cnt($x) 0
  fconfigure $x -blocking 0
  fileevent $x readable [list get_reply $tid $path $x]
}

proc get_reply {tid info x} {







>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
}
set useragent {Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0}
set path [string trimright $path /]
set port [string trimleft $port :]
if {$port==""} {set port 80}

proc send_one_request {tid domain port path} {
  while {[catch {
    set x [socket $domain $port]
    fconfigure $x -translation binary
    puts $x "GET $path HTTP/1.0\r"
    if {$port==80} {
      puts $x "Host: $domain\r"
    } else {
      puts $x "Host: $domain:$port\r"
    }
    puts $x "User-Agent: $::useragent\r"
    puts $x "Accept: text/html,q=0.9,*/*;q=0.8\r"
    puts $x "Accept-Language: en-US,en;q=0.5\r"
    puts $x "Connection: close\r"
    puts $x "\r"
    flush $x
  } msg]} {
    puts "ERROR: $msg"
    after 1000
  }
  global cnt
  set cnt($x) 0
  fconfigure $x -blocking 0
  fileevent $x readable [list get_reply $tid $path $x]
}

proc get_reply {tid info x} {