chop example

'Error writing request to proxy server'
            );
        }

        // Read response headers only         $response = '';
        $gotStatus = false;
        while ($line = @fgets($this->socket)) {
            $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
            if ($gotStatus) {
                $response .= $line;
                if (!chop($line)) {
                    break;
                }
            }
        }

        // Check that the response from the proxy is 200         if (Zend_Http_Response::extractCode($response) != 200) {
            throw new Zend_Http_Client_Adapter_Exception(
                'Unable to connect to HTTPS proxy. Server response: ' . $response
            );
        }

        
$this->status=-100;
                return false;
            }

            if($currentHeader == "\r\n")
                break;

            // if a header begins with Location: or URI:, set the redirect             if(preg_match("/^(Location:|URI:)/i",$currentHeader))
            {
                // get URL portion of the redirect                 preg_match("/^(Location:|URI:)[ ]+(.*)/i",chop($currentHeader),$matches);
                // look for :// in the Location header to see if hostname is included                 if(!preg_match("|\:\/\/|",$matches[2]))
                {
                    // no host in the path, so prepend                     $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
                    // eliminate double slash                     if(!preg_match("|^/|",$matches[2]))
                            $this->_redirectaddr .= "/".$matches[2];
                    else
                            $this->_redirectaddr .= $matches[2];
                }
                
Home | Imprint | This part of the site doesn't use cookies.