示例#1
0
文件: jaxl.0124.php 项目: ZZB/JAXL
 public static function sendBody($xml, $jaxl)
 {
     $xml = self::saveSession($xml, $jaxl);
     if ($xml != false) {
         $jaxl->log("[[XMPPSend]] body\n" . $xml, 4);
         $payload = JAXLUtil::curl($jaxl->bosh['url'], 'POST', $jaxl->bosh['headers'], $xml);
         $payload = $payload['content'];
         $jaxl->handler($payload);
     }
     return $xml;
 }
示例#2
0
 public static function sendBody($xml, $jaxl)
 {
     $xml = JAXLPlugin::execute('jaxl_pre_curl', $xml, $jaxl);
     if ($xml != false) {
         JAXLog::log("[[XMPPSend]] body\n" . $xml, 4, $jaxl);
         $payload = JAXLUtil::curl($jaxl->bosh['url'], 'POST', $jaxl->bosh['headers'], $xml);
         $payload = $payload['content'];
         XMPPGet::handler($payload, $jaxl);
     }
     return $xml;
 }
示例#3
0
文件: jaxl.0124.php 项目: ngsru/JAXL
 public static function sendBody($xml, $jaxl)
 {
     $xml = self::saveSession($xml, $jaxl);
     if ($xml != false) {
         $jaxl->log("[[XMPPSend]] body\n" . $xml, 4);
         $payload = JAXLUtil::curl($jaxl->bosh['url'], 'POST', $jaxl->bosh['headers'], $xml);
         // curl error handling
         if ($payload['errno'] != 0) {
             $log = "[[JAXL0124]] Curl errno " . $payload['errno'] . " encountered";
             switch ($payload['errno']) {
                 case 7:
                     $log .= ". Failed to connect with " . $jaxl->bosh['url'];
                     break;
                 case 52:
                     $log .= ". Empty response rcvd from bosh endpoint";
                     break;
                 default:
                     break;
             }
             $jaxl->executePlugin('jaxl_get_bosh_curl_error', $payload);
             $jaxl->log($log);
         }
         $payload = $payload['content'];
         $jaxl->handler($payload);
     }
     return $xml;
 }