From: <kak...@us...> - 2012-05-24 05:44:02
|
Revision: 12385 http://amsn.svn.sourceforge.net/amsn/?rev=12385&view=rev Author: kakaroto Date: 2012-05-24 05:43:55 +0000 (Thu, 24 May 2012) Log Message: ----------- Remove p2p debug messages Modified Paths: -------------- tags/Release-0_98_9/contactlist.tcl tags/Release-0_98_9/msnp2p/transport/TLPv2.tcl tags/Release-0_98_9/msnp2p/transport/base.tcl tags/Release-0_98_9/msnp2p/transport/switchboard.tcl Modified: tags/Release-0_98_9/contactlist.tcl =================================================================== --- tags/Release-0_98_9/contactlist.tcl 2012-05-23 21:31:38 UTC (rev 12384) +++ tags/Release-0_98_9/contactlist.tcl 2012-05-24 05:43:55 UTC (rev 12385) @@ -559,7 +559,7 @@ # Non-empty search pattern } else { set results [$self SearchContacts $pattern] - puts "results $results" + #puts "results $results" set matches [lindex $results 0] set nonmatches [lindex $results 1] foreach { groupid id } $matches { Modified: tags/Release-0_98_9/msnp2p/transport/TLPv2.tcl =================================================================== --- tags/Release-0_98_9/msnp2p/transport/TLPv2.tcl 2012-05-23 21:31:38 UTC (rev 12384) +++ tags/Release-0_98_9/msnp2p/transport/TLPv2.tcl 2012-05-24 05:43:55 UTC (rev 12385) @@ -67,7 +67,7 @@ foreach t [array names data] { set v $data($t) set l [string length $v] - puts "T L V: [hexify $t] [hexify $l] [hexify $v]" + #puts "T L V: [hexify $t] [hexify $l] [hexify $v]" set app_str [binary format cucu $t $l] append str "$app_str$v" } @@ -75,7 +75,7 @@ if {$padding != 4} { append str [string repeat "\x00" $padding] } - puts "Final tlv: [hexify $str]" + #puts "Final tlv: [hexify $str]" return $str } @@ -83,25 +83,25 @@ method parse { scandata size } { set offset 0 - puts "We are going to scan a TLV" - puts "Data is [hexify $scandata]" + #puts "We are going to scan a TLV" + #puts "Data is [hexify $scandata]" while { $offset < $size } { - puts "okay..." + #puts "okay..." set scanme [string range $scandata $offset end] binary scan $scanme bcu t l if { $t == 0 } { - puts "breaking" + #puts "breaking" break } set end [expr {$offset + 2 + $l}] if { $end > $size } { - puts ":(" + #puts ":(" #raise some error i guess return } set v [string range $scanme 2 [expr {2 + $l}]] - puts "Wow, we scanned a TLV" - puts "Scanned tlv [hexify $t] [hexify $l] [hexify $v]" + #puts "Wow, we scanned a TLV" + #puts "Scanned tlv [hexify $t] [hexify $l] [hexify $v]" set data($t) $v set offset $end } @@ -270,15 +270,15 @@ if { [catch {binary scan [string range $data 0 7] cubSuIu size options(-op_code) options(-chunk_size) options(-chunk_id)} msg]} { return "" } - puts "scanned data [hexify [string range $data 0 7]] and got size $options(-chunk_size)" + #puts "scanned data [hexify [string range $data 0 7]] and got size $options(-chunk_size)" $options(-tlv) parse [string range $data 8 $size] [expr {$size - 8}] if { $options(-chunk_size) > 0 } { set dph_size [$self parse_data_header [string range $data $size end]] - puts "dph size is $dph_size , chunk size is $options(-chunk_size)" + #puts "dph size is $dph_size , chunk size is $options(-chunk_size)" set options(-chunk_size) [expr {$options(-chunk_size) - $dph_size}] set size [expr {$size + $dph_size}] } - puts "Chunk size $options(-chunk_size) of data [hexify [string range $data 0 7]]" + #puts "Chunk size $options(-chunk_size) of data [hexify [string range $data 0 7]]" return $size } @@ -380,7 +380,7 @@ method ack_id { } { - puts "chunk id [hexify [$self get_field chunk_id]] and data size [hexify [$options(-header) data_size]]" + #puts "chunk id [hexify [$self get_field chunk_id]] and data size [hexify [$options(-header) data_size]]" return [expr {[$self get_field chunk_id] + [$options(-header) data_size]}] } @@ -408,15 +408,15 @@ if { [$self get_field first] == 0 } { return 0 } - puts "Data remaining: [$options(-header) data_remaining] and size: [$self size]" + #puts "Data remaining: [$options(-header) data_remaining] and size: [$self size]" return [expr {[$options(-header) data_remaining] + [$self size]}] } method is_control_chunk { } { - puts "Is this a control chunk? [expr {[$self is_ack_chunk] || [$self is_nak_chunk] || ([$self require_ack] && [$self size] == 0)}]" - puts "Our size is [$self size] and we require ack? [$self require_ack]" + #puts "Is this a control chunk? [expr {[$self is_ack_chunk] || [$self is_nak_chunk] || ([$self require_ack] && [$self size] == 0)}]" + #puts "Our size is [$self size] and we require ack? [$self require_ack]" return [expr {[$self is_ack_chunk] || [$self is_nak_chunk] || ([$self require_ack] && [$self size] == 0)}] } @@ -453,7 +453,7 @@ method require_ack { } { - puts "Requiring ack? [hexify [expr {[$self get_field op_code] & $::p2pv2::TLPFlag::RAK == $::p2pv2::TLPFlag::RAK}]]" + #puts "Requiring ack? [hexify [expr {[$self get_field op_code] & $::p2pv2::TLPFlag::RAK == $::p2pv2::TLPFlag::RAK}]]" return [expr {[$self get_field op_code] & $::p2pv2::TLPFlag::RAK == $::p2pv2::TLPFlag::RAK}] } Modified: tags/Release-0_98_9/msnp2p/transport/base.tcl =================================================================== --- tags/Release-0_98_9/msnp2p/transport/base.tcl 2012-05-23 21:31:38 UTC (rev 12384) +++ tags/Release-0_98_9/msnp2p/transport/base.tcl 2012-05-24 05:43:55 UTC (rev 12385) @@ -141,24 +141,24 @@ method On_chunk_received { peer peer_guid chunk } { - status_log "base.tcl received $chunk" - puts "base.tcl received $chunk" + #status_log "base.tcl received $chunk" + #puts "base.tcl received $chunk" if { [$chunk require_ack] == 1 } { - puts "Requires ACK" - status_log "Will send ACK" + #puts "Requires ACK" + #status_log "Will send ACK" set ack_chunk [$chunk create_ack_chunk] $self __Send_chunk $peer $peer_guid $ack_chunk "skip" #$ack_chunk destroy } if { [$chunk is_control_chunk] == 0 || [$chunk is_signaling_chunk] == 1 } { - puts "No control" - status_log "It is not a control chunk" + #puts "No control" + #status_log "It is not a control chunk" if { [$chunk is_signaling_chunk] == 1 } { - status_log "It is a signaling chunk" + #status_log "It is a signaling chunk" $self On_signaling_chunk_received $chunk } else { - status_log "It is not a signaling chunk either" + #status_log "It is not a signaling chunk either" ::Event::fireEvent p2pChunkReceived p2pBaseTransport $self $chunk } } @@ -186,13 +186,13 @@ $blob append_chunk $chunk if { [$blob is_complete] } { - status_log "The blob $blob is complete" + #status_log "The blob $blob is complete" ::Event::fireEvent p2pBlobReceived p2pBaseTransport $blob array unset signaling_blobs $blob_id - status_log "Signaling chunk received, destroying blob" + #status_log "Signaling chunk received, destroying blob" catch {$blob destroy} } else { - status_log "Waiting for more data" + #status_log "Waiting for more data" } } @@ -223,7 +223,7 @@ method Process_send_queue { } { - status_log "Processing send queue" + #status_log "Processing send queue" if { [llength $data_blob_queue] > 0 } { set queue $data_blob_queue } else { @@ -236,9 +236,9 @@ set blob [lindex [lindex $queue 0] 2] set peer_guid [lindex [lindex $queue 0] 1] set peer [lindex [lindex $queue 0] 0] - status_log "Blob $blob for $peer" + #status_log "Blob $blob for $peer" if { [$blob is_complete] } { - status_log "Not resending a complete blob!" + #status_log "Not resending a complete blob!" if { [lindex [lindex $data_blob_queue 0] 2] == $blob } { set data_blob_queue [lreplace $data_blob_queue 0 0] @@ -247,7 +247,7 @@ } set chunk [$blob get_chunk [$self version] [$self max_chunk_size] $first] - status_log "Sending $chunk" + #status_log "Sending $chunk" $self __Send_chunk $peer $peer_guid $chunk $blob } @@ -260,7 +260,7 @@ method __Send_chunk {peer peer_guid chunk blob} { variable local_chunk_id - status_log "Sending chunk $chunk to $peer -- $peer_guid" + #status_log "Sending chunk $chunk to $peer -- $peer_guid" if { ![info exists local_chunk_id] } { set local_chunk_id [expr {int(1000 + rand() * (1+65540-1000))}] @@ -273,9 +273,9 @@ } #puts "Going to send [hexify [$chunk toString]]" - puts "Adding command : Send_chunk $peer $peer_guid $chunk" + #puts "Adding command : Send_chunk $peer $peer_guid $chunk" set chunk_queue [lappend chunk_queue [list [list $options(-transport) Send_chunk $peer $peer_guid $chunk] $blob]] - puts "send $self. Chunk queue: $chunk_queue" + #puts "send $self. Chunk queue: $chunk_queue" set sock [$options(-transport) get_sock] if { [fileevent $sock writable] == "" } { @@ -292,11 +292,11 @@ fileevent $sock writable "" if { [llength $chunk_queue] <= 0 } { return } - puts "process $self: Chunk queue: $chunk_queue" + #puts "process $self: Chunk queue: $chunk_queue" set command [lindex $chunk_queue 0] set blob [lindex $command 1] set command [lindex $command 0] - puts "Calling command : $command" + #puts "Calling command : $command" eval $command set chunk_queue [lreplace $chunk_queue 0 0] @@ -310,14 +310,14 @@ return } if { [$blob is_complete] } { - status_log "Queue says blob $blob is complete with chunk $chunk" + #status_log "Queue says blob $blob is complete with chunk $chunk" if { [lindex [lindex $data_blob_queue 0] 2] == $blob } { set data_blob_queue [lreplace $data_blob_queue 0 0] } - status_log "New queue: $data_blob_queue" + #status_log "New queue: $data_blob_queue" $self Add_pending_blob [$chunk ack_id] $blob } else { - status_log "Blob size is [$blob cget -blob_size] and we have [$blob transferred]" + #status_log "Blob size is [$blob cget -blob_size] and we have [$blob transferred]" $self Process_send_queue } Modified: tags/Release-0_98_9/msnp2p/transport/switchboard.tcl =================================================================== --- tags/Release-0_98_9/msnp2p/transport/switchboard.tcl 2012-05-23 21:31:38 UTC (rev 12384) +++ tags/Release-0_98_9/msnp2p/transport/switchboard.tcl 2012-05-24 05:43:55 UTC (rev 12385) @@ -84,7 +84,7 @@ } method Send_chunk { peer peer_guid chunk } { - puts "Sending chunk to $peer -- $peer_guid" + #puts "Sending chunk to $peer -- $peer_guid" set content_type "application/x-msnmsgrp2p" set sendme [Message %AUTO%] $sendme add_header MIME-Version 1.0 @@ -102,7 +102,7 @@ set data_len [expr [string length $data]] set chatid [::MSN::chatTo $peer] set sb [::MSN::SBFor $chatid] - puts "Chat to $chatid - $sb" + #puts "Chat to $chatid - $sb" if { [$sb get_unacked] < 10 } { ::MSN::ChatQueue $chatid [list ::MSN::WriteSBNoNL $sb "MSG" "D $data_len\r\n$data"] } else { @@ -139,12 +139,12 @@ } if { [catch {set chunk [MessageChunk parse $version [string range [$message get_body] 0 end-4]]} msg] } { status_log "Received erroneous chunk" - puts "Received erroneous chunk: $msg" + #puts "Received erroneous chunk: $msg" return "" } - puts "Received a right chunk" + #puts "Received a right chunk" binary scan [string range [$message get_body] end-4 end] iu appid - puts "Destroying" + #puts "Destroying" catch {$message destroy} $self On_chunk_received [$self cget -peer] [$self cget -peer_guid] $chunk catch {$chunk destroy} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |