original_string: function prepare_http_request ($mnet_peer) {
          $this->uri = $mnet_peer->wwwroot . $mnet_peer->application->xmlrpc_server_url;
  
          // Initialize request the target URL
          $httprequest = curl_init($this->uri);
          curl_setopt($httprequest, CURLOPT_TIMEOUT, $this->timeout);
          curl_setopt($httprequest, CURLOPT_RETURNTRANSFER, true);
          curl_setopt($httprequest, CURLOPT_POST, true);
          curl_setopt($httprequest, CURLOPT_USERAGENT, 'Moodle');
          curl_setopt($httprequest, CURLOPT_HTTPHEADER, array("Content-Type: text/xml charset=UTF-8"));
  
          $verifyhost = 0;
          $verifypeer = false;
          if ($mnet_peer->sslverification == mnet_peer::SSL_HOST_AND_PEER) {
              $verifyhost = 2;
              $verifypeer = true;
          } else if ($mnet_peer->sslverification == mnet_peer::SSL_HOST) {
              $verifyhost = 2;
          }
          curl_setopt($httprequest, CURLOPT_SSL_VERIFYHOST, $verifyhost);
          curl_setopt($httprequest, CURLOPT_SSL_VERIFYPEER, $verifypeer);
          return $httprequest;
      }
code: function prepare_http_request ($mnet_peer) {
          $this->uri = $mnet_peer->wwwroot . $mnet_peer->application->xmlrpc_server_url;
  
          // Initialize request the target URL
          $httprequest = curl_init($this->uri);
          curl_setopt($httprequest, CURLOPT_TIMEOUT, $this->timeout);
          curl_setopt($httprequest, CURLOPT_RETURNTRANSFER, true);
          curl_setopt($httprequest, CURLOPT_POST, true);
          curl_setopt($httprequest, CURLOPT_USERAGENT, 'Moodle');
          curl_setopt($httprequest, CURLOPT_HTTPHEADER, array("Content-Type: text/xml charset=UTF-8"));
  
          $verifyhost = 0;
          $verifypeer = false;
          if ($mnet_peer->sslverification == mnet_peer::SSL_HOST_AND_PEER) {
              $verifyhost = 2;
              $verifypeer = true;
          } else if ($mnet_peer->sslverification == mnet_peer::SSL_HOST) {
              $verifyhost = 2;
          }
          curl_setopt($httprequest, CURLOPT_SSL_VERIFYHOST, $verifyhost);
          curl_setopt($httprequest, CURLOPT_SSL_VERIFYPEER, $verifypeer);
          return $httprequest;
      }
code_tokens: function prepare_http_request ( $ mnet_peer ) { $ this -> uri = $ mnet_peer -> wwwroot . $ mnet_peer -> application -> xmlrpc_server_url ; // Initialize request the target URL $ httprequest = curl_init ( $ this -> uri ) ; curl_setopt ( $ httprequest , CURLOPT_TIMEOUT , $ this -> timeout ) ; curl_setopt ( $ httprequest , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ httprequest , CURLOPT_POST , true ) ; curl_setopt ( $ httprequest , CURLOPT_USERAGENT , 'Moodle' ) ; curl_setopt ( $ httprequest , CURLOPT_HTTPHEADER , array ( "Content-Type: text/xml charset=UTF-8" ) ) ; $ verifyhost = 0 ; $ verifypeer = false ; if ( $ mnet_peer -> sslverification == mnet_peer :: SSL_HOST_AND_PEER ) { $ verifyhost = 2 ; $ verifypeer = true ; } else if ( $ mnet_peer -> sslverification == mnet_peer :: SSL_HOST ) { $ verifyhost = 2 ; } curl_setopt ( $ httprequest , CURLOPT_SSL_VERIFYHOST , $ verifyhost ) ; curl_setopt ( $ httprequest , CURLOPT_SSL_VERIFYPEER , $ verifypeer ) ; return $ httprequest ; }
docstring: Generate a curl handle and prepare it for sending to an mnet host
  
  @param object $mnet_peer A mnet_peer object with details of the remote host the request will be sent to
  @return cURL handle - the almost-ready-to-send http request
docstring_tokens: Generate a curl handle and prepare it for sending to an mnet host