[no Bug] Denial of Service possible in ResourceAccessModule (1 Viewer)

McGoober

Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    Home Country
    United Kingdom United Kingdom
    Last night I was attempting to play a media file from the ResourceAccessModule, but after 3 mins of video, MediaPortal stopped streaming content. After a debug, I found that I had loads of threads all trying to stream to my device but stuck in a loop with the program taking loads of CPU. They were all in the while loop in ResourceAccessModule.Send(). Each call to IHttpResponse.SendBody() was eventually resulting in a call to Source/Core/HttpServer/HttpClientContext.Send() line 428. This function catches an IOException, but does nothing to it. Meaning that if something went wrong with the socket comms and the OS caused an exception to be thrown the code was forgetting about it and carrying on with the transmission until all threads in the thread pool were used. I tried commenting out the try/catch in this function, and everything worked as expected and I was able to watch a video for 40 mins uninterrupted. I'm not sure why one would need to disregard an exception in this way, so I guess it should be removed.

    Interestingly once the program functioned correctly I was getting a whole load of exceptions being logged about the client (my device) closing the socket connection. This could be an implementation problem with the video player for by device, but still it managed a denial of service.
     

    Users who are viewing this thread

    Top Bottom