Last active
August 29, 2015 14:23
-
-
Save hjcotton/3b5943fefd666d08e51d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Fixes POPCFC (http://popcfc.riaforge.org/) socket.cfc read() timing out when connecting over SSL. | |
Source: http://stackoverflow.com/questions/29778233/not-getting-a-response-when-communicating-with-google-using-java-sslsocket ---> | |
<cfloop condition="not locInput.ready()"> | |
<cfset sleep(1)> <!--- take a breather ---> | |
<cfif timeout LT getTickCount()> | |
<!--- if we're here we haven't had a response from the server ---> | |
<cfthrow message="Connection Timed out." detail="The connection did not receive a response within the timeout period."> | |
</cfif> | |
<!--- HC: Fix SSL socket connections timing out due to the BufferedReader (locInput) never reporting itself as ready(). ---> | |
<cfif getProperty("UseSSL")> | |
<!--- SSL connections will not be reported as "ready" by the BufferedReader until a read()/readLine() has been triggered first. ---> | |
<cfset outputStream.write(locInput.read())> | |
</cfif> | |
</cfloop> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment