def test_appid_exist(ssl_sock, appid):
request_data = 'GET /_gh/ HTTP/1.1\r\nHost: %s.appspot.com\r\n\r\n' % appid
ssl_sock.send(request_data.encode())
response = httplib.HTTPResponse(ssl_sock, buffering=True)
response.begin()
if response.status == 404:
#xlog.warn("app check %s status:%d", appid, response.status)
return False
if response.status == 503:
# out of quota
return True
if response.status != 200:
xlog.warn("test appid %s status:%d", appid, response.status)
content = response.read()
if "GoAgent" not in content:
#xlog.warn("app check %s content:%s", appid, content)
return False
return True
评论列表
文章目录