hot fix: close client on verifying connection (will keep client open)

This commit is contained in:
Cedric Verstraeten
2024-01-03 22:02:44 +01:00
parent e74d2aadb5
commit 3ae43eba16

View File

@@ -564,6 +564,8 @@ func VerifyCamera(c *gin.Context) {
} }
} }
err := rtspClient.Close()
if err == nil {
if videoIdx > -1 { if videoIdx > -1 {
c.JSON(200, models.APIResponse{ c.JSON(200, models.APIResponse{
Message: "All good, detected a H264 codec.", Message: "All good, detected a H264 codec.",
@@ -574,7 +576,11 @@ func VerifyCamera(c *gin.Context) {
Message: "Stream doesn't have a H264 codec, we only support H264 so far.", Message: "Stream doesn't have a H264 codec, we only support H264 so far.",
}) })
} }
} else {
c.JSON(400, models.APIResponse{
Message: "Something went wrong while closing the connection " + err.Error(),
})
}
} else { } else {
c.JSON(400, models.APIResponse{ c.JSON(400, models.APIResponse{
Message: err.Error(), Message: err.Error(),