App 2.41.0, server 2.9.0: recordings reach the server
A finished signal recording goes to an outbox and is sent gzipped with
the car's token (PUT /v1/logs/{name}); the service retries every 2
minutes while the car is offline. The server keeps the newest 200 on a
new volume (LOGS_DIR); reading takes a token of its own (LOGS_TOKEN).
fetch-logs in the dev shell fetches new ones into logs/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -59,6 +59,12 @@ final class ServerHttp {
|
||||
*/
|
||||
static Response send(String method, String url, String authorization, String contentType, byte[] body)
|
||||
throws Exception {
|
||||
return send(method, url, authorization, contentType, null, body);
|
||||
}
|
||||
|
||||
/** As above, with a {@code Content-Encoding} ({@code "gzip"}) for the body, or null. */
|
||||
static Response send(String method, String url, String authorization, String contentType,
|
||||
String contentEncoding, byte[] body) throws Exception {
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
||||
try {
|
||||
connection.setRequestMethod(method);
|
||||
@@ -69,6 +75,7 @@ final class ServerHttp {
|
||||
connection.setDoOutput(true);
|
||||
connection.setFixedLengthStreamingMode(body.length);
|
||||
connection.setRequestProperty("Content-Type", contentType);
|
||||
if (contentEncoding != null) connection.setRequestProperty("Content-Encoding", contentEncoding);
|
||||
try (OutputStream out = connection.getOutputStream()) { out.write(body); }
|
||||
}
|
||||
int status = connection.getResponseCode();
|
||||
|
||||
Reference in New Issue
Block a user