chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] use correct variable in read-buffered (tcp)


From: Felix Winkelmann
Subject: [Chicken-hackers] [PATCH] use correct variable in read-buffered (tcp)
Date: Mon, 20 Oct 2014 12:36:39 +0200 (CEST)

Hello!


Attached a patch, fixing "read-buffered" in the tcp unit.

This also reverts 931ba53, which was trying to address this problem, but
in a wrong way.


felix
>From ed17f982cad82652988dc9d5692114082daa2f9d Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Mon, 20 Oct 2014 12:34:45 +0200
Subject: [PATCH] Use correct variable when updating buffer-location in
 "read-buffered" for tcp ports.

---
 tcp.scm |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tcp.scm b/tcp.scm
index 99745d0..1652cbc 100644
--- a/tcp.scm
+++ b/tcp.scm
@@ -359,7 +359,6 @@ EOF
       (let* ((buf (make-string +input-buffer-size+))
             (data (vector fd #f #f buf 0))
             (buflen 0)
-            (bufpos 0)
             (bufindex 0)
             (iclosed #f) 
             (oclosed #f)
@@ -469,8 +468,8 @@ EOF
               (lambda (p)              ; read-buffered
                 (if (fx>= bufindex buflen)
                     ""
-                    (let ((str (##sys#substring buf bufpos buflen)))
-                      (set! bufpos buflen)
+                    (let ((str (##sys#substring buf bufindex buflen)))
+                      (set! bufindex buflen)
                       str)))
               ) )
             (output
-- 
1.7.9.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]