Skip to content

Commit

Permalink
feat: add transfer start UI message
Browse files Browse the repository at this point in the history
  • Loading branch information
ZinoKader committed Feb 6, 2023
1 parent c5f3e43 commit 0b02380
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions internal/sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,20 @@ func SecureConnection(rc conn.Rendezvous, password string) (conn.Transfer, error
return conn.TransferFromSession(rc.Conn, session, salt), nil
}

// Transfer preforms the file transfer, either directly or using the Rendezvous server as a relay.
// Transfer performs the file transfer, either directly or using the Rendezvous server as a relay.
func Transfer(tc conn.Transfer, payload io.Reader, payloadSize int64, msgs ...chan interface{}) error {
return doTransfer(tc, payload, payloadSize, msgs...)
}

// transferSequence is a helper method that actually preforms the transfer sequence.
// transferSequence is a helper method that actually performs the transfer sequence.
func transferSequence(tc conn.Transfer, payload io.Reader, payloadSize int64, msgs ...chan interface{}) error {
_, err := tc.ReadMsg(transfer.ReceiverRequestPayload)
if err != nil {
return err
}

msgs[0] <- transfer.ReceiverRequestPayload

if err := transferPayload(tc, payload, payloadSize, msgs...); err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion internal/sender/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/SpatiumPortae/portal/protocol/transfer"
)

// doTransfer preforms the file transfer, either directly or using the Rendezvous server as a relay.
// doTransfer performs the file transfer, either directly or using the Rendezvous server as a relay.
// This version is built for other platforms other than js (wasm)
func doTransfer(tc conn.Transfer, payload io.Reader, payloadSize int64, msgs ...chan interface{}) error {
_, err := tc.ReadMsg(transfer.ReceiverHandshake)
Expand Down Expand Up @@ -88,6 +88,7 @@ func doTransfer(tc conn.Transfer, payload io.Reader, payloadSize int64, msgs ...
Got: msg.Type}
}
}

func getLocalIP() (net.IP, error) {
addrs, err := net.InterfaceAddrs()
if err != nil {
Expand Down

0 comments on commit 0b02380

Please sign in to comment.