Fix tcpip.c compilation failure on VC9 YAZ-835
[yaz-moved-to-github.git] / src / tcpip.c
index bea92df..4f4fd48 100644 (file)
@@ -1228,10 +1228,10 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize)
                     h->cerrno = CSYSERR;
                     return -1;
                 }
+#endif
             }
             else if (!res)
                 return hasread;
-#endif
         }
         hasread += res;
         if (hasread > h->max_recv_bytes)
@@ -1289,6 +1289,7 @@ int tcpip_put(COMSTACK h, char *buf, int size)
     {
         state->towrite = size;
         state->written = 0;
+        state->altlen = 0; /* reset input buf in case of excess bytes YAZ-830 */
     }
     else if (state->towrite != size)
     {