From d52ec889fcf717014e7b29359e56ff15eabd0077 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 20 Jul 2022 20:41:02 -0500 Subject: add endpoint for memory dumps --- src/slskd/Core/API/Controllers/ApplicationController.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/slskd/Core/API/Controllers/ApplicationController.cs') diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index 3cf3c0a3..ac8be802 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -136,5 +136,15 @@ namespace slskd.Core.API return Ok(); } + + [HttpGet("dump")] + [Authorize] + public async Task DumpMemory() + { + using var dumper = new Dumper(); + var file = await dumper.DumpAsync(); + + return PhysicalFile(file, "application/octet-stream", "slskd.dmp"); + } } } -- cgit v1.2.3