Skip to content

A libiqxmlrpc client fails when no content-length is present #8

@madebr

Description

@madebr

When the response from a server does not have a content-length in its header, libiqxmlrpc panics.

The xml-rpc server of opensubtitles.org has this behavior: API documentation.

The response headers contain X-Uncompressed-Content-Length and X-Compressed-Content-Length.

example code:

#include <libiqxmlrpc/libiqxmlrpc.h>
#include <libiqxmlrpc/client.h>
#include <libiqxmlrpc/https_client.h>
#include <libiqxmlrpc/inet_addr.h>
int main() {
    iqnet::ssl::ctx = iqnet::ssl::Ctx::client_only();
    iqxmlrpc::Client<iqxmlrpc::Https_client_connection> client(iqnet::Inet_addr("api.opensubtitles.org", 443), "/xml-rpc");

    iqxmlrpc::Param_list pl;
    pl.push_back(""); // username
    pl.push_back(""); // password
    pl.push_back("en"); // language
    pl.push_back("SubDownloader 2.0.18"); // useragent

    iqxmlrpc::Response r = client.execute("LogIn", pl);
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions