apr_socket_send() returns the number of bytes sent in the 3rd parameter. If the number of bytes actually sent does not match the expected bytes to send, apr_socket_send() automatically sets the apr_sockopt to APR_INCOMPLETE_WRITE. What that does is force select/poll on the next write call to try to handle the incomplete write before actually writing any more data to the socket. If there is an error of some sort, the return value from apr_socket_send() will indicate a problem. However, I (or anybody else) should probably review the code in gmond.c to make sure that an incomplete write doesn't actually cause further problems and that the return value from apr_socket_send() is actually being handled correctly.
Brad >>> On 2/24/2009 at 6:57 PM, in message <32623315.74691235527032322.javamail.corem...@bj126app51.126.com>, Jerry <ada...@126.com> wrote: > Hi, > > Recently, in one of my environments, I found "telnet xxxx 8649" didn't > return a well-formed xml document. After some checking, I found gmond might > lose to send out some characters. For example, I got some xml document like > "<METRIC NAME="part_max_used" VAL="13.8" TYPE="float" UNITS="%" TN="55" > TMAX="180" <EXTRA_DATA>". > > After read the code, I think usage of "apr_socket_send" in "gmond.c" has > defect. We just check return value of "apr_socket_send" but do NOT check how > many characters have been sent. I gave a patch in attachment. FYI > > Thanks, > > Jerry > > > > > > > > 网易邮箱,中国第一大电子邮件服务商 ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers