11a6fce027
* vendor bencode library github.com/zeebo/bencode * add metainfo parsing library from XD * fix up upload handler so to be less cluttered
23 lignes
297 o
Go
23 lignes
297 o
Go
package bencode
|
|
|
|
import (
|
|
"log"
|
|
"strings"
|
|
)
|
|
|
|
var traceDepth int
|
|
|
|
func prefix() string {
|
|
return strings.Repeat("\t", traceDepth)
|
|
}
|
|
|
|
func un(val string) {
|
|
traceDepth--
|
|
log.Print(prefix(), "<-", val)
|
|
}
|
|
|
|
func trace(val string) string {
|
|
log.Print(prefix(), "->", val)
|
|
traceDepth++
|
|
return val
|
|
}
|