OSSP CVS Repository

ossp - Difference in ossp-pkg/sio/al.c versions 1.27 and 1.28
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sio/al.c 1.27 -> 1.28

--- al.c 2002/10/18 14:12:11     1.27
+++ al.c 2002/10/22 15:09:44     1.28
@@ -533,9 +533,9 @@
             step = res;
 
         src -= step;
-        AL_RESIZE(al, cur, step);
+        AL_PRESIZE(al, cur, step);
         n   -= step;
-        res = AL_CHUNK_RESERVE(cur);
+        res = AL_CHUNK_PRESERVE(cur);
 
         dst = AL_CHUNK_PTR(cur, 0);
         memcpy(dst, src, step);
@@ -836,9 +836,8 @@
     if (tx->cur == NULL)   /* premature EOF */
         return AL_ERR_EOF;
 
-    step = AL_CHUNK_LEN(tx->cur);
-    if (step > tx->togo)
-        step = tx->togo;
+    /* compute number of bytes to process */
+    step = AL_CHUNK_SPAN(tx->cur, tx->skip, tx->togo);
 
     /*
      * synthetic chunk which is NOT maintained in usecount
@@ -855,10 +854,12 @@
         case AL_FORWARD:
             tx->cur   = NEXT(tx->cur,chunks);
             tx->togo -= step;
+            tx->skip  = 0;
             break;
         case AL_BACKWARD:
             tx->cur   = PREV(tx->cur,chunks);
             tx->togo -= step;
+            tx->skip  = 0;
             break;
     }
 

CVSTrac 2.0.1