You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/08/11 12:32:15 UTC
[GitHub] [trafficserver] traeak commented on a change in pull request #8204: transaction data sink: only stream body bytes
traeak commented on a change in pull request #8204:
URL: https://github.com/apache/trafficserver/pull/8204#discussion_r686784915
##########
File path: example/plugins/c-api/txn_data_sink/txn_data_sink.cc
##########
@@ -28,89 +28,97 @@
limitations under the License.
*/
-#include <stdio.h>
-#include <unistd.h>
#include <ts/ts.h>
-// This gets the PRI*64 types
-#define __STDC_FORMAT_MACROS 1
-#include <inttypes.h>
+#include <string>
+#include <string_view>
-#define PLUGIN_NAME "txn_data_sink"
-#define PCP "[" PLUGIN_NAME "] "
-
-// Activate the data sink if this field is present in the request.
-static const char FLAG_MIME_FIELD[] = "TS-Agent";
-static size_t const FLAG_MIME_LEN = sizeof(FLAG_MIME_FIELD) - 1;
-
-typedef struct {
- int64_t total;
-} SinkData;
+namespace
+{
+std::string const PLUGIN_NAME = "txn_data_sink";
Review comment:
Since these are used with a 'c' api it might be best to keep these as constexpr char const *const. The std::string implies that these values will end up in the heap.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org