]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/tx.go
Better grammatic
[nncp.git] / src / tx.go
index 998be8926030e7baa2fe7a1f82d15161476a1015..f9da81b03093f6c82d500da82d5f492dfa056f33 100644 (file)
--- a/src/tx.go
+++ b/src/tx.go
@@ -211,7 +211,7 @@ func (ctx *Ctx) Tx(
                r := <-results
                if r.err != nil {
                        tmp.Fd.Close()
-                       return nil, 0, err
+                       return nil, 0, r.err
                }
                if r.pktEncRaw != nil {
                        pktEncRaw = r.pktEncRaw
@@ -330,11 +330,11 @@ func prepareTxFile(srcPath string) (
                if err != nil {
                        return err
                }
-               if info.IsDir() {
+               if info.Mode().IsDir() {
                        // directory header, PAX record header+contents
                        srcSize += TarBlockSize + 2*TarBlockSize
                        dirs = append(dirs, einfo{path: path, modTime: info.ModTime()})
-               } else {
+               } else if info.Mode().IsRegular() {
                        // file header, PAX record header+contents, file content
                        srcSize += TarBlockSize + 2*TarBlockSize + info.Size()
                        if n := info.Size() % TarBlockSize; n != 0 {
@@ -453,7 +453,7 @@ func (ctx *Ctx) TxFile(
                }
                logMsg := func(les LEs) string {
                        return fmt.Sprintf(
-                               "File %s (%s) sent to %s:%s",
+                               "File %s (%s) is sent to %s:%s",
                                srcPath,
                                humanize.IBytes(uint64(finalSize)),
                                ctx.NodeName(node.Id),
@@ -497,7 +497,7 @@ func (ctx *Ctx) TxFile(
                }
                logMsg := func(les LEs) string {
                        return fmt.Sprintf(
-                               "File %s (%s) sent to %s:%s",
+                               "File %s (%s) is sent to %s:%s",
                                srcPath,
                                humanize.IBytes(uint64(size)),
                                ctx.NodeName(node.Id),
@@ -558,7 +558,7 @@ func (ctx *Ctx) TxFile(
        }
        logMsg := func(les LEs) string {
                return fmt.Sprintf(
-                       "File %s (%s) sent to %s:%s",
+                       "File %s (%s) is sent to %s:%s",
                        srcPath,
                        humanize.IBytes(uint64(metaPktSize)),
                        ctx.NodeName(node.Id),
@@ -604,7 +604,7 @@ func (ctx *Ctx) TxFreq(
        }
        logMsg := func(les LEs) string {
                return fmt.Sprintf(
-                       "File request from %s:%s to %s sent",
+                       "File request from %s:%s to %s is sent",
                        ctx.NodeName(node.Id), srcPath,
                        dstPath,
                )
@@ -675,7 +675,7 @@ func (ctx *Ctx) TxExec(
        }
        logMsg := func(les LEs) string {
                return fmt.Sprintf(
-                       "Exec sent to %s@%s (%s)",
+                       "Exec is sent to %s@%s (%s)",
                        ctx.NodeName(node.Id), dst, humanize.IBytes(uint64(size)),
                )
        }