aboutsummaryrefslogtreecommitdiff
path: root/content.go
diff options
context:
space:
mode:
Diffstat (limited to 'content.go')
-rw-r--r--content.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/content.go b/content.go
index 890e571..77a58f6 100644
--- a/content.go
+++ b/content.go
@@ -77,6 +77,18 @@ func handleContent(cc *contentConn) {
defer close(cc.doneCh)
go func() {
+ init := make(chan struct{})
+ defer close(init)
+
+ go func(init <-chan struct{}) {
+ select {
+ case <-init:
+ case <-time.After(10 * time.Second):
+ cc.log("-->", "timeout")
+ cc.Close()
+ }
+ }(init)
+
for cc.state() == csCreated {
cc.SendCmd(&mt.ToSrvInit{
SerializeVer: latestSerializeVer,