From: Brad N. <bni...@no...> - 2009-03-03 16:08:05
|
Committed to trunk r1980, proposed for backport to 3.1 branch >>> On 3/1/2009 at 10:12 PM, in message <223...@bj...>, Jerry <ad...@12...> wrote: > Hi Brad, > > As you said, when the number of bytes actually sent does not match the > expected bytes to send, apr_socket_send() automatically does some setting to > force select/poll on the next write call to handle the incomplete write > first. However, for a TCP request, gmond only poll once, then writes all data > to the socket and close the socket before next poll. So I think we need to > resend the miss part immediately for tcp receive channel. I tested my patch > and it works well for my issue. > > Thanks, > > Jerry > > > > > 2009-02-25?23:36:34,"Brad?Nicholes"?<BNI...@no...> : >>???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 >><326...@bj...>, >>Jerry >><ad...@12...>?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 >>>? >>>? |