Skip Menu |

This queue is for tickets about the Net-ManageSieve CPAN distribution.

Report information
The Basics
Id: 58235
Status: resolved
Priority: 0/
Queue: Net-ManageSieve

People
Owner: SKA [...] cpan.org
Requestors: Rudy.Gevaert [...] UGent.be
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.03
  • 0.04
  • 0.05
  • 0.06
  • 0.07
  • 0.08
  • 0.09
Fixed in: 0.10



Subject: buffersize of sysread
Date: Tue, 08 Jun 2010 13:41:36 +0200
To: bug-Net-ManageSieve [...] rt.cpan.org
From: Rudy Gevaert <Rudy.Gevaert [...] UGent.be>
Dear maintainer, While trying to download a very large sieve script I got 'invalid token error', and then a read timeout. Further debugging and troubleshooting pointed me to the sysread call in the library: unless(sysread($fh, $buf, 2048, length($buf))) { As my script is bigger than this 2048 bytes, I could not get it to work. Increasing this by factor two made me able to download the script. Rudy
On Tue Jun 08 07:46:34 2010, Rudy.Gevaert@UGent.be wrote: Dear Rudy, in my humble opinion, it should not matter how large this value is. But I have problems to make the value smaller than 307 bytes, with 306 byte STARTTLS let the communication stall. Could you please verify that really the "GETSCRIPT" command hangs? Also, could you please test with debugging enabled, what the last response is? In my case, it is the first line of the multi-line response to the STARTTLS command. Regards, Steffen
On Tue Jun 08 07:46:34 2010, Rudy.Gevaert@UGent.be wrote: Dear Rudy, please try without TLS, too. I can download 10KB scripts successfully, how large are yours? Regards, Steffen
On Tue Jun 08 07:46:34 2010, Rudy.Gevaert@UGent.be wrote: Dear Rudy, in my case, the problem is as such that the response to STARTTLS must be read awhole, including the last newline "\n". If the number of bytes to read is smaller than that, select() hangs, when trying to read the remaining characters from the socket. I do have no problems reading scripts in chunks however. Regards, Steffen
For now, I up the buffer size of sysread(). There seems to be a mismatch between my understanding that select() is to yield true, if there is data pending, whether or not it is already buffered in Net::SSLeay's buffer. -ska
Subject: Re: [rt.cpan.org #58235] buffersize of sysread
Date: Fri, 18 Jun 2010 13:52:32 +0200
To: bug-Net-ManageSieve [...] rt.cpan.org
From: Rudy Gevaert <Rudy.Gevaert [...] UGent.be>
On 06/18/2010 01:37 PM, Steffen Kaiser via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=58235> > > For now, I up the buffer size of sysread(). There seems to be a > mismatch between my understanding that select() is to yield true, if > there is data pending, whether or not it is already buffered in > Net::SSLeay's buffer. > > -ska
Hi Steffen, Thanks for your responses. I'll respond to your questions next week (Monday probably) Rudy
Subject: Re: [rt.cpan.org #58235] buffersize of sysread
Date: Mon, 21 Jun 2010 15:59:12 +0200
To: bug-Net-ManageSieve [...] rt.cpan.org
From: Rudy Gevaert <Rudy.Gevaert [...] UGent.be>
On 06/18/2010 01:37 PM, Steffen Kaiser via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=58235> > > For now, I up the buffer size of sysread(). There seems to be a > mismatch between my understanding that select() is to yield true, if > there is data pending, whether or not it is already buffered in > Net::SSLeay's buffer.
Dear Steffen, Thank you for already spending time on this bug! I have written a little test script that connects over tls and does a getscript. The result is dumped with Data::Dumper. I have set the debug flag to on. Please find attached the output. I have also added my script. Show quoted text
> But I have problems to make the value smaller than 307 bytes, > with 306 byte STARTTLS let the communication stall.
I have downed the value of the sysread and then it just timeouts sooner. Show quoted text
> in my case, the problem is as such that the response to STARTTLS must > be read awhole, including the last newline "\n". If the number of > bytes to read is smaller than that, select() hangs, when trying to > read the remaining characters from the socket. I do have no problems > reading scripts in chunks however.
What do you mean with reading in chunks? But increasing the size of sysread is a good work arround :) Rudy

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

fixed in v0.10