Menu

[Error] No Content-length specified

Help
Yoj
2008-11-03
2013-04-24
  • Yoj

    Yoj - 2008-11-03

    Hi, everyone!

    I need to ask help on how to solve this problem:
       Actual error: "Error XmlRpcClient::readHeader: No Content-length specified"

    Why am I having this error? I'm still new in using the XmlRpc++.

     
    • Marc

      Marc - 2009-02-05

      I got this error too when calling a Xml-Rpc.NET server.

      Xml-Rpc.NET server returns a "HTTP/1.1 100 Continue" response before returning the "normal" response.
      XmlRpc++ clients do not handle well this. Here is a simple modification of the code to make it work. Add the next lines (the ones between <!-- -->) to XmlRpcClient.cc (method readHeader):

            ...
            char *hp = (char*)_header.c_str();  // Start of header
            char *ep = hp + _header.length();   // End of string
            char *bp = 0;                       // Start of body
            char *lp = 0;                       // Start of content-length value

            // <!-- Handle XmlRpc .NET like responses
            if ((ep - hp > 23) && (strncasecmp(hp, "HTTP/1.1 100 Continue\n\n", 23) == 0))
              hp += 23;
            else if ((ep - hp > 25) && (strncasecmp(hp, "HTTP/1.1 100 Continue\r\n\r\n", 25) == 0))
              hp += 25;
            // -->

            for (char *cp = hp; (bp == 0) && (cp < ep); ++cp) {
            ...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.