client.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:telnet-iot-honeypot 作者: Phype 项目源码 文件源码
def put_sample(self, data, retry=True):

        try:
            r = requests.post(self.url + "/file", auth=self.auth, data=data, timeout=20.0)
        except requests.exceptions.RequestException:
            dbg("Cannot connect to backend")
            return

        if r.status_code == 200:
            return
        elif retry:
            msg = r.raw.read()
            dbg("Backend upload failed, retrying (" + str(msg) + ")")
            return self.put_sample(sha256, filename, False)
        else:
            msg = r.raw.read()
            raise IOError(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号