Skip to content
Snippets Groups Projects
Commit 41a135fc authored by Jono Wenger's avatar Jono Wenger
Browse files

add logging

parent 0bcf1292
No related branches found
No related tags found
1 merge request!430XX-4277 / Fix file transfer crashes
......@@ -167,11 +167,13 @@ func InitFileTransfer(e2eID int, receiveFileCallback ReceiveFileCallback,
return nil, err
}
jww.INFO.Printf("[FT] Before AddService")
// Add file transfer processes to API services tracking
err = user.api.AddService(m.StartProcesses)
if err != nil {
return nil, err
}
jww.INFO.Printf("[FT] After AddService")
// Return wrapped manager
return &FileTransfer{w: w}, nil
......
......@@ -64,11 +64,15 @@ func (sw *Switchboard) RegisterListener(user *id.ID,
}
//register the listener by both ID and messageType
jww.INFO.Printf("** Before Mux")
sw.mux.Lock()
jww.INFO.Printf("** Before ID Add")
sw.id.Add(lid)
jww.INFO.Printf("** Before messageType Add")
sw.messageType.Add(lid)
jww.INFO.Printf("** Before Mux unlock")
sw.mux.Unlock()
//return a ListenerID so it can be unregistered in the future
......
......@@ -65,6 +65,8 @@ func NewWrapper(receiveCB ft.ReceiveCallback, p Params, ft ft.FileTransfer,
// Register listener to receive new file transfers
w.e2e.RegisterListener(&id.ZeroUser, catalog.NewFileTransfer, &listener{w})
jww.INFO.Printf("[FT] after RegisterListener")
return w, nil
}
......
......@@ -414,6 +414,7 @@ func (c *Cmix) GetRoundEvents() interfaces.RoundEvents {
// AddService adds a service to be controlled by the client thread control.
// These will be started and stopped with the network follower.
func (c *Cmix) AddService(sp Service) error {
jww.INFO.Printf("** Before followerServices.add")
return c.followerServices.add(sp)
}
......
......@@ -9,6 +9,7 @@ package xxdk
import (
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/stoppable"
"sync"
"time"
......@@ -38,18 +39,23 @@ func newServices() *services {
// add appends the service process to the list and adds it to the multi-
// stoppable. Start running it if services are running.
func (s *services) add(sp Service) error {
jww.INFO.Printf("** Before services.mux.Lock")
s.mux.Lock()
defer s.mux.Unlock()
// append the process to the list
jww.INFO.Printf("** Before services append")
s.services = append(s.services, sp)
// if services are running, start the process
jww.INFO.Printf("** Before s.state == Running")
if s.state == Running {
jww.INFO.Printf("** Call service")
stop, err := sp()
if err != nil {
return errors.WithMessage(err, "Failed to start added service")
}
jww.INFO.Printf("** Call stoppable Add")
s.stoppable.Add(stop)
}
return nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment