Ignore:
Timestamp:
Mar 14, 2015, 12:46:48 AM (9 years ago)
Author:
ldelgass
Message:

Merge r4692 from trunk with modification: only print error message about
clobbered buffer if tracing is enabled.

Location:
branches/1.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4

    • Property svn:mergeinfo changed
      /trunkmerged: 4692
  • branches/1.4/gui/scripts/visviewer.tcl

    r5129 r5130  
    4848    protected variable _outbuf       ;    # buffer for outgoing commands
    4949    protected variable _buffering 0
     50    protected variable _cmdSeq 0     ;    # Command sequence number
    5051    protected variable _dispatcher "";  # dispatcher for !events
    5152    protected variable _hosts ""    ;   # list of hosts for server
     
    322323    set _buffer(in) ""
    323324    set _outbuf ""
     325    set _cmdSeq 0
    324326}
    325327
     
    402404    puts -nonewline $_sid $_buffer(out)
    403405    flush $_sid
     406    set _buffer(out) ""
    404407    set _done($this) 1;                 # Success
    405408}
     
    455458    # before sending anything.
    456459    set _done($this) 1
     460    if {$_trace && $_buffer(out) != ""} {
     461        puts stderr "ERROR: re-entered SendBytes: buffer=([string range $_buffer(out) 0 70]...)"
     462        puts stderr "New cmd $_cmdSeq: [string range $bytes 0 70]..."
     463    }
    457464    set _buffer(out) $bytes
    458465    # There's problem when the user is interacting with the GUI at the
     
    564571    if { [string compare -length 3 $line "nv>"] == 0 } {
    565572        ReceiveEcho <<line $line
     573        if ($_trace) {
     574            puts stderr "<<[string range $line 0 70]"
     575        }
    566576        append _buffer(in) [string range $line 3 end]
    567577        append _buffer(in) "\n"
     
    826836# ----------------------------------------------------------------------
    827837itcl::body Rappture::VisViewer::SendDebugCommand {} {
     838    incr _cmdSeq
    828839    set cmd [$itk_component(command) get]
    829840    append cmd "\n"
     841    if {$_trace} {
     842        puts stderr "$_cmdSeq>>[string range $cmd 0 70]"
     843    }
    830844    SendBytes $cmd
    831845    $itk_component(command) delete 0 end
     
    11931207#
    11941208itcl::body Rappture::VisViewer::SendCmd {string} {
     1209    incr _cmdSeq
     1210    if {$_trace} {
     1211        puts stderr "$_cmdSeq>>[string range $string 0 70]"
     1212    }
    11951213    if { $_buffering } {
    11961214        append _outbuf $string "\n"
     
    12101228        puts stderr "$_cmdSeq>>data payload"
    12111229    }
     1230    incr _cmdSeq
     1231    if {$_trace} {
     1232        puts stderr "$_cmdSeq>>[string range $string 0 70]"
     1233    }
    12121234    if { $_buffering } {
    12131235        append _outbuf $bytes
Note: See TracChangeset for help on using the changeset viewer.