Contents
  1. 1. epoll
  • 正则
  • ##

    1
    2
    uWSGI --> Web服务器
    Nginx --> 处理多种请求

    长连接 –> 三次挥手之后,不会断掉连接
    短连接 –> 三次挥手之后,接收到数据,立马四次挥手,断掉连接

    tornado达到高性能的原因:epoll

    epoll

    防止数据库注入攻击,传参数:

    1
    2
    User-name:1' or 1=1 or ('1'='1
    Passwd:a') or '1'='1

    UUID:混淆值,全局(通用)唯一识别码

    正则

    \b单词边界

    1
    2
    3
    4
    5
    # if r 为真,返回r[1],否则undefined
    r[1] if r else undefined
    r ? r[1] : undefined

    前端处理json
    $.ajax({
    url: “/“,
    type: “POST”,
    ContentType: “json”,
    data: json_req,
    headers: {
    “X-XSRFToken”: getCookie(“_xsrf”)
    }
    success: function(data):{
    alert(data);
    }
    });