celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] mdelangthales commented on a change in pull request #159: Feature/slow rsa
Date Wed, 04 Mar 2020 09:24:41 GMT
mdelangthales commented on a change in pull request #159: Feature/slow rsa
URL: https://github.com/apache/celix/pull/159#discussion_r387540164
 
 

 ##########
 File path: bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
 ##########
 @@ -760,35 +761,37 @@ static celix_status_t remoteServiceAdmin_send(void *handle, endpoint_description
     return status;
 }
 
-static size_t remoteServiceAdmin_readCallback(void *ptr, size_t size, size_t nmemb, void
*userp) {
+static size_t remoteServiceAdmin_readCallback(void *voidBuffer, size_t size, size_t nmemb,
void *userp) {
     struct post *post = userp;
+    char *buffer = voidBuffer;
 
-    if (post->size) {
-        *(char *) ptr = post->readptr[0];
-        post->readptr++;
-        post->size--;
-        return 1;
+    if (post->read == post->size) {
+        return 0;
+    } else {
+        size_t buffSize = size * nmemb;
+        size_t startRead = post->read;
+        for (size_t i = 0; i < buffSize && post->size != post->read; ++i)
{
 
 Review comment:
   Potential optimisation: manual loop unrolling

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message