mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
file stuff ready
This commit is contained in:
parent
0bf384dd82
commit
98374c31cd
2 changed files with 13 additions and 0 deletions
|
@ -204,6 +204,15 @@ func (c *Croc) processState(ws *websocket.Conn, cd channelData) (err error) {
|
|||
c.cs.channel.Update = false
|
||||
}
|
||||
}
|
||||
if c.cs.channel.Role == 0 && c.cs.channel.Pake.IsVerified() {
|
||||
go func() {
|
||||
// encrypt the files
|
||||
// TODO
|
||||
c.cs.Lock()
|
||||
c.cs.channel.fileReady = true
|
||||
c.cs.Unlock()
|
||||
}()
|
||||
}
|
||||
|
||||
// TODO
|
||||
// process the client state
|
||||
|
@ -277,6 +286,9 @@ func (c *Croc) dialUp() (err error) {
|
|||
for {
|
||||
c.cs.RLock()
|
||||
ready := c.cs.channel.TransferReady
|
||||
if role == 0 {
|
||||
ready = ready && c.cs.channel.fileReady
|
||||
}
|
||||
c.cs.RUnlock()
|
||||
if ready {
|
||||
break
|
||||
|
|
|
@ -103,6 +103,7 @@ type channelData struct {
|
|||
// sessionKey
|
||||
sessionKey []byte
|
||||
isReady bool
|
||||
fileReady bool
|
||||
|
||||
// relay parameters
|
||||
// isopen determine whether or not the channel has been opened
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue