亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? socket.php

?? zend的加強包 zend的加強包
?? PHP
字號:
<?php/** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category   Zend * @package    Zend_Http * @subpackage Client_Adapter * @version    $Id: Socket.php 8064 2008-02-16 10:58:39Z thomas $ * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license    http://framework.zend.com/license/new-bsd     New BSD License */require_once 'Zend/Uri/Http.php';require_once 'Zend/Http/Client/Adapter/Interface.php';/** * A sockets based (stream_socket_client) adapter class for Zend_Http_Client. Can be used * on almost every PHP environment, and does not require any special extensions. * * @category   Zend * @package    Zend_Http * @subpackage Client_Adapter * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) * @license    http://framework.zend.com/license/new-bsd     New BSD License */class Zend_Http_Client_Adapter_Socket implements Zend_Http_Client_Adapter_Interface{    /**     * The socket for server connection     *     * @var resource|null     */    protected $socket = null;    /**     * What host/port are we connected to?     *     * @var array     */    protected $connected_to = array(null, null);    /**     * Parameters array     *     * @var array     */    protected $config = array(        'ssltransport'  => 'ssl',        'sslcert'       => null,        'sslpassphrase' => null    );    /**     * Request method - will be set by write() and might be used by read()     *     * @var string     */    protected $method = null;    /**     * Adapter constructor, currently empty. Config is set using setConfig()     *     */    public function __construct()    {    }    /**     * Set the configuration array for the adapter     *     * @param array $config     */    public function setConfig($config = array())    {        if (! is_array($config)) {            require_once 'Zend/Http/Client/Adapter/Exception.php';            throw new Zend_Http_Client_Adapter_Exception(                '$config expects an array, ' . gettype($config) . ' recieved.');        }        foreach ($config as $k => $v) {            $this->config[strtolower($k)] = $v;        }    }    /**     * Connect to the remote server     *     * @param string  $host     * @param int     $port     * @param boolean $secure     * @param int     $timeout     */    public function connect($host, $port = 80, $secure = false)    {        // If the URI should be accessed via SSL, prepend the Hostname with ssl://        $host = ($secure ? $this->config['ssltransport'] : 'tcp') . '://' . $host;        // If we are connected to the wrong host, disconnect first        if (($this->connected_to[0] != $host || $this->connected_to[1] != $port)) {            if (is_resource($this->socket)) $this->close();        }        // Now, if we are not connected, connect        if (! is_resource($this->socket) || ! $this->config['keepalive']) {            $context = stream_context_create();            if ($secure) {                if ($this->config['sslcert'] !== null) {                    if (! stream_context_set_option($context, 'ssl', 'local_cert',                                                    $this->config['sslcert'])) {                        require_once 'Zend/Http/Client/Adapter/Exception.php';                        throw new Zend_Http_Client_Adapter_Exception('Unable to set sslcert option');                    }                }                if ($this->config['sslpassphrase'] !== null) {                    if (! stream_context_set_option($context, 'ssl', 'passphrase',                                                    $this->config['sslpassphrase'])) {                        require_once 'Zend/Http/Client/Adapter/Exception.php';                        throw new Zend_Http_Client_Adapter_Exception('Unable to set sslpassphrase option');                    }                }            }            $this->socket = @stream_socket_client($host . ':' . $port,                                                  $errno,                                                  $errstr,                                                  (int) $this->config['timeout'],                                                  STREAM_CLIENT_CONNECT,                                                  $context);            if (! $this->socket) {                $this->close();                require_once 'Zend/Http/Client/Adapter/Exception.php';                throw new Zend_Http_Client_Adapter_Exception(                    'Unable to Connect to ' . $host . ':' . $port . '. Error #' . $errno . ': ' . $errstr);            }            // Set the stream timeout            if (! stream_set_timeout($this->socket, (int) $this->config['timeout'])) {                require_once 'Zend/Http/Client/Adapter/Exception.php';                throw new Zend_Http_Client_Adapter_Exception('Unable to set the connection timeout');            }            // Update connected_to            $this->connected_to = array($host, $port);        }    }    /**     * Send request to the remote server     *     * @param string        $method     * @param Zend_Uri_Http $uri     * @param string        $http_ver     * @param array         $headers     * @param string        $body     * @return string Request as string     */    public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')    {        // Make sure we're properly connected        if (! $this->socket) {            require_once 'Zend/Http/Client/Adapter/Exception.php';            throw new Zend_Http_Client_Adapter_Exception('Trying to write but we are not connected');        }        $host = $uri->getHost();        $host = (strtolower($uri->getScheme()) == 'https' ? $this->config['ssltransport'] : 'tcp') . '://' . $host;        if ($this->connected_to[0] != $host || $this->connected_to[1] != $uri->getPort()) {            require_once 'Zend/Http/Client/Adapter/Exception.php';            throw new Zend_Http_Client_Adapter_Exception('Trying to write but we are connected to the wrong host');        }        // Save request method for later        $this->method = $method;        // Build request headers        $path = $uri->getPath();        if ($uri->getQuery()) $path .= '?' . $uri->getQuery();        $request = "{$method} {$path} HTTP/{$http_ver}\r\n";        foreach ($headers as $k => $v) {            if (is_string($k)) $v = ucfirst($k) . ": $v";            $request .= "$v\r\n";        }        // Add the request body        $request .= "\r\n" . $body;        // Send the request        if (! @fwrite($this->socket, $request)) {            require_once 'Zend/Http/Client/Adapter/Exception.php';            throw new Zend_Http_Client_Adapter_Exception('Error writing request to server');        }        return $request;    }    /**     * Read response from server     *     * @return string     */    public function read()    {        // First, read headers only        $response = '';        $gotStatus = false;        while ($line = @fgets($this->socket)) {            $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);            if ($gotStatus) {                $response .= $line;                if (!chop($line)) break;            }        }        // Handle 100 and 101 responses internally by restarting the read again        if (Zend_Http_Response::extractCode($response) == 100 ||            Zend_Http_Response::extractCode($response) == 101) return $this->read();        // If this was a HEAD request, return after reading the header (no need to read body)        if ($this->method == Zend_Http_Client::HEAD) return $response;        // Check headers to see what kind of connection / transfer encoding we have        $headers = Zend_Http_Response::extractHeaders($response);        // if the connection is set to close, just read until socket closes        if (isset($headers['connection']) && $headers['connection'] == 'close') {            while ($buff = @fread($this->socket, 8192)) {                $response .= $buff;            }            $this->close();        // Else, if we got a transfer-encoding header (chunked body)        } elseif (isset($headers['transfer-encoding'])) {            if ($headers['transfer-encoding'] == 'chunked') {                do {                    $chunk = '';                    $line = @fgets($this->socket);                    $chunk .= $line;                    $hexchunksize = ltrim(chop($line), '0');                    $hexchunksize = strlen($hexchunksize) ? strtolower($hexchunksize) : 0;                    $chunksize = hexdec(chop($line));                    if (dechex($chunksize) != $hexchunksize) {                        @fclose($this->socket);                        require_once 'Zend/Http/Client/Adapter/Exception.php';                        throw new Zend_Http_Client_Adapter_Exception('Invalid chunk size "' .                            $hexchunksize . '" unable to read chunked body');                    }                    $left_to_read = $chunksize;                    while ($left_to_read > 0) {                        $line = @fread($this->socket, $left_to_read);                        $chunk .= $line;                        $left_to_read -= strlen($line);                    }                    $chunk .= @fgets($this->socket);                    $response .= $chunk;                } while ($chunksize > 0);            } else {                throw new Zend_Http_Client_Adapter_Exception('Cannot handle "' .                    $headers['transfer-encoding'] . '" transfer encoding');            }        // Else, if we got the content-length header, read this number of bytes        } elseif (isset($headers['content-length'])) {            $left_to_read = $headers['content-length'];            $chunk = '';            while ($left_to_read > 0) {                $chunk = @fread($this->socket, $left_to_read);                $left_to_read -= strlen($chunk);                $response .= $chunk;            }        // Fallback: just read the response (should not happen)        } else {            while ($buff = @fread($this->socket, 8192)) {                $response .= $buff;            }            $this->close();        }        return $response;    }    /**     * Close the connection to the server     *     */    public function close()    {        if (is_resource($this->socket)) @fclose($this->socket);        $this->socket = null;        $this->connected_to = array(null, null);    }    /**     * Destructor: make sure the socket is disconnected     *     */    public function __destruct()    {        if ($this->socket) $this->close();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区视频| 欧美国产日韩一二三区| 一级日本不卡的影视| 成人av网站免费| 国产清纯白嫩初高生在线观看91 | 亚洲黄色av一区| 91麻豆国产香蕉久久精品| 亚洲欧美一区二区三区孕妇| 91免费在线视频观看| 亚洲一二三四久久| 日韩一级黄色大片| 国产精品一区二区久激情瑜伽| 国产日韩欧美电影| 91久久精品一区二区三区| 午夜精品aaa| 久久久一区二区| 91麻豆成人久久精品二区三区| 亚洲资源在线观看| 欧美成人三级在线| 粉嫩aⅴ一区二区三区四区 | 亚洲国产精品影院| 日韩欧美国产电影| 国产99久久久精品| 亚洲一区二区三区影院| 欧美成人精品高清在线播放| 成人ar影院免费观看视频| 亚洲国产wwwccc36天堂| 26uuu另类欧美亚洲曰本| 色视频欧美一区二区三区| 日韩精品国产欧美| 国产精品欧美一级免费| 91在线视频18| 久久成人麻豆午夜电影| 国产精品第五页| 欧美一级片在线| www.av精品| 精品制服美女丁香| 亚洲综合偷拍欧美一区色| 久久久久久亚洲综合| 在线视频你懂得一区二区三区| 精品一区二区在线视频| 亚洲女与黑人做爰| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美v日韩v国产v| 欧美专区日韩专区| 国产剧情一区在线| 日韩精品91亚洲二区在线观看| 亚洲国产高清aⅴ视频| 日韩天堂在线观看| 欧美午夜在线观看| av成人免费在线观看| 久久se这里有精品| 午夜精品久久久久| 一区二区三区.www| 日韩一区在线看| 久久一区二区三区四区| 欧美一区午夜精品| 欧美人牲a欧美精品| 91香蕉视频污| 不卡免费追剧大全电视剧网站| 精品亚洲国产成人av制服丝袜| 无码av中文一区二区三区桃花岛| 亚洲乱码国产乱码精品精的特点 | 日韩三级在线观看| 欧美中文字幕一二三区视频| 成人午夜在线视频| 国产精品18久久久久久久久久久久| 婷婷成人激情在线网| 亚洲va韩国va欧美va精品| 一区二区不卡在线视频 午夜欧美不卡在| 国产女主播视频一区二区| 久久久美女毛片| 久久久www成人免费毛片麻豆| 精品国产一区二区三区忘忧草| 91精品国产一区二区三区香蕉| 欧美日韩一区久久| 欧美女孩性生活视频| 欧美日韩国产综合一区二区| 欧美日韩精品欧美日韩精品一 | 国模套图日韩精品一区二区| 男人的天堂亚洲一区| 欧美aaaaa成人免费观看视频| 奇米影视7777精品一区二区| 日韩精品91亚洲二区在线观看| 日日摸夜夜添夜夜添亚洲女人| 日韩精品电影一区亚洲| 免费亚洲电影在线| 狠狠色丁香久久婷婷综| 国产精一品亚洲二区在线视频| 国产一区二区三区四| 国产老女人精品毛片久久| 国产超碰在线一区| 91美女视频网站| 欧美亚洲国产怡红院影院| 欧美三级中文字幕| 欧美一级高清大全免费观看| 26uuu国产电影一区二区| 2022国产精品视频| 国产精品色哟哟网站| 亚洲乱码一区二区三区在线观看| 午夜精品久久久| 国产另类ts人妖一区二区| 99精品久久免费看蜜臀剧情介绍| 在线视频国内自拍亚洲视频| 91精品久久久久久久久99蜜臂| 日韩手机在线导航| 国产蜜臀av在线一区二区三区| 亚洲人成小说网站色在线 | 久久国产麻豆精品| 国产99久久久精品| 在线免费一区三区| 日韩一区二区三区免费观看| 久久综合久久综合久久| 1000部国产精品成人观看| 午夜精品久久久久久久| 国产福利电影一区二区三区| 日本精品一级二级| 精品动漫一区二区三区在线观看| 成人欧美一区二区三区视频网页| 石原莉奈一区二区三区在线观看 | 日日骚欧美日韩| 成人爽a毛片一区二区免费| 欧美亚洲一区三区| 久久视频一区二区| 亚洲国产精品尤物yw在线观看| 国产一区二区不卡老阿姨| 91福利精品视频| 久久久国产一区二区三区四区小说 | 欧美激情在线免费观看| 亚洲国产欧美另类丝袜| 国产91精品一区二区| 日韩视频在线永久播放| 亚洲精品国产精华液| 国产精品一区二区男女羞羞无遮挡 | 欧美久久高跟鞋激| 国产精品亲子乱子伦xxxx裸| 蜜臀久久99精品久久久久宅男| eeuss鲁片一区二区三区| 日韩午夜三级在线| 亚洲图片欧美视频| 菠萝蜜视频在线观看一区| 日韩免费电影一区| 亚洲成a人v欧美综合天堂下载 | 亚洲精品成人在线| 国产精一品亚洲二区在线视频| 欧美福利电影网| 怡红院av一区二区三区| 国产大片一区二区| 精品sm捆绑视频| 日韩av电影免费观看高清完整版| 色婷婷一区二区| 亚洲视频你懂的| 国产91精品欧美| 久久久久国产精品免费免费搜索| 视频一区视频二区在线观看| 欧美丝袜自拍制服另类| 日韩美女视频一区二区| 成人精品小蝌蚪| 国产欧美日韩精品a在线观看| 国产一区91精品张津瑜| 精品久久国产字幕高潮| 伦理电影国产精品| 欧美一区二区三区播放老司机| 亚洲v日本v欧美v久久精品| 日本韩国视频一区二区| 亚洲精品国产高清久久伦理二区| 成人免费高清在线观看| 国产欧美精品一区aⅴ影院 | 精品久久国产老人久久综合| 日本不卡123| 精品精品国产高清一毛片一天堂| 日本亚洲免费观看| 精品少妇一区二区| 国产精品18久久久久久久久| 国产日韩欧美综合一区| 成人午夜激情在线| 亚洲欧洲在线观看av| 97国产一区二区| 亚洲黄色在线视频| 欧美精品乱码久久久久久按摩| 亚洲va欧美va天堂v国产综合| 欧美一区二区三区视频免费播放 | 亚洲国产日韩a在线播放性色| 欧美三级电影一区| 热久久一区二区| 久久人人爽人人爽| av在线免费不卡| 亚洲国产wwwccc36天堂| 日韩一级片网站| 国产999精品久久久久久绿帽| ...av二区三区久久精品| 欧美性受极品xxxx喷水| 美女视频黄频大全不卡视频在线播放| 日韩精品中文字幕在线不卡尤物| 国产一区二区三区日韩| 亚洲免费观看高清完整| 日韩午夜电影在线观看| 不卡高清视频专区| 日韩国产精品久久久久久亚洲| 亚洲精品一区二区三区99|