aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-07-20 20:41:02 -0500
committerJP Dillingham <jp@dillingham.me>2022-07-20 20:41:02 -0500
commitd52ec889fcf717014e7b29359e56ff15eabd0077 (patch)
treeb1d2ab3560ecbaba669352f411563ab2d6b58ecd /src
parent2d4a7934831c791cfceb1ec7a37a39d4824aeca1 (diff)
downloadslskd-d52ec889fcf717014e7b29359e56ff15eabd0077.tar.gz
add endpoint for memory dumps
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs10
1 files changed, 10 insertions, 0 deletions
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<IActionResult> DumpMemory()
+ {
+ using var dumper = new Dumper();
+ var file = await dumper.DumpAsync();
+
+ return PhysicalFile(file, "application/octet-stream", "slskd.dmp");
+ }
}
}