@@ -5,6 +5,7 @@ import "log"
55import "lbry/daemon/blob"
66import "lbry/daemon/dht"
77import "net/http"
8+ import "runtime/debug"
89import "strconv"
910import "strings"
1011import "sync"
@@ -40,12 +41,16 @@ func (m *Manager) GetStreamingURL(sdHash string, port int) string {
4041}
4142
4243func (m * Manager ) handleStream (w http.ResponseWriter , r * http.Request ) {
44+ fmt .Println ("Incoming stream request" )
45+
4346 sdHash := strings .TrimPrefix (r .URL .Path , "/stream/" )
4447 if sdHash == "" || len (sdHash ) != blob .BlobHashLength {
4548 http .Error (w , "invalid sd_hash" , http .StatusBadRequest )
4649 return
4750 }
4851
52+ info , _ := debug .ReadBuildInfo ()
53+
4954 // CORS for frontend
5055 w .Header ().Set ("Access-Control-Allow-Origin" , "*" )
5156 w .Header ().Set ("Access-Control-Allow-Headers" , "Range" )
@@ -153,12 +158,12 @@ func (m *Manager) handleStream(w http.ResponseWriter, r *http.Request) {
153158}
154159
155160func (m * Manager ) getDescriptor (sdHash string ) (* blob.StreamDescriptor , error ) {
156- m .sdCacheMu .RLock ()
161+ // m.sdCacheMu.RLock()
157162 if sd , ok := m .sdCache [sdHash ]; ok {
158- m .sdCacheMu .RUnlock ()
163+ // m.sdCacheMu.RUnlock()
159164 return sd , nil
160165 }
161- m .sdCacheMu .RUnlock ()
166+ // m.sdCacheMu.RUnlock()
162167
163168 // Download SD blob from peers
164169 sdData , err := m .downloadBlob (sdHash )
@@ -171,9 +176,9 @@ func (m *Manager) getDescriptor(sdHash string) (*blob.StreamDescriptor, error) {
171176 return nil , err
172177 }
173178
174- m .sdCacheMu .Lock ()
179+ // m.sdCacheMu.Lock()
175180 m .sdCache [sdHash ] = sd
176- m .sdCacheMu .Unlock ()
181+ // m.sdCacheMu.Unlock()
177182 return sd , nil
178183}
179184
0 commit comments