<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If not IsNumeric(Request ("id"))  Then
response.write "id非法"
response.End
End if

'response.write Request.ServerVariables("HTTP_FreeHostsyn")
'response.End

'120s
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsCDNserver = Server.CreateObject("ADODB.Recordset")	
'	Sql="Select * from FreeHost.FreeHost_ServerCDNlist where id='"&Request ("id")&"'"
Sql="Select * from FreeHost.FreeHost_ServerCDNlist where id='"&Request ("id")&"' and (iserr=0 or iserr is null) and (lastchangetime>lastSYNtime or lastSYNtime is null or lastchangetime is null)"
If Request ("op")="doing" Then
	dsCDNserver.Open Sql,conn,1,1
else
	dsCDNserver.Open Sql,conn,1,3
End if
if not dsCDNserver.Eof then

If md5(dsCDNserver("FreeHostsharekey")&"lsoftsystem2.0")<>Request.ServerVariables("HTTP_FreeHostsyn")  Then
response.write "synkey非法"
response.End
End if


squid=Replace(dsCDNserver("squidHead")&vbcrlf&"access_log "&dsCDNserver("logpath")&"access.log combined"&vbcrlf&dsCDNserver("squid"),vbcrlf&vbcrlf,vbcrlf)

If Request ("op")="doing" Then
response.write squid
Else
dsCDNserver("lastSYNtime")=Now
dsCDNserver.update
response.write "状态更新完成"
End If


else
response.write "none id"
response.End
End if

%>