mirror of
https://github.com/kerberos-io/agent.git
synced 2025-10-25 17:20:21 +08:00
hot fix: close client on verifying connection (will keep client open)
This commit is contained in:
@@ -564,17 +564,23 @@ func VerifyCamera(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if videoIdx > -1 {
|
err := rtspClient.Close()
|
||||||
c.JSON(200, models.APIResponse{
|
if err == nil {
|
||||||
Message: "All good, detected a H264 codec.",
|
if videoIdx > -1 {
|
||||||
Data: streams,
|
c.JSON(200, models.APIResponse{
|
||||||
})
|
Message: "All good, detected a H264 codec.",
|
||||||
|
Data: streams,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
c.JSON(400, models.APIResponse{
|
||||||
|
Message: "Stream doesn't have a H264 codec, we only support H264 so far.",
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
c.JSON(400, models.APIResponse{
|
c.JSON(400, models.APIResponse{
|
||||||
Message: "Stream doesn't have a H264 codec, we only support H264 so far.",
|
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(),
|
||||||
|
|||||||
Reference in New Issue
Block a user