Revision e80386ef

View differences:

include/Client.h
95 95
     *    @return 0
96 96
     */
97 97
    static int call(const std::string& endpoint, const std::string& method,
98
        const xmlrpc_c::paramList& plist, long long _timeout,
98
        const xmlrpc_c::paramList& plist, unsigned int _timeout,
99 99
        xmlrpc_c::value * const result, std::string& error);
100 100

  
101 101
	/**
src/client/Client.cc
196 196
void Client::call(const std::string& method, const xmlrpc_c::paramList& plist,
197 197
     xmlrpc_c::value * const result)
198 198
{
199
    xmlrpc_c::clientXmlTransport_curl ctrans;
200
    xmlrpc_c::client_xml              client(&ctrans);
199
    xmlrpc_c::clientXmlTransport_curl ctrans(
200
        xmlrpc_c::clientXmlTransport_curl::constrOpt().timeout(timeout));
201 201

  
202
    xmlrpc_c::rpcPtr rpc(method, plist);
203 202
    xmlrpc_c::carriageParm_curl0 cparam(one_endpoint);
204 203

  
205
    rpc->start(&client, &cparam);
204
    xmlrpc_c::client_xml client(&ctrans);
205
    xmlrpc_c::rpcPtr     rpc(method, plist);
206 206

  
207
    client.finishAsync(xmlrpc_c::timeout(timeout));
207
    rpc->start(&client, &cparam);
208 208

  
209
    if (!rpc->isFinished())
210
    {
211
        rpc->finishErr(girerr::error("XMLRPC method " + method +
212
            " timeout, resetting call"));
213
    }
209
    client.finishAsync(xmlrpc_c::timeout());
214 210

  
215 211
    if (rpc->isSuccessful())
216 212
    {
......
228 224
/* -------------------------------------------------------------------------- */
229 225

  
230 226
int Client::call(const std::string& endpoint, const std::string& method,
231
        const xmlrpc_c::paramList& plist, long long _timeout,
227
        const xmlrpc_c::paramList& plist, unsigned int _timeout,
232 228
        xmlrpc_c::value * const result, std::string& error)
233 229
{
234
    xmlrpc_c::carriageParm_curl0      carriage(endpoint);
235
    xmlrpc_c::clientXmlTransport_curl transport;
236
    xmlrpc_c::client_xml              client(&transport);
230
    xmlrpc_c::clientXmlTransport_curl transport(
231
        xmlrpc_c::clientXmlTransport_curl::constrOpt().timeout(_timeout));
237 232

  
238
    xmlrpc_c::rpcPtr rpc_client(method, plist);
233
    xmlrpc_c::carriageParm_curl0  carriage(endpoint);
234

  
235
    xmlrpc_c::client_xml client(&transport);
236
    xmlrpc_c::rpcPtr     rpc_client(method, plist);
239 237

  
240 238
    int xml_rc = 0;
241 239

  
......
243 241
    {
244 242
        rpc_client->start(&client, &carriage);
245 243

  
246
        client.finishAsync(xmlrpc_c::timeout(_timeout));
247

  
248
        if (!rpc_client->isFinished())
249
        {
250
            rpc_client->finishErr(girerr::error("XMLRPC method "+ method
251
                + " timeout, resetting call"));
252
        }
244
        client.finishAsync(xmlrpc_c::timeout());
253 245

  
254 246
        if ( rpc_client->isSuccessful() )
255 247
        {

Also available in: Unified diff