File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 44 "context"
55 "encoding/json"
66 "fmt"
7+ "log"
78 "net/http"
89 "net/http/httptest"
910 "net/url"
@@ -364,7 +365,11 @@ func (s *SSEServer) handleMessage(w http.ResponseWriter, r *http.Request) {
364365
365366 // Only send response if there is one (not for notifications)
366367 if response != nil {
367- eventData , _ := json .Marshal (response )
368+ eventData , err := json .Marshal (response )
369+ if err != nil {
370+ s .writeJSONRPCError (w , nil , mcp .INTERNAL_ERROR , "Fail to marshal response" )
371+ return
372+ }
368373
369374 // Queue the event for sending via SSE
370375 select {
@@ -373,7 +378,8 @@ func (s *SSEServer) handleMessage(w http.ResponseWriter, r *http.Request) {
373378 case <- session .done :
374379 // Session is closed, don't try to queue
375380 default :
376- // Queue is full, could log this
381+ // Queue is full, log this situation
382+ log .Printf ("Event queue full for session %s" , sessionID )
377383 }
378384 }
379385 }()
You can’t perform that action at this time.
0 commit comments