arpadboda commented on a change in pull request #560: MINIFICPP-852: Add 
details to restful response. CoAP will not include…
URL: https://github.com/apache/nifi-minifi-cpp/pull/560#discussion_r285500460
 
 

 ##########
 File path: extensions/http-curl/tests/C2FailedUpdateTest.cpp
 ##########
 @@ -57,8 +58,30 @@ class ConfigHandler : public CivetHandler {
   ConfigHandler() {
     calls_ = 0;
   }
-  bool handlePost(CivetServer *server, struct mg_connection *conn) {
+  virtual bool handlePost(CivetServer *server, struct mg_connection *conn) 
override {
     calls_++;
+    const struct mg_request_info *req_info = mg_get_request_info(conn);
+    long long remainlen;
+    long long readlen = 0;
+    long long contentlen = req_info->content_length;
+    char buf[1024];
+
+    std::string data;
+    while (readlen < contentlen) {
+      remainlen = contentlen - readlen;
+      if (remainlen > sizeof(buf)) {
+        remainlen = sizeof(buf);
+      }
+      remainlen = mg_read(conn, buf, (size_t) contentlen);
 
 Review comment:
   I think this was meant to be:
   ```
         remainlen = mg_read(conn, buf, (size_t) remainlen);
         if (remainlen <= 0) {
           break;
         }
         readlen += remainlen;
   ```

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


With regards,
Apache Git Services

Reply via email to