mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
Fix Typos (revised)
This commit fixes spelling mistakes (typos) at a few places in the codebase. (Includes requested corrections)
This commit is contained in:
parent
696479024e
commit
2964ede174
4 changed files with 19 additions and 19 deletions
|
@ -459,7 +459,7 @@ func receive(c *cli.Context) (err error) {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// update anything that isn't expliciGlobalIsSettly set
|
// update anything that isn't explicitly Globally set
|
||||||
if !c.IsSet("relay") && rememberedOptions.RelayAddress != "" {
|
if !c.IsSet("relay") && rememberedOptions.RelayAddress != "" {
|
||||||
crocOptions.RelayAddress = rememberedOptions.RelayAddress
|
crocOptions.RelayAddress = rememberedOptions.RelayAddress
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ type Client struct {
|
||||||
|
|
||||||
// steps involved in forming relationship
|
// steps involved in forming relationship
|
||||||
Step1ChannelSecured bool
|
Step1ChannelSecured bool
|
||||||
Step2FileInfoTransfered bool
|
Step2FileInfoTransferred bool
|
||||||
Step3RecipientRequestFile bool
|
Step3RecipientRequestFile bool
|
||||||
Step4FileTransfer bool
|
Step4FileTransfer bool
|
||||||
Step5CloseChannels bool
|
Step5CloseChannels bool
|
||||||
|
@ -103,7 +103,7 @@ type Client struct {
|
||||||
LastFolder string
|
LastFolder string
|
||||||
|
|
||||||
TotalSent int64
|
TotalSent int64
|
||||||
TotalChunksTransfered int
|
TotalChunksTransferred int
|
||||||
chunkMap map[uint64]struct{}
|
chunkMap map[uint64]struct{}
|
||||||
|
|
||||||
// tcp connections
|
// tcp connections
|
||||||
|
@ -118,7 +118,7 @@ type Client struct {
|
||||||
numfinished int
|
numfinished int
|
||||||
quit chan bool
|
quit chan bool
|
||||||
finishedNum int
|
finishedNum int
|
||||||
numberOfTransferedFiles int
|
numberOfTransferredFiles int
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chunk contains information about the
|
// Chunk contains information about the
|
||||||
|
@ -579,7 +579,7 @@ func (c *Client) Receive() (err error) {
|
||||||
address := net.JoinHostPort(discoveries[i].Address, portToUse)
|
address := net.JoinHostPort(discoveries[i].Address, portToUse)
|
||||||
errPing := tcp.PingServer(address)
|
errPing := tcp.PingServer(address)
|
||||||
if errPing == nil {
|
if errPing == nil {
|
||||||
log.Debugf("succesfully pinged '%s'", address)
|
log.Debugf("successfully pinged '%s'", address)
|
||||||
c.Options.RelayAddress = address
|
c.Options.RelayAddress = address
|
||||||
c.ExternalIPConnected = c.Options.RelayAddress
|
c.ExternalIPConnected = c.Options.RelayAddress
|
||||||
c.Options.RelayAddress6 = ""
|
c.Options.RelayAddress6 = ""
|
||||||
|
@ -695,7 +695,7 @@ func (c *Client) Receive() (err error) {
|
||||||
fmt.Fprintf(os.Stderr, "\rsecuring channel...")
|
fmt.Fprintf(os.Stderr, "\rsecuring channel...")
|
||||||
err = c.transfer(TransferOptions{})
|
err = c.transfer(TransferOptions{})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if c.numberOfTransferedFiles == 0 {
|
if c.numberOfTransferredFiles == 0 {
|
||||||
fmt.Fprintf(os.Stderr, "\rNo files transferred.")
|
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)
|
fmt.Fprintf(os.Stderr, "\nReceiving (<-%s)\n", c.ExternalIPConnected)
|
||||||
|
|
||||||
log.Debug(c.FilesToTransfer)
|
log.Debug(c.FilesToTransfer)
|
||||||
c.Step2FileInfoTransfered = true
|
c.Step2FileInfoTransferred = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1061,7 +1061,7 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) updateIfSenderChannelSecured() (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
|
var b []byte
|
||||||
machID, _ := machineid.ID()
|
machID, _ := machineid.ID()
|
||||||
b, err = json.Marshal(SenderInfo{
|
b, err = json.Marshal(SenderInfo{
|
||||||
|
@ -1084,7 +1084,7 @@ func (c *Client) updateIfSenderChannelSecured() (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Step2FileInfoTransfered = true
|
c.Step2FileInfoTransferred = true
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1245,7 +1245,7 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) updateIfRecipientHasFileInfo() (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
|
return
|
||||||
}
|
}
|
||||||
// find the next file to transfer and send that number
|
// find the next file to transfer and send that number
|
||||||
|
@ -1272,7 +1272,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
c.numberOfTransferedFiles++
|
c.numberOfTransferredFiles++
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -1310,7 +1310,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) {
|
||||||
if errHash != nil || !bytes.Equal(fileHash, fileInfo.Hash) {
|
if errHash != nil || !bytes.Equal(fileHash, fileInfo.Hash) {
|
||||||
finished = false
|
finished = false
|
||||||
c.FilesToTransferCurrentNum = i
|
c.FilesToTransferCurrentNum = i
|
||||||
c.numberOfTransferedFiles++
|
c.numberOfTransferredFiles++
|
||||||
newFolder, _ := filepath.Split(fileInfo.FolderRemote)
|
newFolder, _ := filepath.Split(fileInfo.FolderRemote)
|
||||||
if newFolder != c.LastFolder && len(c.FilesToTransfer) > 0 {
|
if newFolder != c.LastFolder && len(c.FilesToTransfer) > 0 {
|
||||||
fmt.Fprintf(os.Stderr, "\r%s\n", newFolder)
|
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.bar.Add(len(data[8:]))
|
||||||
c.TotalSent += int64(len(data[8:]))
|
c.TotalSent += int64(len(data[8:]))
|
||||||
c.TotalChunksTransfered++
|
c.TotalChunksTransferred++
|
||||||
// log.Debug(len(c.CurrentFileChunks), c.TotalChunksTransfered, c.TotalSent, c.FilesToTransfer[c.FilesToTransferCurrentNum].Size)
|
// 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
|
c.CurrentFileIsClosed = true
|
||||||
log.Debug("finished receiving!")
|
log.Debug("finished receiving!")
|
||||||
if err := c.CurrentFile.Close(); err != nil {
|
if err := c.CurrentFile.Close(); err != nil {
|
||||||
|
|
|
@ -159,7 +159,7 @@ make_tempdir() {
|
||||||
# DESCRIPTION: Attempts to determin host os using uname
|
# DESCRIPTION: Attempts to determin host os using uname
|
||||||
# PARAMETERS: none
|
# PARAMETERS: none
|
||||||
# RETURNS: 0 = OS Detected. Also prints detected os to stdout
|
# RETURNS: 0 = OS Detected. Also prints detected os to stdout
|
||||||
# 1 = Unkown OS
|
# 1 = Unknown OS
|
||||||
# 20 = 'uname' not found in path
|
# 20 = 'uname' not found in path
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
determine_os() {
|
determine_os() {
|
||||||
|
@ -183,7 +183,7 @@ determine_os() {
|
||||||
# DESCRIPTION: Attempt to determin architecture of host
|
# DESCRIPTION: Attempt to determin architecture of host
|
||||||
# PARAMETERS: none
|
# PARAMETERS: none
|
||||||
# RETURNS: 0 = Arch Detected. Also prints detected arch to stdout
|
# RETURNS: 0 = Arch Detected. Also prints detected arch to stdout
|
||||||
# 1 = Unkown arch
|
# 1 = Unknown arch
|
||||||
# 20 = 'uname' not found in path
|
# 20 = 'uname' not found in path
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
determine_arch() {
|
determine_arch() {
|
||||||
|
@ -238,7 +238,7 @@ download_file() {
|
||||||
#--- FUNCTION ----------------------------------------------------------------
|
#--- FUNCTION ----------------------------------------------------------------
|
||||||
# NAME: checksum_check
|
# NAME: checksum_check
|
||||||
# DESCRIPTION: Attempt to verify checksum of downloaded file to ensure
|
# 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
|
# PARAMETERS: $1 = path to checksum file
|
||||||
# $2 = location of file to check
|
# $2 = location of file to check
|
||||||
# $3 = working directory
|
# $3 = working directory
|
||||||
|
|
|
@ -172,7 +172,7 @@ func GenerateRandomPin() string {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRandomName returns mnemoicoded random name
|
// GetRandomName returns mnemonicoded random name
|
||||||
func GetRandomName() string {
|
func GetRandomName() string {
|
||||||
var result []string
|
var result []string
|
||||||
bs := make([]byte, 4)
|
bs := make([]byte, 4)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue