File: getInfo.tcl

package info (click to toggle)
tclcurl 7.22.0%2Bhg20160822-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,328 kB
  • ctags: 331
  • sloc: ansic: 4,264; tcl: 860; sh: 155; makefile: 30
file content (55 lines) | stat: -rwxr-xr-x 2,507 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
package require TclCurl

set curlHandle [curl::init]
$curlHandle configure -url "127.0.0.1" -filetime 1  -verbose 1             \
         -cookielist "127.0.0.1\tFALSE\t/\tFALSE\t1262307600\tad_browser_id\t  18864635"
$curlHandle perform

puts "Url: [$curlHandle getinfo effectiveurl]"
puts "Primary IP: [$curlHandle getinfo primaryip]"
puts "Primary port: [$curlHandle getinfo primaryport]"
puts "Local IP: [$curlHandle getinfo localip]"
puts "Local port: [$curlHandle getinfo localport]"
puts "Redirect url: [$curlHandle getinfo redirecturl]"
puts "Http-code: [$curlHandle getinfo responsecode]"
puts "Proxy response code: [$curlHandle getinfo httpconnectcode]"
set fileTime [$curlHandle getinfo filetime]
puts "Filetime: $fileTime - [clock format $fileTime]"
puts "Total time: [$curlHandle getinfo totaltime]"
puts "Name lookup time: [$curlHandle getinfo namelookuptime]"
puts "Name connect time: [$curlHandle getinfo connecttime]"
puts "Name pretransfer time: [$curlHandle getinfo pretransfertime]"
puts "Name start transfer time: [$curlHandle getinfo starttransfertime]"
puts "Name app connect time: [$curlHandle getinfo appconnecttime]"
puts "Name size upload: [$curlHandle getinfo sizeupload]"
puts "Name size download: [$curlHandle getinfo sizedownload]"
puts "Name speed download: [$curlHandle getinfo speeddownload]"
puts "Name speed upload: [$curlHandle getinfo speedupload]"
puts "Name header size: [$curlHandle getinfo headersize]"
puts "Name request size: [$curlHandle getinfo requestsize]"
puts "Name ssl verifyresult: [$curlHandle getinfo sslverifyresult]"
puts "SSL engines: [$curlHandle getinfo sslengines]"
puts "Name length download: [$curlHandle getinfo contentlengthdownload]"
puts "Name length upload: [$curlHandle getinfo contentlengthupload]"
puts "Content-Type: [$curlHandle getinfo contenttype]"
puts "Redirect time: [$curlHandle getinfo redirecttime]"
puts "Redirect count: [$curlHandle getinfo redirectcount]"
puts "Authentication methods available: [$curlHandle getinfo httpauthavail]"
puts "Authentication methods at the proxy: [$curlHandle getinfo proxyauthavail]"
puts "Operating System error number: [$curlHandle getinfo oserrno]"
puts "Number of successful connects: [$curlHandle getinfo numconnects]"
puts "Known cookies: [$curlHandle getinfo cookielist]"
set certList [$curlHandle getinfo certinfo]
set certNum  [lindex $certList 0]
puts "N de certificados: $certNum"
for {set i 1} {$i<=$certNum} {incr i} {
    puts [lindex $certList $i]
}

$curlHandle cleanup