TraceProcessor: don't close the connection after /rpc requests
This bug was introduced in the refactoring aosp/1883828. The previous
code was not closing the connection after each /rpc request. Doing
that defeats the whole point of a keep-alive connection.
Test: manual (no more "[HTTP] New connection" seen in the logs
when using trace_processor --httpd and ui.perfetto.dev)
Change-Id: If591a555aa48464be49715e3fce5003c620861da
diff --git a/CHANGELOG b/CHANGELOG
index c931c67..710d3c9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,13 +2,16 @@
Tracing service and probes:
*
Trace Processor:
- * The argument for the trace path in constructor of TraceProcessor
- in the Python API taks |trace| is renamed from |file_path| to |trace|.
+ * Changed the argument for the trace path in constructor of TraceProcessor
+ in the Python API from |file_path| to |trace|.
|file_path| is deprecated and may be removed in the future.
- * The Python API now takes a TraceProcessorConfig in the constructor
+ * Changed the Python API constructor. Now it takes a TraceProcessorConfig
instead of passing parameters directly. This may break existing code
but migration should be trivial (all current options are still
supported).
+ * Fixed a HTTP keepalive bug in trace_processor --httpd. The bug, introduced
+ in v22.0, caused each RPC request to close the connection, effectively
+ defeating the 'Connection: Keep-Alive', after each query made by the UI.
UI:
*
SDK:
diff --git a/src/trace_processor/rpc/httpd.cc b/src/trace_processor/rpc/httpd.cc
index 72c0f12..7b467a6 100644
--- a/src/trace_processor/rpc/httpd.cc
+++ b/src/trace_processor/rpc/httpd.cc
@@ -169,7 +169,6 @@
// Terminate chunked stream.
conn.SendResponseBody("0\r\n\r\n", 5);
- conn.Close();
return;
}