|
|
@@ -350,13 +350,16 @@ esp_err_t handler_stream(httpd_req_t *req)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Camera.CaptureToStream(req, flashlightOn);
|
|
|
+ // Closing the browser popup makes the next stream send fail. Propagate
|
|
|
+ // that error so esp_http_server closes the client session instead of
|
|
|
+ // treating the interrupted stream as a reusable successful connection.
|
|
|
+ const esp_err_t streamResult = Camera.CaptureToStream(req, flashlightOn);
|
|
|
|
|
|
#ifdef DEBUG_DETAIL_ON
|
|
|
LogFile.WriteHeapInfo("handler_stream - Done");
|
|
|
#endif
|
|
|
|
|
|
- return ESP_OK;
|
|
|
+ return streamResult;
|
|
|
}
|
|
|
|
|
|
esp_err_t handler_flow_start(httpd_req_t *req)
|