|

100精币
请教一下大佬们,CCHTTP写的接口,操作数据库,软件的内存占用会越来越高,直到崩溃是什么情况,使用的全是模块中的命令,使用的模块中的连接池来操作数据库的
请问有人遇到同样的问题吗,我这基本上两天就会崩
我这是一套网络验证系统,下面是心跳部分的代码
请大佬帮我分析一下可能的原因,万分感激!!!
变量名 | 类 型 | 静态 | 数组 | 备 注 | 局_接口 | CC接口 | | | 局_数据 | 文本型 | | | 局_json | json对象 | | | 局_回复json | json对象 | | | 局_请求ip | 文本型 | | | 局_用户名 | 文本型 | | | 局_token | 文本型 | | | 局_通行口令 | 文本型 | | | i | 整数型 | | | 局_用户组id | 整数型 | | | 局_用户组key | 文本型 | | | 局_程序id | 整数型 | | | 局_用户组json | json对象 | | | 局_程序json | json对象 | | | 局_用户json | json对象 | | | 局_授权json | json对象 | | | 局_程序版本号 | 文本型 | | | 局_机器码 | 文本型 | | | 局_数据库 | CC数据库 | | | 局_cha询结果 | 逻辑型 | | | 局_下标 | 整数型 | | | 取回接口 (参_指针, 局_接口 )局_通行口令 = 文本_取出中间文本_CC (局_接口. 取地址 (), “/”, “/”, , ) 计次循环首 (取数组成员数 (全_客户连接池s ), i ) 如果真 (全_客户连接池s [i ].通行口令 = 局_通行口令 )  局_下标 = i  跳出循环 ()  计次循环尾 ()全_客户连接池s [局_下标 ].连接池. 取连接 (局_数据库 )局_数据 = 局_接口. 取参数 (“data”)局_数据 = 完美_文本解密 (局_数据, 局_通行口令 ) 如果真 (局_json. 解析 (局_数据, ) = 假) 局_回复json. 置整数 (“code”, #通用错误_非法请求, ) 局_回复json. 置文本 (“msg”, “非法请求”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_通行口令, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 局_请求ip = 局_接口. 取请求IP ()局_用户组id = 局_json. 取整数 (“用户组id”, )局_用户组key = 局_json. 取文本 (“用户组key”, )局_机器码 = 局_json. 取文本 (“机器码”, )局_程序id = 局_json. 取整数 (“程序id”, )局_程序版本号 = 局_json. 取文本 (“程序版本号”, )局_用户名 = 局_json. 取文本 (“用户名”, )局_token = 局_json. 取文本 (“token”, ) 如果真 (局_数据库. cha询头条 (局_用户组json, “select * from 用户_用户组 where 用户组_id = '” + 到文本 (局_用户组id ) + “' and 用户组_key='” + 局_用户组key + “' and 删除='0'”, ) = 假) 局_回复json. 置整数 (“code”, #通用错误_用户组key错误, ) 局_回复json. 置文本 (“msg”, “用户组id 或 key错误”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_通行口令, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 判断 (校验_是否为邮箱_CC (局_用户名 ))  局_用户名 = 到小写 (局_用户名 ) 局_cha询结果 = 局_数据库. cha询头条 (局_用户json, “select * from 用户_用户表 where 用户_邮箱 = '” + 局_用户名 + “' and 用户_用户组id='” + 到文本 (局_用户组id ) + “' and 删除='0'”, ) 局_cha询结果 = 局_数据库. cha询头条 (局_用户json, “select * from 用户_用户表 where 用户_用户名 = '” + 局_用户名 + “' and 用户_用户组id='” + 到文本 (局_用户组id ) + “' and 删除='0'”, ) 如果真 (局_cha询结果 = 假) 局_回复json. 置整数 (“code”, #客户_心跳错误_用户名不存在, ) 局_回复json. 置文本 (“msg”, “用户名或邮箱不存在”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_用户json. 取整数 (“用户_封禁”, ) = 1 ) 局_回复json. 置整数 (“code”, #客户_心跳错误_用户封禁, ) 局_回复json. 置文本 (“msg”, “用户已被封禁”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_数据库. cha询头条 (局_程序json, “select * from 用户_程序 where 程序_id = '” + 到文本 (局_程序id ) + “' and 程序_用户组id='” + 到文本 (局_用户组id ) + “' and 删除='0'”, ) = 假) 局_回复json. 置整数 (“code”, #客户_心跳错误_程序id错误, ) 局_回复json. 置文本 (“msg”, “程序id错误”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_程序json. 取整数 (“程序_运营”, ) = 0 ) 局_回复json. 置整数 (“code”, #客户_心跳错误_程序停运, ) 局_回复json. 置文本 (“msg”, 局_程序json. 取文本 (“程序_名称”, ) + “ 已停止运营”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_数据库. cha询头条 (局_授权json, “select * from 用户_程序_授权 where 授权_用户id = '” + 到文本 (局_用户json. 取整数 (“用户_id”, )) + “' and 授权_程序id='” + 到文本 (局_程序id ) + “' and 删除='0'”, ) = 假) 局_回复json. 置整数 (“code”, #客户_心跳错误_授权删除, ) 局_回复json. 置文本 (“msg”, “您没有 ” + 局_程序json. 取文本 (“程序_名称”, ) + “ 的授权信息”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_授权json. 取整数 (“授权_在线状态”, ) = 0 ) 局_回复json. 置整数 (“code”, #客户_心跳错误_用户离线, ) 局_回复json. 置文本 (“msg”, “用户已离线”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_授权json. 取整数 (“授权_封禁”, ) = 1 ) 局_回复json. 置整数 (“code”, #客户_心跳错误_程序封禁, ) 局_回复json. 置文本 (“msg”, “您已被禁止使用 ” + 局_程序json. 取文本 (“程序_名称”, ), ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_授权json. 取文本 (“授权_机器码”, ) ≠ 局_机器码 且 局_程序json. 取整数 (“程序_绑定方式”, ) = 1 ) 局_回复json. 置整数 (“code”, #客户_心跳错误_换绑机器, ) 局_回复json. 置文本 (“msg”, “请绑定当前设备后使用”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_授权json. 取文本 (“授权_机器码”, ) ≠ 局_机器码 且 局_程序json. 取整数 (“程序_绑定方式”, ) = 2 ) 局_回复json. 置整数 (“code”, #客户_心跳错误_禁止换绑, ) 局_回复json. 置文本 (“msg”, “未绑定当前设备,且不可换绑,无法使用”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (到长整数 (局_授权json. 取文本 (“授权_到期时间”, )) ≤ 时间_取现行时间戳1 ())  局_回复json. 置整数 (“code”, #客户_心跳错误_到期, ) 局_回复json. 置文本 (“msg”, “您的 ” + 局_程序json. 取文本 (“程序_名称”, ) + “ 已到期,请充值后使用”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (到长整数 (局_授权json. 取文本 (“授权_心跳时间”, )) + 10 × #一分钟 < 时间_取现行时间戳1 ())  局_回复json. 置整数 (“code”, #客户_心跳错误_心跳超时, ) 局_回复json. 置文本 (“msg”, “心跳超时,已离线”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 如果真 (局_授权json. 取文本 (“授权_token”, ) ≠ 局_token 且 局_程序json. 取整数 (“程序_同时登录”, ) = 0 ) 局_回复json. 置整数 (“code”, #客户_心跳错误_无效token, ) 局_回复json. 置文本 (“msg”, “无效token(异地登陆)”, ) 局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), ) 全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 ) 返回 (假) 局_数据库. 执行SQL (SQL_更新数据 (“用户_程序_授权”, “授权_心跳时间='” + 到文本 (时间_取现行时间戳1 ()) + “'”, “授权_用户id='” + 到文本 (局_用户json. 取整数 (“用户_id”, )) + “' and 授权_程序id='” + 到文本 (局_程序json. 取整数 (“程序_id”, )) + “'”), , , , , )局_回复json. 置整数 (“code”, #成功, )局_回复json. 置文本 (“msg”, “心跳正常”, )局_用户json. 删除 (“用户_密码”, , )局_回复json. 置对象 (“用户信息”, 局_用户json, )局_授权json. 清空 ()局_数据库. cha询头条 (局_授权json, “select * from 用户_程序_授权 where 授权_用户id = '” + 到文本 (局_用户json. 取整数 (“用户_id”, )) + “' and 授权_程序id='” + 到文本 (局_程序id ) + “' and 删除='0'”, )局_回复json. 置对象 (“授权信息”, 局_授权json, )局_接口. 回复文本 (完美_文本加密 (局_回复json. 到JSON (), 局_用户组key, 10, 2 ), )全_客户连接池s [局_下标 ].连接池. 释放连接 (局_数据库 )返回 (真)
|
|