]> git.sven.stormbind.net Git - sven/tclcurl.git/blob - tests/debugProc.tcl
Imported Upstream version 7.19.6
[sven/tclcurl.git] / tests / debugProc.tcl
1 package require TclCurl
2
3 proc DebugProc {infoType data} {
4
5     switch $infoType {
6         0 {
7             set type "text"
8         }
9         1 {
10             set type "incoming header"
11         }
12         2 {
13             set type "outgoing header"
14         }
15         3 {
16             set type "incoming data"
17         }
18         4 {
19             set type "outgoing data"
20         }
21         5 {
22             set type "incoming SSL data"
23         }
24         6 {
25             set type "outgoing SSL data"
26         }
27     }
28
29     puts "Type: $type - Data:"
30     puts "$data"
31
32     return 0
33 }
34
35 set curlHandle [curl::init]
36
37 $curlHandle configure -url 127.0.0.1 -verbose 1 \
38         -debugproc DebugProc
39
40 $curlHandle perform
41 $curlHandle cleanup