celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] Oipo commented on a change in pull request #315: Adds test and improvements for remote service calls for large payloads
Date Thu, 28 Jan 2021 12:05:29 GMT

Oipo commented on a change in pull request #315:
URL: https://github.com/apache/celix/pull/315#discussion_r566041648

File path: bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
@@ -505,7 +507,24 @@ static int remoteServiceAdmin_callback(struct mg_connection *conn) {
             if (rc == CELIX_SUCCESS && response != NULL) {
                 mg_write(conn, data_response_headers, strlen(data_response_headers));
-                mg_write(conn, response, strlen(response));
+                char *bufLoc = response;
+                size_t bytesLeft = strlen(response);
+                if (bytesLeft > INT_MAX) {
+                    //NOTE arcording to civetweb mg_write, there is a limit on mg_write for
+                    RSA_LOG_WARNING(rsa, "nr of bytes to send for a remote call is > INT_MAX,
this can lead to issues\n");
+                }
+                while (bytesLeft > 0) {
+                    int send = mg_write(conn, response, strlen(response));

Review comment:
       Probably because you're testing locally. This then bypasses the kernel's TCP stack.
To truly test it, you need to have two separate devices connected to each other.

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:

View raw message