CC: | byrdhuntr [...] hotmail.com,Paul.Hawkins [...] ripcode.com |
Subject: | Provide a mechanism for tracing/debugging wire traffic |
In response to multiple requests for the same functionality for
different reasons, I've come up with an approach to this. But I don't
want to delay the 0.60 release for it, nor do I want to rush it out
without properly supporting it with tests and documentation. So I am
collecting my thoughts here for future reference:
For both RPC::XML::Client and RPC::XML::Server, add a parameter to the
constructors called something like "message_debug_cb" or something more
meaningful and less clumsy. It's value is a code reference that will be
invoked one for each chunk of data read from the other end of the
conversation (the server response in the case of RPC::XML::Client, or
the client's initial request in the case of RPC::XML::Server). The
callback will be passed the chunk of text. If compression is involved,
it is called with the uncompressed content. When the message is
complete, it is called one last time with no parameter (the param will
be undef, not a zero-length string) to signal this.
For RPC::XML::Client, this should go right before the call to
"$parser->parse_more($data)" on or near line 346 of Client.pm. For
RPC::XML::Server, this should go right before the similar call wrapped
in an eval on or near line 1481 of Server.pm.