[Ace-users] [ace-users] problem of recvv_n
Steve Huston
shuston at riverace.com
Mon Jan 7 11:06:32 CST 2008
You make an excellent point. Could you please enter this information
in Bugzilla and possibly attach a patch that corrects this issue?
Thanks,
-Steve
--
Steve Huston, Riverace Corporation
Want to take ACE training on YOUR schedule?
See http://www.riverace.com/training.htm
> -----Original Message-----
> From: ace-users-bounces at cse.wustl.edu
> [mailto:ace-users-bounces at cse.wustl.edu] On Behalf Of cui shaowei
> Sent: Saturday, January 05, 2008 2:34 AM
> To: ace-users at cse.wustl.edu
> Subject: [ace-users] problem of recvv_n
>
>
> ACE Version 5.6.0
>
> problem:
>
> ssize_t
> ACE::recvv_n_i (ACE_HANDLE handle,
> iovec *iov,
> int iovcnt,
> size_t *bt)
> {
> size_t temp;
> size_t &bytes_transferred = bt == 0 ? temp : *bt;
> bytes_transferred = 0;
>
> for (int s = 0;
> s < iovcnt;
> )
> {
> // Try to transfer as much of the remaining data as possible.
> ssize_t n = ACE_OS::recvv (handle,
> iov + s,
> iovcnt - s);
> // Check EOF.
> if (n == 0)
> return 0;
>
> // Check for other errors.
> if (n == -1)
> {
> // Check for possible blocking.
> if (errno == EWOULDBLOCK)
> {
> // Wait for the blocking to subside.
> int result = ACE::handle_read_ready (handle,
> 0);
>
> // Did select() succeed?
> if (result != -1)
> {
> // Blocking subsided. Continue data transfer.
> n = 0;
> continue;
> }
> }
>
> // Other data transfer or select() failures.
> return -1;
> }
>
> for (bytes_transferred += n;
> s < iovcnt
> && n >= static_cast<ssize_t> (iov[s].iov_len);
> s++)
> n -= iov[s].iov_len;
>
> if (n != 0)
> {
> char *base = static_cast<char *> (iov[s].iov_base);
> iov[s].iov_base = base + n; // here .. you must't
> modify iov.iov_base;
> iov[s].iov_len = iov[s].iov_len - n;
> }
> }
>
> return bytes_transferred;
> }
>
> user would get error data when you modify iov.iov_base. and
> iov.iov_len
> right?
> --
> | (\_/) This is Bunny. Copy and paste Bunny
> | (='.'=) into your signature to help him gain
> | (")_(") world domination.
>
> 崔少伟
> Tel: 13810421852
> QQ: 43458943
> MSN: shaovie at hotmail.com
>
More information about the Ace-users
mailing list