file stuff ready
This commit is contained in:
parent
3ad69817e5
commit
11f8874d20
|
|
@ -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…
Reference in New Issue