// Token: 0x06000102 RID: 258 RVA: 0x00007940 File Offset: 0x00005B40 private static LogQuery DeserializeQuery(byte[] query) { ExTraceGlobals.ServiceTracer.TraceDebug(0L, "MsExchangeLogSearch server is entering DeserializeQuery"); MemoryStream stream = new MemoryStream(query); StreamReader textReader = new StreamReader(stream, Encoding.UTF8); LogQuery result; try { LogQuery logQuery = (LogQuery)LogSearchServer.logQuerySerializer.Deserialize(textReader); logQuery.Beginning = LogSearchServer.GetNearestValidDate(logQuery.Beginning); logQuery.End = LogSearchServer.GetNearestValidDate(logQuery.End); result = logQuery; } catch (InvalidOperationException) { throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_BAD_QUERY_XML); } return(result); }
// Token: 0x06000104 RID: 260 RVA: 0x00007A14 File Offset: 0x00005C14 public override byte[] SearchExtensibleSchema(string clientVersion, string logName, byte[] query, bool continueInBackground, int resultLimit, ref int resultSize, ref Guid sessionId, ref bool more, ref int progress, string clientName) { byte[] result; try { ExTraceGlobals.ServiceTracer.TraceDebug((long)this.GetHashCode(), "MsExchangeLogSearch server is entering Search using extensible result schema."); PerfCounters.SearchesProcessed.Increment(); this.WaitForSessionManager(); resultSize = 0; sessionId = Guid.Empty; more = false; progress = 0; if (query.Length > 65536) { ExTraceGlobals.ServiceTracer.TraceError <int>((long)this.GetHashCode(), "Search rejected because the query was too complex. Query length: {0}", query.Length); PerfCounters.SearchesRejected.Increment(); throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_QUERY_TOO_COMPLEX); } Version schemaVersion = new Version(clientVersion); LogSession logSession = this.sessionManager.CreateSession(logName, schemaVersion); try { LogQuery query2 = LogSearchServer.DeserializeQuery(query); logSession.SetQuery(query2); if (LogSearchServer.logger.IsEventCategoryEnabled(MSExchangeTransportLogSearchEventLogConstants.Tuple_LogSearchClientQuery.CategoryId, MSExchangeTransportLogSearchEventLogConstants.Tuple_LogSearchClientQuery.Level)) { LogSearchServer.logger.LogEvent(MSExchangeTransportLogSearchEventLogConstants.Tuple_LogSearchClientQuery, null, new object[] { clientName, Encoding.UTF8.GetString(query) }); } byte[] array = new byte[Math.Min(resultLimit, 1048576)]; resultSize = logSession.Read(array, 0, array.Length, out more, out progress, !continueInBackground); if (more && continueInBackground) { sessionId = logSession.Id; logSession = null; } result = array; } catch (LogSearchException ex) { PerfCounters.SearchesRejected.Increment(); ExTraceGlobals.ServiceTracer.TraceDebug <LogSearchException>((long)logSession.GetHashCode(), "Search was interrupted, Exception: {0}", ex); throw ex; } finally { if (logSession != null) { ExTraceGlobals.ServiceTracer.TraceError <string>((long)this.GetHashCode(), "MsExchangeLogSearch LogSearchServer session {0} Search failed", logSession.Id.ToString()); this.sessionManager.CloseSession(logSession); } } } catch (LogSearchException) { throw; } catch (Exception exception) { ExWatson.SendReportAndCrashOnAnotherThread(exception); result = null; } return(result); }