Simplify tcpip_get a bit YAZ-831
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 13 Mar 2015 10:12:29 +0000 (11:12 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 13 Mar 2015 10:12:29 +0000 (11:12 +0100)
src/tcpip.c

index 896eaf3..e0165b1 100644 (file)
@@ -1185,7 +1185,6 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize)
                     break;
                 return -1;
             }
                     break;
                 return -1;
             }
-            hasread += res;
         }
         else
 #endif
         }
         else
 #endif
@@ -1238,9 +1237,9 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize)
             }
             else if (!res)
                 return hasread;
             }
             else if (!res)
                 return hasread;
-            hasread += res;
 #endif
         }
 #endif
         }
+        hasread += res;
         if (hasread > h->max_recv_bytes)
         {
             h->cerrno = CSBUFSIZE;
         if (hasread > h->max_recv_bytes)
         {
             h->cerrno = CSBUFSIZE;