コード例 #1
0
        public static Entry Export(Session session, bool requestOnly = false)
        {
            var entry = new Entry();
            entry.startedDateTime = session.Timers.ClientBeginRequest.ToString("o");
            entry.request = GetRequest(session);
            if (!requestOnly)
            {
                entry.response = GetResponse(session);
            }

            entry.timings = GetTimings(session.Timers);
            entry.comment = session["ui-comments"];

            entry.time = GetTotalTime(entry.timings);

            if (
                !string.IsNullOrEmpty(session["ui-comments"])
                // <-- not sure if this is correct, maybe a typo or missing assignation in BasicFormats?
                && !session.isFlagSet(SessionFlags.SentToGateway))
            {
                entry.serverIPAddress = session.m_hostIP;
            }
            entry.connection = session.clientPort.ToString(CultureInfo.InvariantCulture);
            return entry;
        }