summaryrefslogtreecommitdiff
path: root/http/http_client.hpp
diff options
context:
space:
mode:
authorAppaRao Puli <apparao.puli@linux.intel.com>2021-03-16 18:37:24 +0300
committerEd Tanous <ed@tanous.net>2023-06-05 21:49:47 +0300
commit5e44e3d85bae016c7ccc27e9ee65627919a51898 (patch)
tree07ba489a6b12673f06e80e42db49777f0cc2e768 /http/http_client.hpp
parentc9374ff613b6836010877f8083e75657abc78343 (diff)
downloadbmcweb-5e44e3d85bae016c7ccc27e9ee65627919a51898.tar.xz
Add SSE style subscription support to eventservice
This commit adds the SSE style eventservice subscription style event Using this, end user can subscribe for Redfish event logs using GET on SSE uris from browser. Tested: - From Browser did GET on above SSE URI and generated some Redfish event logs(power cycle) and saw redfish event logs streaming on browser. - After SSE registration, Check Subscription collections and GET on individual subscription and saw desired response. - Ran RedfishValidation and its passed. Change-Id: I7f4b7a34974080739c4ba968ed570489af0474de Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'http/http_client.hpp')
-rw-r--r--http/http_client.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 7a98b54497..dea4d50c67 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -710,7 +710,7 @@ class ConnectionPool : public std::enable_shared_from_this<ConnectionPool>
}
}
- void sendData(std::string& data, const std::string& destUri,
+ void sendData(std::string&& data, const std::string& destUri,
const boost::beast::http::fields& httpHeader,
const boost::beast::http::verb verb,
const std::function<void(Response&)>& resHandler)
@@ -866,19 +866,19 @@ class HttpClient
// Send a request to destIP:destPort where additional processing of the
// result is not required
- void sendData(std::string& data, const std::string& destIP,
+ void sendData(std::string&& data, const std::string& destIP,
uint16_t destPort, const std::string& destUri, bool useSSL,
const boost::beast::http::fields& httpHeader,
const boost::beast::http::verb verb)
{
const std::function<void(Response&)> cb = genericResHandler;
- sendDataWithCallback(data, destIP, destPort, destUri, useSSL,
+ sendDataWithCallback(std::move(data), destIP, destPort, destUri, useSSL,
httpHeader, verb, cb);
}
// Send request to destIP:destPort and use the provided callback to
// handle the response
- void sendDataWithCallback(std::string& data, const std::string& destIP,
+ void sendDataWithCallback(std::string&& data, const std::string& destIP,
uint16_t destPort, const std::string& destUri,
bool useSSL,
const boost::beast::http::fields& httpHeader,
@@ -897,7 +897,7 @@ class HttpClient
}
// Send the data using either the existing connection pool or the newly
// created connection pool
- pool.first->second->sendData(data, destUri, httpHeader, verb,
+ pool.first->second->sendData(std::move(data), destUri, httpHeader, verb,
resHandler);
}
};