From 2964ede174b35d0461425c92964b8df724c97335 Mon Sep 17 00:00:00 2001 From: Amey Shrivastava <72866602+AmeyShrivastava@users.noreply.github.com> Date: Wed, 17 Nov 2021 23:50:32 +0530 Subject: [PATCH] Fix Typos (revised) This commit fixes spelling mistakes (typos) at a few places in the codebase. (Includes requested corrections) --- src/cli/cli.go | 2 +- src/croc/croc.go | 28 ++++++++++++++-------------- src/install/default.txt | 6 +++--- src/utils/utils.go | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 1a47870..d974271 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -459,7 +459,7 @@ func receive(c *cli.Context) (err error) { log.Error(err) return } - // update anything that isn't expliciGlobalIsSettly set + // update anything that isn't explicitly Globally set if !c.IsSet("relay") && rememberedOptions.RelayAddress != "" { crocOptions.RelayAddress = rememberedOptions.RelayAddress } diff --git a/src/croc/croc.go b/src/croc/croc.go index 215230d..9c66890 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -84,7 +84,7 @@ type Client struct { // steps involved in forming relationship Step1ChannelSecured bool - Step2FileInfoTransfered bool + Step2FileInfoTransferred bool Step3RecipientRequestFile bool Step4FileTransfer bool Step5CloseChannels bool @@ -103,7 +103,7 @@ type Client struct { LastFolder string TotalSent int64 - TotalChunksTransfered int + TotalChunksTransferred int chunkMap map[uint64]struct{} // tcp connections @@ -118,7 +118,7 @@ type Client struct { numfinished int quit chan bool finishedNum int - numberOfTransferedFiles int + numberOfTransferredFiles int } // Chunk contains information about the @@ -579,7 +579,7 @@ func (c *Client) Receive() (err error) { address := net.JoinHostPort(discoveries[i].Address, portToUse) errPing := tcp.PingServer(address) if errPing == nil { - log.Debugf("succesfully pinged '%s'", address) + log.Debugf("successfully pinged '%s'", address) c.Options.RelayAddress = address c.ExternalIPConnected = c.Options.RelayAddress c.Options.RelayAddress6 = "" @@ -695,7 +695,7 @@ func (c *Client) Receive() (err error) { fmt.Fprintf(os.Stderr, "\rsecuring channel...") err = c.transfer(TransferOptions{}) if err == nil { - if c.numberOfTransferedFiles == 0 { + if c.numberOfTransferredFiles == 0 { fmt.Fprintf(os.Stderr, "\rNo files transferred.") } } @@ -845,7 +845,7 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error fmt.Fprintf(os.Stderr, "\nReceiving (<-%s)\n", c.ExternalIPConnected) log.Debug(c.FilesToTransfer) - c.Step2FileInfoTransfered = true + c.Step2FileInfoTransferred = true return } @@ -1061,7 +1061,7 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) { } func (c *Client) updateIfSenderChannelSecured() (err error) { - if c.Options.IsSender && c.Step1ChannelSecured && !c.Step2FileInfoTransfered { + if c.Options.IsSender && c.Step1ChannelSecured && !c.Step2FileInfoTransferred { var b []byte machID, _ := machineid.ID() b, err = json.Marshal(SenderInfo{ @@ -1084,7 +1084,7 @@ func (c *Client) updateIfSenderChannelSecured() (err error) { return } - c.Step2FileInfoTransfered = true + c.Step2FileInfoTransferred = true } return } @@ -1245,7 +1245,7 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error) } func (c *Client) updateIfRecipientHasFileInfo() (err error) { - if !(!c.Options.IsSender && c.Step2FileInfoTransfered && !c.Step3RecipientRequestFile) { + if !(!c.Options.IsSender && c.Step2FileInfoTransferred && !c.Step3RecipientRequestFile) { return } // find the next file to transfer and send that number @@ -1272,7 +1272,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { if err != nil { return } else { - c.numberOfTransferedFiles++ + c.numberOfTransferredFiles++ } continue } @@ -1310,7 +1310,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { if errHash != nil || !bytes.Equal(fileHash, fileInfo.Hash) { finished = false c.FilesToTransferCurrentNum = i - c.numberOfTransferedFiles++ + c.numberOfTransferredFiles++ newFolder, _ := filepath.Split(fileInfo.FolderRemote) if newFolder != c.LastFolder && len(c.FilesToTransfer) > 0 { fmt.Fprintf(os.Stderr, "\r%s\n", newFolder) @@ -1468,10 +1468,10 @@ func (c *Client) receiveData(i int) { } c.bar.Add(len(data[8:])) c.TotalSent += int64(len(data[8:])) - c.TotalChunksTransfered++ - // log.Debug(len(c.CurrentFileChunks), c.TotalChunksTransfered, c.TotalSent, c.FilesToTransfer[c.FilesToTransferCurrentNum].Size) + c.TotalChunksTransferred++ + // log.Debug(len(c.CurrentFileChunks), c.TotalChunksTransferred, c.TotalSent, c.FilesToTransfer[c.FilesToTransferCurrentNum].Size) - if !c.CurrentFileIsClosed && (c.TotalChunksTransfered == len(c.CurrentFileChunks) || c.TotalSent == c.FilesToTransfer[c.FilesToTransferCurrentNum].Size) { + if !c.CurrentFileIsClosed && (c.TotalChunksTransferred == len(c.CurrentFileChunks) || c.TotalSent == c.FilesToTransfer[c.FilesToTransferCurrentNum].Size) { c.CurrentFileIsClosed = true log.Debug("finished receiving!") if err := c.CurrentFile.Close(); err != nil { diff --git a/src/install/default.txt b/src/install/default.txt index c9d13b1..45f1e56 100644 --- a/src/install/default.txt +++ b/src/install/default.txt @@ -159,7 +159,7 @@ make_tempdir() { # DESCRIPTION: Attempts to determin host os using uname # PARAMETERS: none # RETURNS: 0 = OS Detected. Also prints detected os to stdout -# 1 = Unkown OS +# 1 = Unknown OS # 20 = 'uname' not found in path #------------------------------------------------------------------------------- determine_os() { @@ -183,7 +183,7 @@ determine_os() { # DESCRIPTION: Attempt to determin architecture of host # PARAMETERS: none # RETURNS: 0 = Arch Detected. Also prints detected arch to stdout -# 1 = Unkown arch +# 1 = Unknown arch # 20 = 'uname' not found in path #------------------------------------------------------------------------------- determine_arch() { @@ -238,7 +238,7 @@ download_file() { #--- FUNCTION ---------------------------------------------------------------- # NAME: checksum_check # DESCRIPTION: Attempt to verify checksum of downloaded file to ensure -# integrity. Tries multiple tools before faling. +# integrity. Tries multiple tools before failing. # PARAMETERS: $1 = path to checksum file # $2 = location of file to check # $3 = working directory diff --git a/src/utils/utils.go b/src/utils/utils.go index 19c0e6e..af28588 100644 --- a/src/utils/utils.go +++ b/src/utils/utils.go @@ -172,7 +172,7 @@ func GenerateRandomPin() string { return s } -// GetRandomName returns mnemoicoded random name +// GetRandomName returns mnemonicoded random name func GetRandomName() string { var result []string bs := make([]byte, 4)