adamdebreceni commented on a change in pull request #957:
URL: https://github.com/apache/nifi-minifi-cpp/pull/957#discussion_r551922177



##########
File path: extensions/http-curl/tests/HTTPHandlers.h
##########
@@ -447,35 +447,43 @@ class HeartbeatHandler : public ServerAwareHandler {
   }
 };
 
-class C2UpdateHandler : public ServerAwareHandler {
+class C2FlowProvider : public ServerAwareHandler {
  public:
-  explicit C2UpdateHandler(const std::string& test_file_location)
-    : test_file_location_(test_file_location) {
+  explicit C2FlowProvider(const std::string& test_file_location)
+      : test_file_location_(test_file_location) {
   }
 
-  bool handlePost(CivetServer *server, struct mg_connection *conn) override {
-    calls_++;
-    if (!response_.empty()) {
+  bool handleGet(CivetServer *server, struct mg_connection *conn) override {
+    std::ifstream myfile(test_file_location_.c_str(), std::ios::in | 
std::ios::binary);
+    if (myfile.good()) {
+      std::string str((std::istreambuf_iterator<char>(myfile)), 
(std::istreambuf_iterator<char>()));
       mg_printf(conn, "HTTP/1.1 200 OK\r\nContent-Type: "
-                "text/plain\r\nContent-Length: %lu\r\nConnection: 
close\r\n\r\n",
-                response_.length());
-      mg_printf(conn, "%s", response_.c_str());
-      response_.clear();
+                      "text/plain\r\nContent-Length: %lu\r\nConnection: 
close\r\n\r\n",
+                str.length());
+      mg_printf(conn, "%s", str.c_str());
     } else {
       mg_printf(conn, "HTTP/1.1 500 Internal Server Error\r\n");
     }
 
     return true;
   }
 
-  bool handleGet(CivetServer *server, struct mg_connection *conn) override {
-    std::ifstream myfile(test_file_location_.c_str(), std::ios::in | 
std::ios::binary);
-    if (myfile.good()) {
-      std::string str((std::istreambuf_iterator<char>(myfile)), 
(std::istreambuf_iterator<char>()));
+ private:
+  std::string test_file_location_;

Review comment:
       made it const




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to