Ignore:
Timestamp:
Jun 23, 2016, 5:25:04 PM (5 years ago)
Author:
joamuran
Message:

relase 5.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/n4d.php

    r1512 r2002  
    2929}
    3030
    31 function n4d($method, $args){
     31function n4d($method, $args, $timeout){
    3232 
    3333  writeHeader();
     
    4545    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
    4646   
    47     curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);  // async
    48     curl_setopt($ch, CURLOPT_TIMEOUT, 1);       // async
     47   
     48    if ($timeout!="0"){
     49      error_log("**************************************************************");
     50      curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);  // async
     51      curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);       // async
     52    }
    4953 
    5054    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
     
    5660    curl_close($ch);
    5761   
    58     error_log(curl_errno($ch));
     62    //error_log($data);
     63    //error_log(curl_errno($ch));
    5964    if (curl_errno($ch)) {
    6065      $xml_snippet=simplexml_load_string($data);
     
    6368    } else {
    6469        $xmlobj=xmlrpc_decode($data);
     70       
     71      error_log($xmlobj);
     72       
    6573        $json=json_encode($xmlobj);
    6674        var_error_log($data);
     
    6977        if ($json=="") {
    7078          $json=$xmlobj;}
     79          //error_log($json);
    7180          var_error_log($json);
    7281        echo ($json);
     
    9099  $method=$_POST["method"];
    91100  $args=json_decode($_POST["args"]);
     101  $timeout=$_POST["timeout"];
    92102  $myfile = fopen("/tmp/n4dlog","a");
    93103  fwrite($myfile,$method);
     
    100110    else $log="false";
    101111   
    102   n4d($method, $args);
     112  n4d($method, $args, $timeout);
    103113  //$n4d_async = new n4dAsync();
    104114  //$n4d_async ->start($method, $args);
Note: See TracChangeset for help on using the changeset viewer.