--- a/src/HTTPDHandler.h Sat Apr 16 02:43:50 2022 +0200
+++ b/src/HTTPDHandler.h Thu Apr 21 00:23:08 2022 +0200
@@ -53,7 +53,6 @@
std::shared_ptr<HTTPServer> httpServer;
relpipe::common::type::StringX currentRelationName;
std::vector<relpipe::reader::handlers::AttributeMetadata> currentReaderMetadata;
- std::vector<relpipe::writer::AttributeMetadata> currentWriterMetadata;
size_t currentAttributeIndex = 0;
size_t currentRecordNumber = 1;
@@ -113,7 +112,7 @@
void writeExchange(const HTTPServer::Request& request, const HTTPServer::Response& response) {
std::wstring_convert < codecvt_utf8<wchar_t>> convertor; // TODO: support also other encoding than UTF-8
std::lock_guard<std::mutex> lock(*relationalWriterMutex);
-
+
auto exchangeId = convertor.from_bytes(generateExchangeId());
@@ -125,27 +124,37 @@
// TODO: support multiple encodings
relationalWriter->startRelation(L"exchange",{
+ // TODO: timestamp
+ // TODO: ordinal number?
{L"id", relpipe::writer::TypeId::STRING},
{L"url", relpipe::writer::TypeId::STRING},
{L"method", relpipe::writer::TypeId::STRING},
{L"request_text", relpipe::writer::TypeId::STRING},
{L"request_data", relpipe::writer::TypeId::STRING},
+ {L"request_size", relpipe::writer::TypeId::INTEGER},
{L"response_text", relpipe::writer::TypeId::STRING},
{L"response_data", relpipe::writer::TypeId::STRING},
+ {L"response_size", relpipe::writer::TypeId::INTEGER},
{L"response_code", relpipe::writer::TypeId::INTEGER},
}, true);
+ relpipe::common::type::Integer requestSize = request.body.size();
+ relpipe::common::type::Integer responseSize = response.body.size();
+
relationalWriter->writeAttribute(exchangeId);
relationalWriter->writeAttribute(convertor.from_bytes(request.url));
relationalWriter->writeAttribute(convertor.from_bytes(request.method));
relationalWriter->writeAttribute(bodyToText(convertor, request.body));
relationalWriter->writeAttribute(bodyToHex(convertor, request.body));
+ relationalWriter->writeAttribute(&requestSize, typeid (requestSize));
relationalWriter->writeAttribute(bodyToText(convertor, response.body));
relationalWriter->writeAttribute(bodyToHex(convertor, response.body));
+ relationalWriter->writeAttribute(&responseSize, typeid (responseSize));
relationalWriter->writeAttribute(std::to_wstring(response.code));
relationalWriter->startRelation(L"header",{
+ // TODO: ordinal number?
{L"exchange", relpipe::writer::TypeId::STRING},
{L"url", relpipe::writer::TypeId::STRING},
{L"direction", relpipe::writer::TypeId::STRING},