mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
debugging
This commit is contained in:
parent
a0c99e7251
commit
63b3e49dfa
3 changed files with 4 additions and 0 deletions
|
@ -405,6 +405,7 @@ func (c *Client) processMessage(m Message) (err error) {
|
|||
pathToFile := path.Join(c.FilesToTransfer[c.FilesToTransferCurrentNum].FolderSource, c.FilesToTransfer[c.FilesToTransferCurrentNum].Name)
|
||||
c.sendSess.TransferFile(pathToFile)
|
||||
case "close-sender":
|
||||
log.Debug("close-sender received...")
|
||||
c.Step4FileTransfer = false
|
||||
c.Step3RecipientRequestFile = false
|
||||
c.sendSess.StopSending()
|
||||
|
|
|
@ -166,6 +166,7 @@ func (s *Session) receiveData(pathToFile string, fileSize int64) error {
|
|||
case <-s.sess.Done:
|
||||
s.sess.NetworkStats.Stop()
|
||||
log.Debugf("Network: %s", s.sess.NetworkStats.String())
|
||||
log.Debug("closed gracefully")
|
||||
return nil
|
||||
case msg := <-s.msgChannel:
|
||||
buff, errDecrypt := crypt.DecryptFromBytes(msg.Data, []byte{1, 2, 3, 4})
|
||||
|
@ -177,6 +178,7 @@ func (s *Session) receiveData(pathToFile string, fileSize int64) error {
|
|||
pos := int64(binary.LittleEndian.Uint64(buff[:8]))
|
||||
n, err := f.WriteAt(buff[8:], pos)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return err
|
||||
} else {
|
||||
if firstByte {
|
||||
|
|
|
@ -271,6 +271,7 @@ func (s *Session) writeToNetwork() {
|
|||
}
|
||||
|
||||
func (s *Session) StopSending() {
|
||||
log.Debug("StopSending() triggered")
|
||||
s.stopSending <- struct{}{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue