Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
This looks like a bug in the RPC::XML::Server module related to compression.

Here's what's going on. The server decides it needs to compress the response data because it's over the compress_thresh threshold (defaults to 4 kB). It does this fine as you've discovered in the packet trace but what it's not doing is sending a Content-Type response header of deflate (in fact, it tries to set it but the value of $compress is never assigned). This causes the client to not know that it needs to filter the response through Compress::Zlib and fails silently when it tries to parse the XML. To overcome this, you can set the compress_thresh manually to an arbitrarily large number so the server never thinks it needs to compress the response. Otherwise you'll need to patch the RPC/XML/Server.pm file yourself so that the server sends the correct response header.

Basically all you need to do is add a $compress = $self->compress to the section of the code that compresses the response xml. (diff follows)
*** 1351,1356 ****
--- 1351,1357 ----
          }
          elsif ($req->method eq 'POST')
          {
+                       $compress = $self->compress;
              # Get a XML::Parser::ExpatNB object
              $parser = $self->parser->parse();
This code is already in the Apache::RPC::Server module that is included in this package so I'm sure it's just an oversight on the part of the module writer.

HTH - brian

In reply to Re: RPC::XML server seems to occasionally send corrupted responses by bpphillips
in thread RPC::XML server seems to occasionally send corrupted responses by nenbrian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found