Don't call Terminate if we aren't connected. Spacing

pull/3506/head
Isaac Connor 2022-06-08 16:46:16 -04:00
parent ac763ac7f9
commit 11337eb2d3
1 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ RemoteCameraHttp::RemoteCameraHttp(
}
RemoteCameraHttp::~RemoteCameraHttp() {
if ( capture ) {
if (capture and (sd != -1)) {
Terminate();
}
}
@ -854,9 +854,9 @@ int RemoteCameraHttp::GetResponse() {
while (!zm_terminate) {
int crlf_len = memspn(subheader_ptr, "\r\n", subheader_len);
if (n_subheaders) {
if ( (crlf_len == 2 && !strncmp(subheader_ptr, "\n\n", crlf_len))
if ((crlf_len == 2 && !strncmp(subheader_ptr, "\n\n", crlf_len))
||
(crlf_len == 4 && !strncmp( subheader_ptr, "\r\n\r\n", crlf_len ))
(crlf_len == 4 && !strncmp(subheader_ptr, "\r\n\r\n", crlf_len))
) {
*subheader_ptr = '\0';
subheader_ptr += crlf_len;