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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? socket.php

?? Bug tracker, and reporter.
?? PHP
字號(hào):
<?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();    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区久久久| 日韩午夜av一区| 日本亚洲天堂网| 中文字幕av一区 二区| 欧美日韩国产一级片| 国产成人午夜精品5599| 午夜精品视频一区| 性欧美大战久久久久久久久| 国产三级一区二区| 日韩一级高清毛片| 欧美午夜不卡视频| 不卡一区中文字幕| 国产呦萝稀缺另类资源| 丝袜美腿成人在线| 亚洲激情网站免费观看| 国产亚洲自拍一区| 日韩欧美一区二区在线视频| 欧美亚洲一区二区在线观看| 波多野结衣精品在线| 黄色成人免费在线| 日日夜夜精品视频免费| 尤物在线观看一区| 国产精品国产三级国产aⅴ中文| 精品国产乱子伦一区| 欧美精品日韩一区| 欧美三级视频在线| 91美女视频网站| 99这里只有精品| 国产精品1区2区3区| 极品美女销魂一区二区三区免费| 午夜国产精品一区| 亚洲国产精品一区二区www | 欧美一卡二卡三卡| 欧美性videosxxxxx| 色综合天天性综合| 99vv1com这只有精品| 成人av动漫网站| 大桥未久av一区二区三区中文| 国产一区二区三区高清播放| 久久国产精品第一页| 久久国产三级精品| 九色综合狠狠综合久久| 青娱乐精品视频在线| av电影在线观看一区| 成人av动漫在线| 99国产精品久| 色噜噜夜夜夜综合网| 欧美中文字幕一区二区三区 | 国产在线国偷精品免费看| 久久精品国产一区二区| 激情六月婷婷久久| 国产精品一区在线| 国产剧情一区在线| 成人av电影在线| 91在线视频播放地址| 色88888久久久久久影院按摩| 在线看不卡av| 欧美日本一区二区三区| 日韩一级完整毛片| 26uuu欧美日本| 国产精品美女久久福利网站| 亚洲欧美另类久久久精品2019| 一区二区三区四区av| 一区二区免费在线| 日本特黄久久久高潮| 狠狠网亚洲精品| 99视频精品在线| 欧美亚洲禁片免费| 日韩午夜在线观看| 欧美激情中文不卡| 亚洲国产精品影院| 国产在线看一区| 99精品欧美一区二区三区小说 | 91网站视频在线观看| 欧美在线观看一二区| 欧美tk—视频vk| 亚洲欧洲成人自拍| 夜色激情一区二区| 精品一区二区三区不卡| kk眼镜猥琐国模调教系列一区二区| 97se亚洲国产综合在线| 欧美三级电影精品| 久久综合久久99| 亚洲在线一区二区三区| 久久99国产乱子伦精品免费| 成人黄页毛片网站| 在线不卡免费欧美| 国产精品网站在线观看| 日日摸夜夜添夜夜添国产精品| 国产精品一区二区三区99| 欧美伊人久久大香线蕉综合69| 亚洲精品一区二区三区蜜桃下载| 亚洲精选视频在线| 国产一区二区在线观看视频| 欧美日韩一区二区三区免费看| 久久久国产精品不卡| 五月婷婷激情综合网| 成人免费高清在线观看| 亚洲理论在线观看| 国产精品亚洲人在线观看| 欧美性色欧美a在线播放| 久久在线观看免费| 五月婷婷激情综合| 一本到不卡免费一区二区| 精品国产乱码久久久久久浪潮 | 国内精品视频666| 91成人在线观看喷潮| 国产欧美日韩中文久久| 日韩中文字幕不卡| 一本色道久久综合亚洲91| 久久久久久久久久久久久夜| 日韩高清一区在线| 在线观看日韩国产| 国产精品免费久久| 国产一区二区h| 日韩欧美在线网站| 一区二区成人在线视频| 国产成人超碰人人澡人人澡| 日韩欧美区一区二| 五月天中文字幕一区二区| 欧美综合亚洲图片综合区| 亚洲色图色小说| eeuss鲁片一区二区三区在线观看| 精品国产凹凸成av人网站| 人禽交欧美网站| 欧美精品久久久久久久久老牛影院| 亚洲精品成a人| 91亚洲精华国产精华精华液| 国产精品嫩草影院com| 国产成人在线色| 久久午夜电影网| 国产在线播放一区三区四| 欧美成人aa大片| 久久成人综合网| 日韩欧美一级在线播放| 青娱乐精品视频在线| 欧美一区二区三区在线观看| 日韩专区在线视频| 4438x亚洲最大成人网| 天天做天天摸天天爽国产一区 | 极品少妇xxxx精品少妇| 日韩精品中文字幕在线一区| 久久精品国产一区二区三| 一区二区三区高清| 欧美日韩国产精选| 人人狠狠综合久久亚洲| 日韩欧美另类在线| 久久国产尿小便嘘嘘尿| 久久久夜色精品亚洲| 国产美女久久久久| 久久精品免费在线观看| 不卡视频免费播放| 亚洲免费观看高清| 欧美日韩精品欧美日韩精品| 午夜激情久久久| 欧美不卡视频一区| 国产精品一级黄| 亚洲婷婷综合色高清在线| 在线精品亚洲一区二区不卡| 午夜精品影院在线观看| 日韩欧美成人一区二区| 丁香另类激情小说| 亚洲特黄一级片| 欧美日韩免费高清一区色橹橹| 日韩电影一区二区三区四区| 精品av综合导航| 成人性生交大片免费看在线播放| 亚洲人精品一区| 欧美精品 日韩| 国产美女精品在线| 亚洲精品欧美激情| 日韩一区二区精品| 高清不卡在线观看av| 亚洲一区自拍偷拍| 欧美mv日韩mv国产网站| 99久久精品情趣| 日韩国产欧美在线视频| 亚洲国产精品v| 欧美日韩在线播放一区| 狠狠色丁香婷综合久久| 亚洲人被黑人高潮完整版| 欧美一区二区三区视频免费| 成人性生交大片免费| 丝袜美腿成人在线| 国产精品久久久久永久免费观看 | 欧洲一区二区av| 久久成人av少妇免费| 中文字幕一区免费在线观看| 中文字幕字幕中文在线中不卡视频| 91精品国产色综合久久不卡蜜臀| 大尺度一区二区| 蜜桃视频在线观看一区二区| 18欧美乱大交hd1984| 精品日韩在线观看| 欧美亚洲一区二区在线| 粉嫩一区二区三区性色av| 三级久久三级久久| 亚洲欧美一区二区三区极速播放| 日韩免费高清av| 欧美丝袜自拍制服另类|