debug = flag.Bool("debug", false, "Print debug messages")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
-
- autoToss = flag.Bool("autotoss", false, "Toss after call is finished")
- autoTossDoSeen = flag.Bool("autotoss-seen", false, "Create .seen files during tossing")
- autoTossNoFile = flag.Bool("autotoss-nofile", false, "Do not process \"file\" packets during tossing")
- autoTossNoFreq = flag.Bool("autotoss-nofreq", false, "Do not process \"freq\" packets during tossing")
- autoTossNoExec = flag.Bool("autotoss-noexec", false, "Do not process \"exec\" packets during tossing")
- autoTossNoTrns = flag.Bool("autotoss-notrns", false, "Do not process \"trns\" packets during tossing")
)
flag.Usage = usage
flag.Parse()
node.Busy = true
node.Unlock()
+ if call.WhenTxExists && call.Xx != "TRx" {
+ ctx.LogD("caller", sds, "checking tx existence")
+ txExists := false
+ for job := range ctx.Jobs(node.Id, nncp.TTx) {
+ job.Fd.Close()
+ if job.PktEnc.Nice > call.Nice {
+ continue
+ }
+ txExists = true
+ }
+ if !txExists {
+ ctx.LogD("caller", sds, "no tx")
+ node.Lock()
+ node.Busy = false
+ node.Unlock()
+ continue
+ }
+ }
+
var autoTossFinish chan struct{}
var autoTossBadCode chan bool
- if *autoToss {
+ if call.AutoToss {
autoTossFinish, autoTossBadCode = ctx.AutoToss(
node.Id,
call.Nice,
- *autoTossDoSeen,
- *autoTossNoFile,
- *autoTossNoFreq,
- *autoTossNoExec,
- *autoTossNoTrns,
+ call.AutoTossDoSeen,
+ call.AutoTossNoFile,
+ call.AutoTossNoFreq,
+ call.AutoTossNoExec,
+ call.AutoTossNoTrns,
)
}
nil,
)
- if *autoToss {
+ if call.AutoToss {
close(autoTossFinish)
<-autoTossBadCode
}