Ejemplo n.º 1
0
        /// <summary>
        /// 获取session对应的包
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        public Packet GetPacket(Session session)
        {
            Packet packet = null;

            if (PHPersistence != null)
            {
                packet = PHPersistence.Load(session.url);
            }
            if (packet == null)
            {
                packet = new Packet(session.url, session.ResponseHeaders);
            }
            return(packet);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 过滤session
        /// </summary>
        /// <param name="session"></param>
        public void FilterSession(Session session)
        {
            if (Disabled && RuleList.Match(session))
            {
                if (PHPersistence != null) //保存请求头
                {
                    Packet p = new Packet(session.url, session.ResponseHeaders);
                    if (p.HasData())
                    {
                        PHPersistence.Save(p);
                    }
                }

                if (HttpHeaderProcess != null)
                {
                    HttpHeaderProcess.Do(session);
                }
            }
        }