Optimized WebContext.requestParts

main
Inga 🏳‍🌈 15 years ago
parent 9abf42aa9a
commit e89435944f
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      Builder/IISUploadHandler/build.txt
  3. 10
      IISMainHandler/WebContext.cs

@ -20,9 +20,17 @@ namespace FLocal.IISHandler {
} }
private object requestParts_Locker = new object(); private object requestParts_Locker = new object();
private string[] requestParts_Data = null;
public string[] requestParts { public string[] requestParts {
get { get {
return Cache<string[]>.instance.get(requestParts_Locker, () => this.httprequest.Path.Split("/", StringSplitOptions.RemoveEmptyEntries)); if(this.requestParts_Data == null) {
lock(this.requestParts_Locker) {
if(this.requestParts_Data == null) {
this.requestParts_Data = this.httprequest.Path.Split("/", StringSplitOptions.RemoveEmptyEntries);
}
}
}
return this.requestParts_Data;
} }
} }

Loading…
Cancel
Save