Author: jablko
Date: 2008-10-11 15:16:59 -0700 (Sat, 11 Oct 2008)
New Revision: 1459
Modified:
trunk/qubit/patches/sockets-adapter.patch
Log:
Fix support for https:// URIs in sfSocketsAdapter
Modified: trunk/qubit/patches/sockets-adapter.patch
===================================================================
--- trunk/qubit/patches/sockets-adapter.patch 2008-10-11 00:34:21 UTC (rev
1458)
+++ trunk/qubit/patches/sockets-adapter.patch 2008-10-11 22:16:59 UTC (rev
1459)
@@ -1,8 +1,50 @@
Index: plugins/sfWebBrowserPlugin/lib/sfSocketsAdapter.class.php
===================================================================
---- plugins/sfWebBrowserPlugin/lib/sfSocketsAdapter.class.php (revision 11451)
+--- plugins/sfWebBrowserPlugin/lib/sfSocketsAdapter.class.php (revision 12079)
+++ plugins/sfWebBrowserPlugin/lib/sfSocketsAdapter.class.php (working copy)
-@@ -91,7 +91,7 @@
+@@ -47,18 +47,38 @@
+ $url_info = parse_url($uri);
+
+ // initialize default values
++ $host = $url_info['host'];
++ $port = 80;
++
++ if ($url_info['scheme'] == 'https')
++ {
++ $host = 'ssl://'.$host;
++ $port = 443;
++ }
++
++ if (isset($url_info['port']))
++ {
++ $port = $url_info['port'];
++ }
++
+ isset($url_info['path']) ? $path = $url_info['path'] : $path = '/';
+ isset($url_info['query']) ? $qstring = '?'.$url_info['query'] : $qstring
= null;
+- isset($url_info['port']) ? null : $url_info['port'] = 80;
+
+- if (!$socket = @fsockopen($url_info['host'], $url_info['port'], $errno,
$errstr, 15))
++ if (!$socket = @fsockopen($host, $port, $errno, $errstr, 15))
+ {
+ throw new Exception("Could not connect ($errno): $errstr");
+ }
+
+ // build request
+ $request = "$method $path$qstring HTTP/1.1\r\n";
+- $request .= 'Host: '.$url_info['host'].':'.$url_info['port']."\r\n";
++
++ $request .= 'Host: '.$url_info['host'];
++ if (isset($url_info['port']))
++ {
++ $request .= ':'.$url_info['port'];
++ }
++ $request .= "\r\n";
++
+ $request .= $request_headers;
+ $request .= "Connection: Close\r\n";
+
+@@ -91,7 +111,7 @@
fclose($fp);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---