[tor-commits] [meek/master] Formatting in php/index.php.

dcf at torproject.org dcf at torproject.org
Sun Feb 22 21:24:08 UTC 2015


commit 70ba42708c4972feb1bab1b3f8d5f9e429bd19bc
Author: David Fifield <david at bamsoftware.com>
Date:   Sun Feb 22 12:20:04 2015 -0800

    Formatting in php/index.php.
---
 php/index.php |   26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/php/index.php b/php/index.php
index b6fb9ef..44fb0e1 100644
--- a/php/index.php
+++ b/php/index.php
@@ -1,21 +1,18 @@
 <?php
-
-	/**
-	 * A php reflector for meek.
-	 */
+	// A PHP reflector for meek.
 
 	$forwardURL = "http://meek.bamsoftware.com:7002/";
 
 	$headerArray = array();
-	if ( array_key_exists("HTTP_X_SESSION_ID", $_SERVER) ) {
+	if (array_key_exists("HTTP_X_SESSION_ID", $_SERVER)) {
 		$headerArray[] = "X-Session-Id: " . $_SERVER["HTTP_X_SESSION_ID"];
 	}
 
-	function HeaderFunc( $ch, $header ) {
-		if ( explode( ":", $header )[0] == "Content-Type" ) {
-			header( $header );
+	function HeaderFunc($ch, $header) {
+		if (explode( ":", $header)[0] == "Content-Type") {
+			header($header);
 		}
-		return strlen( $header );
+		return strlen($header);
 	}
 
 	$curlOpt = array(
@@ -25,14 +22,13 @@
 		CURLOPT_HEADERFUNCTION => "HeaderFunc",
 	);
 
-	$ch = curl_init( $forwardURL );
-	curl_setopt_array( $ch, $curlOpt );
+	$ch = curl_init($forwardURL);
+	curl_setopt_array($ch, $curlOpt);
 
-	if ( !curl_exec( $ch ) ) {
+	if (!curl_exec($ch)) {
 		header("HTTP/1.1 502 Bad Gateway");
 		echo "502 Bad Gateway\n";
 	}
 
-	curl_close( $ch );
-
-?>
\ No newline at end of file
+	curl_close($ch);
+?>





More information about the tor-commits mailing list