ASP Page Returning Connection Reset – IIS

  asp.net, asp.net-core, iis, iis-8, windows

Background:
Multiple IIS sites running with an ASP page that displays either ‘Pass’ or ‘Fail’ based on some string parsing on another local page. Locally this works great, it’ll update Pass/Fail in a matter of seconds.

Issue:
When hitting the site externally from the servers it has no problem displaying ‘Pass’ but when the page is called and conditions are right to display ‘Fail’ it’ll load just fine externally for about 1 minute before it starts returning a Connection Reset error. As soon as conditions meet requirements to display ‘Pass’ the site loads externally fine again.

Any idea what my issue could be?

Edit – Added code with PI ommitted

Windows Server 2012 | IIS-8 | Classic ASP

<%@ ENABLESESSIONSTATE=False %>
<%
On Error Resume Next
Function loadpage(strPageText, strInputURL)
    Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
    objXMLHTTP.Open "GET", strInputURL, True
    objXMLHTTP.Send
    If objXMLHTTP.WaitForResponse(1) Then
        strPageText = objXMLHTTP.responseText
    Else 
        strPageText = "false"
    End If
    Set objXMLHTTP = Nothing    
End Function

Dim strPageText, strInputURL, strResult, serverName, pathTrans, a,applicationName, strStart, strEnd, strHTML, stringName, env, platform, serviceName, b, dc, deadOrAlive

Set objWSHNetwork = Server.CreateObject("WScript.Network")
serverName =  objWSHNetwork.ComputerName
pathTrans = Request.ServerVariables("PATH_TRANSLATED")

b=Split(serverName,"-")
dc = b(0)

Set objWSHNetwork = Nothing

a=Split(pathTrans,"")
serviceName = a(4)
env = a(3)
platform = a(2)
applicationName = UCase(serviceName)


FUNCTION GrabTheContent(strStart, strEnd)
    Dim strStartPos, strEndPos, strLength
    strStartPos = 0
    strEndPos = 0
    strLength = 0
    'Find the Start Position of the Search String
    strStartPos = instr(strPageText,strStart)
    'Starting from the Search String start position and call it the end position
    strEndPos = instr(strStartPos, strPageText, strEnd)
    'Compute the length of the string in between the start and end positions
    strLength = strEndPos - strStartPos
    'filter the content, use trim to eliminate leading and trailing spaces
    myContent = trim(mid(strPageText,strStartPos, len(strStart))) & "<br/>" & vbCRLF
    myContent = myContent & trim(mid(strPageText,strStartPos + len(strStart), StrLength - len(strStart))) & "<br/>" & vbCRLF
    GrabTheContent = myContent
End FUNCTION

strInputURL = "http://localhost:<PORT>"
stringName = serviceName+"-"+serverName+"-"+platform+"<STRING HERE></id>"
strDeadAlive = serviceName+"-"+serverName+"-<STRING HERE></id>"
'strResult = "Fail:"

loadpage strPageText, strInputURL
strHTML = GrabTheContent(stringName,"</success>")
deadOrAlive = GrabTheContent(strDeadAlive,"</success>")


If InStr(1, strHTML, "true") AND InStr(1, deadOrAlive, "true") > 0 then
  %><font color="green"><b>Pass:</b></font><%
Else
  %><font color="red"><b>Fail:</b></font><%
End If


%>

Source: Windows Questions

LEAVE A COMMENT