private static string GetCmdTypeFromHttpModel(ReqRse reqres)
        {
            string cmd;

            if (reqres.Req.Content.Length == 0)
            {
                cmd = reqres.Req.Head;
            }
            else
            {
                cmd = reqres.Req.Content;
            }

            var ret = "Unkown CMD";

            _ = Common.CommandManager.Commands.Any(c =>
            {
                if (cmd.Contains(c))
                {
                    ret = c;
                    return(true);
                }
                return(false);
            });
            return(ret);
        }
示例#2
0
 private static void ParserCheckNET(List <HttpModel> httplist)
 {
     for (int i = 0; i < httplist.Count;)
     {
         if (i == httplist.Count - 1 && httplist[i].TCP_DestinationPort == 80)
         {
             httplist[i].ErrorCode = ErrorCode.NET_NO_RESPONSE;
             ReqRse reqRse = new ReqRse();
             reqRse.Req = httplist[i];
             list.Add(reqRse);
             i++;
             continue;
         }
         if (httplist[i].TCP_DestinationPort == 80 && httplist[i + 1].TCP_DestinationPort != 80)
         {
             //req+res
             if (httplist[i].Time - httplist[i + 1].Time > (ulong)timeout * 100000)
             {
             }
             else
             {
                 httplist[i].ErrorCode     = ErrorCode.NET_TIMEOUT;
                 httplist[i + 1].ErrorCode = ErrorCode.NET_TIMEOUT;
             }
             ReqRse reqRse = new ReqRse();
             reqRse.Req = httplist[i];
             reqRse.Res = httplist[i + 1];
             list.Add(reqRse);
             i += 2;
         }
         else if (httplist[i].TCP_DestinationPort == 80 && httplist[i + 1].TCP_DestinationPort == 80)
         {
             //req+req
             httplist[i].ErrorCode = ErrorCode.NET_NO_RESPONSE;
             ReqRse reqRse = new ReqRse();
             reqRse.Req = httplist[i];
             list.Add(reqRse);
             i++;
         }
         else if (httplist[i].TCP_DestinationPort != 80 && httplist[i + 1].TCP_DestinationPort != 80)
         {
             //res+res
             httplist[i].ErrorCode = ErrorCode.NET_NO_RESPONSE;
             ReqRse reqRse = new ReqRse();
             reqRse.Res = httplist[i];
             list.Add(reqRse);
             i++;
         }
     }
 }
 private static int GetReqResIntervalFromHttpModel(ReqRse reqres)
 {
     return(0);
 }