signpub: GTGXG...IE3OA
sendmail: [/usr/sbin/sendmail]
freq: /home/bob/pub
+ freqchunked: 1024
+ freqminsize: 2097152
via: [alice]
@end verbatim
Full path to directory from where file requests will queue files for
transmission. May be omitted to forbid freqing from that node.
+@item freqchunked
+If set, then enable @ref{Chunked, chunked} file transmission during
+freqing. This is the desired chunk size in KiBs.
+
+@item freqminsize
+If set, then apply @ref{OptMinSize, -minsize} option during file
+transmission.
+
@item via
An array of node identifiers that will be used as a relay to that node.
For example @verb{|[foo,bar]|} means that packet can reach current node
@item -debug
Print debug messages. Normally this option should not be used.
@item -minsize
- Minimal required resulting packet size. For example if you send 2
- KiB file and set @option{-minsize 4096}, then resulting packet will
- be 4 KiB (containing file itself and some junk).
+ @anchor{OptMinSize}
+ Minimal required resulting packet size, in bytes. For example if you
+ send 2 KiB file and set @option{-minsize 4096}, then resulting
+ packet will be 4 KiB (containing file itself and some junk).
@item -nice
Set desired outgoing packet @ref{Niceness, niceness level}.
1-255 values are allowed.
@item Ability to feed @command{nncp-file} from stdin, that uses an
encrypted temporary file for that.
@item Chunked files transmission appeared with corresponding
-@command{nncp-reass} command. Useful for transferring big files over
-small storage devices.
+@command{nncp-reass} command and @option{freqchunked} configuration file
+entry. Useful for transferring big files over small storage devices.
+@item @option{freqminsize} configuration file option, analogue to
+@option{-minsize} one.
@item Cryptographic libraries (dependecies) are updated.
@end itemize
)
type NodeYAML struct {
- Id string
- ExchPub string
- SignPub string
- NoisePub *string `noisepub,omitempty`
- Sendmail []string `sendmail,omitempty`
- Incoming *string `incoming,omitempty`
- Freq *string `freq,omitempty`
- Via []string `via,omitempty`
- Calls []CallYAML `calls,omitempty`
+ Id string
+ ExchPub string
+ SignPub string
+ NoisePub *string `noisepub,omitempty`
+ Sendmail []string `sendmail,omitempty`
+ Incoming *string `incoming,omitempty`
+ Freq *string `freq,omitempty`
+ FreqChunked *uint64 `freqchunked,omitempty`
+ FreqMinSize *uint64 `freqminsize,omitempty`
+ Via []string `via,omitempty`
+ Calls []CallYAML `calls,omitempty`
Addrs map[string]string `addrs,omitempty`
}
freq = &fr
}
+ var freqChunked int64
+ if yml.FreqChunked != nil {
+ if *yml.FreqChunked == 0 {
+ return nil, errors.New("freqchunked value must be greater than zero")
+ }
+ freqChunked = int64(*yml.FreqChunked)
+ }
+ var freqMinSize int64
+ if yml.FreqMinSize != nil {
+ freqMinSize = int64(*yml.FreqMinSize)
+ }
defOnlineDeadline := uint(DefaultDeadline)
if yml.OnlineDeadline != nil {
Sendmail: yml.Sendmail,
Incoming: incoming,
Freq: freq,
+ FreqChunked: freqChunked,
+ FreqMinSize: freqMinSize,
Calls: calls,
Addrs: yml.Addrs,
OnlineDeadline: defOnlineDeadline,
Sendmail []string
Incoming *string
Freq *string
+ FreqChunked int64
+ FreqMinSize int64
Via []*NodeId
Addrs map[string]string
OnlineDeadline uint
goto Closing
}
if !dryRun {
- if err = ctx.TxFile(sender, job.PktEnc.Nice, filepath.Join(*freq, src), dst, 0); err != nil {
+ if sender.FreqChunked == 0 {
+ err = ctx.TxFile(
+ sender,
+ job.PktEnc.Nice,
+ filepath.Join(*freq, src),
+ dst,
+ sender.FreqMinSize,
+ )
+ } else {
+ err = ctx.TxFileChunked(
+ sender,
+ job.PktEnc.Nice,
+ filepath.Join(*freq, src),
+ dst,
+ sender.FreqMinSize,
+ sender.FreqChunked,
+ )
+ }
+ if err != nil {
ctx.LogE("rx", SdsAdd(sds, SDS{"err": err}), "tx file")
isBad = true
goto Closing