Changeset 16759

Show
Ignore:
Timestamp:
07/01/08 12:41:11 (3 months ago)
Author:
rambo
Message:

forward port r16755 to r16758

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.replicator/transporter/http.php

    r16754 r16759  
    1818    var $_password = false; 
    1919    var $use_force = false; 
     20    var $http_timeout = 15; 
     21    var $http_read_timeout = 30; 
     22    var $keep_alive = false; 
    2023 
    2124    function midcom_helper_replicator_transporter_http($subscription) 
     
    8386        $this->_client = new org_openpsa_httplib(); 
    8487        $client =& $this->_client; 
     88        $client->http_timeout = $this->http_timeout; 
     89        $client->http_read_timeout = $this->http_read_timeout; 
    8590        $client->basicauth['user'] = $this->_username; 
    8691        $client->basicauth['password'] = $this->_password; 
     92        $headers = array(); 
     93        if ($this->keep_alive) 
     94        { 
     95            $headers['connection'] = 'Keep-Alive'; 
     96        } 
    8797        $post_vars = array 
    8898        ( 
     
    91101        ); 
    92102        debug_push_class(__CLASS__, __FUNCTION__); 
    93         debug_add('Posting ' . strlen($post_vars['midcom_helper_replicator_import_xml']) . ' bytes to ' . $this->url); 
     103        debug_add('Posting ' . strlen($post_vars['midcom_helper_replicator_import_xml']) . " bytes to {$this->url} (file {$items[$key]})"); 
    94104        debug_pop(); 
    95105        $response = $client->post($this->url, $post_vars); 
  • trunk/midcom/org.openpsa.httplib/main.php

    r14381 r16759  
    2323    ); 
    2424    var $files = array(); 
     25    var $http_timeout = 15; 
     26    var $http_read_timeout = 30; 
    2527 
    2628    /** 
     
    113115        require_once('HTTP/Request.php'); 
    114116        debug_push_class(__CLASS__, __FUNCTION__); 
    115         $this->_client =& new HTTP_Request($uri); 
     117        $params = array 
     118        ( 
     119            'timeout' => $this->http_timeout, 
     120            'readTimeout' => array($this->http_read_timeout, 0), 
     121        ); 
     122        $this->_client =& new HTTP_Request($uri, $params); 
    116123        $c =& $this->_client; 
    117124        $c->setMethod(HTTP_REQUEST_METHOD_POST);