]> Cypherpunks.ru repositories - nncp.git/commitdiff
Much more readable formatting
authorSergey Matveev <stargrave@stargrave.org>
Sat, 27 Apr 2019 21:10:03 +0000 (00:10 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 27 Apr 2019 21:10:03 +0000 (00:10 +0300)
src/cypherpunks.ru/nncp/call.go
src/cypherpunks.ru/nncp/pkt.go
src/cypherpunks.ru/nncp/toss.go
src/cypherpunks.ru/nncp/tx.go

index 4a56950aca4a72b23a768ae7c3e18220a49883be..ef0167a68bfbca8533e7fca2aec533611e5018e1 100644 (file)
@@ -44,7 +44,8 @@ func (ctx *Ctx) CallNode(
        rxRate, txRate int,
        onlineDeadline, maxOnlineTime uint,
        listOnly bool,
-       onlyPkts map[[32]byte]bool) (isGood bool) {
+       onlyPkts map[[32]byte]bool,
+) (isGood bool) {
        for _, addr := range addrs {
                sds := SDS{"node": node.Id, "addr": addr}
                ctx.LogD("call", sds, "dialing")
index e157bef68b9590004c8d42f6eea5d92c02f47878..b2ab591c539a3497fb4a2d03f88f0c4e23eda93b 100644 (file)
@@ -139,7 +139,8 @@ func aeadProcess(
        nonce []byte,
        doEncrypt bool,
        r io.Reader,
-       w io.Writer) (int, error) {
+       w io.Writer,
+) (int, error) {
        var blkCtr uint64
        ciphCtr := nonce[len(nonce)-8:]
        buf := make([]byte, EncBlkSize+aead.Overhead())
@@ -196,7 +197,8 @@ func PktEncWrite(
        nice uint8,
        size, padSize int64,
        data io.Reader,
-       out io.Writer) error {
+       out io.Writer,
+) error {
        pubEph, prvEph, err := box.GenerateKey(rand.Reader)
        if err != nil {
                return err
@@ -299,7 +301,8 @@ func PktEncRead(
        our *NodeOur,
        nodes map[NodeId]*Node,
        data io.Reader,
-       out io.Writer) (*Node, int64, error) {
+       out io.Writer,
+) (*Node, int64, error) {
        var pktEnc PktEnc
        _, err := xdr.Unmarshal(data, &pktEnc)
        if err != nil {
index c7522e8265b1e65e96aed9a14d4232a13f800db5..1f717faddedc1c01f4528f8f6ab1e2188a710ec5 100644 (file)
@@ -56,7 +56,8 @@ func newNotification(fromTo *FromToYAML, subject string) io.Reader {
 func (ctx *Ctx) Toss(
        nodeId *NodeId,
        nice uint8,
-       dryRun, doSeen, noFile, noFreq, noExec, noTrns bool) bool {
+       dryRun, doSeen, noFile, noFreq, noExec, noTrns bool,
+) bool {
        isBad := false
        for job := range ctx.Jobs(nodeId, TRx) {
                pktName := filepath.Base(job.Fd.Name())
index db260cee47d7f87914d5fbaa008185ed600562d6..fcf1c83126123649526e54c39bbff7e22f93dcdd 100644 (file)
@@ -42,7 +42,8 @@ func (ctx *Ctx) Tx(
        pkt *Pkt,
        nice uint8,
        size, minSize int64,
-       src io.Reader) (*Node, error) {
+       src io.Reader,
+) (*Node, error) {
        tmp, err := ctx.NewTmpFileWHash()
        if err != nil {
                return nil, err
@@ -206,7 +207,8 @@ func (ctx *Ctx) TxFileChunked(
        nice uint8,
        srcPath, dstPath string,
        minSize int64,
-       chunkSize int64) error {
+       chunkSize int64,
+) error {
        if dstPath == "" {
                if srcPath == "-" {
                        return errors.New("Must provide destination filename")
@@ -381,7 +383,8 @@ func (ctx *Ctx) TxExec(
        handle string,
        args []string,
        body []byte,
-       minSize int64) error {
+       minSize int64,
+) error {
        path := make([][]byte, 0, 1+len(args))
        path = append(path, []byte(handle))
        for _, arg := range args {