chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] Bug in socket egg read-line, fix diff attached


From: Jim Ursetto
Subject: Re: [Chicken-hackers] Bug in socket egg read-line, fix diff attached
Date: Sun, 6 Jul 2014 20:34:31 -0500

Thanks for the patch.  Another user reported this same issue, but I haven't 
gotten a chance to look at it yet.  Actually, it appears ##sys#scan-buffer-line 
may have changed its signature recently to return multiple values.  I still 
need to verify that and if so, make sure the code works with both versions.

Jim

On Jul 6, 2014, at 6:55 PM, Jonathan Chan <address@hidden> wrote:

> Hello,
> 
> First of all, thanks again for the useful eggs and Scheme implementation. I 
> was trying to write a script using the intarweb egg and ran into a problem 
> where read-line on a socket would return a number instead of a string. I 
> looked into it and believe I have found a fix, which is attached.
> 
> The problem had two parts: first, socket's implementation of read-line 
> returned the result of a call to ##sys#scan-buffer-line, which returns 
> multiple values, whereas read-line seems to be supposed to return only the 
> string that was read. Second, the bufindex variable representing the position 
> within the socket was updated within the eos-handler lambda, although it is 
> possible for the eos-handler procedure to never be called within 
> ##sys#scan-buffer-line. To fix the bug all that is needed is to unpack the 
> values returned from ##sys#scan-buffer-line and use those to set the buffer 
> index then return.
> 
> Thanks,
> -- 
>  Jonathan Chan
>  address@hidden
> <fix_socket_read_line.diff>_______________________________________________
> Chicken-hackers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-hackers




reply via email to

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