Boost logo

Boost :

Subject: Re: [boost] [asio] boost::asio::read with empty input vector leads to an infinite loop
From: Michael Kochetkov (michael.kv_at_[hidden])
Date: 2012-07-13 14:19:25


> > Hello,
> > In the code bellow I have forgotten to set the input vector (request)
size.
> > Is the code really supposed to react as an infinite loop (no errors,
length
> > is always 0, boost::asio::read returns immediately)
>
> Probably. What else would you expect?
I expect someone from asio authers to tell me if the behavior I have
described shall be considered as normal or defective. We understand we shall
reconsider our approach to using asio but I believe we need this very
additional information to do it the proper way.
I would prefer a error message or crash because it is logically to suppose
the asio would resize the vector or emit a error because it cannot handle
situation properly (IMO). The concern behind the issue is working time and
money -- it is really tricky for inexperienced boost users to figure out the
culprit of the behavior. The program does not crash, it reports no errors
and it just does not work.

--
Michael Kochetkov

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk