bool CanExecuteRequest (HttpWorkerRequest req) { if (disposing) return false; int threads, cports; ThreadPool.GetAvailableThreads (out threads, out cports); bool local = (req != null && req.GetLocalAddress () == "127.0.0.1"); return (threads > minFree) || (local && threads > minLocalFree); }
bool CanExecuteRequest(HttpWorkerRequest req) { if (disposing) { return(false); } int threads, cports; ThreadPool.GetAvailableThreads(out threads, out cports); bool local = (req != null && req.GetLocalAddress() == "127.0.0.1"); return((threads > minFree) || (local && threads > minLocalFree)); }
bool CanExecuteRequest(HttpWorkerRequest req) { if (disposing) { return(false); } #if TARGET_J2EE return(true); // The J2EE app server manages the thread pool #else int threads, cports; ThreadPool.GetAvailableThreads(out threads, out cports); bool local = (req != null && req.GetLocalAddress() == "127.0.0.1"); return((threads > minFree) || (local && threads > minLocalFree)); #endif }
private static bool IsLocal(HttpWorkerRequest wr) { string remoteAddress = wr.GetRemoteAddress(); switch (remoteAddress) { case "127.0.0.1": case "::1": return(true); } if (string.IsNullOrEmpty(remoteAddress)) { return(false); } return(remoteAddress == wr.GetLocalAddress()); }
// helpers private static bool IsLocal(HttpWorkerRequest wr) { String remoteAddress = wr.GetRemoteAddress(); // check if localhost if (remoteAddress == "127.0.0.1" || remoteAddress == "::1") return true; // if unknown, assume not local if (String.IsNullOrEmpty(remoteAddress)) return false; // compare with local address if (remoteAddress == wr.GetLocalAddress()) return true; return false; }
// helpers private static bool IsLocal(HttpWorkerRequest wr) { String remoteAddress = wr.GetRemoteAddress(); // check if localhost if (remoteAddress == "127.0.0.1" || remoteAddress == "::1") { return(true); } // if unknown, assume not local if (String.IsNullOrEmpty(remoteAddress)) { return(false); } // compare with local address if (remoteAddress == wr.GetLocalAddress()) { return(true); } return(false); }
bool CanExecuteRequest (HttpWorkerRequest req) { if (disposing) return false; #if TARGET_J2EE return true; // The J2EE app server manages the thread pool #else int threads, cports; ThreadPool.GetAvailableThreads (out threads, out cports); bool local = (req != null && req.GetLocalAddress () == "127.0.0.1"); return (threads > minFree) || (local && threads > minLocalFree); #endif }
private static bool IsLocal(HttpWorkerRequest wr) { string remoteAddress = wr.GetRemoteAddress(); switch (remoteAddress) { case "127.0.0.1": case "::1": return true; } if (string.IsNullOrEmpty(remoteAddress)) { return false; } return (remoteAddress == wr.GetLocalAddress()); }
void loadServerVariablesCollection() { HttpWorkerRequest wr = request.WorkerRequest; if (loaded || (wr == null)) { return; } IsReadOnly = false; Add("ALL_HTTP", Fill(wr, true)); Add("ALL_RAW", Fill(wr, false)); Add("APPL_MD_PATH", wr.GetServerVariable("APPL_MD_PATH")); Add("APPL_PHYSICAL_PATH", wr.GetServerVariable("APPL_PHYSICAL_PATH")); if (null != request.Context.User && request.Context.User.Identity.IsAuthenticated) { Add("AUTH_TYPE", request.Context.User.Identity.AuthenticationType); Add("AUTH_USER", request.Context.User.Identity.Name); } else { Add("AUTH_TYPE", ""); Add("AUTH_USER", ""); } Add("AUTH_PASSWORD", wr.GetServerVariable("AUTH_PASSWORD")); Add("LOGON_USER", wr.GetServerVariable("LOGON_USER")); Add("REMOTE_USER", wr.GetServerVariable("REMOTE_USER")); Add("CERT_COOKIE", wr.GetServerVariable("CERT_COOKIE")); Add("CERT_FLAGS", wr.GetServerVariable("CERT_FLAGS")); Add("CERT_ISSUER", wr.GetServerVariable("CERT_ISSUER")); Add("CERT_KEYSIZE", wr.GetServerVariable("CERT_KEYSIZE")); Add("CERT_SECRETKEYSIZE", wr.GetServerVariable("CERT_SECRETKEYSIZE")); Add("CERT_SERIALNUMBER", wr.GetServerVariable("CERT_SERIALNUMBER")); Add("CERT_SERVER_ISSUER", wr.GetServerVariable("CERT_SERVER_ISSUER")); Add("CERT_SERVER_SUBJECT", wr.GetServerVariable("CERT_SERVER_SUBJECT")); Add("CERT_SUBJECT", wr.GetServerVariable("CERT_SUBJECT")); string sTmp = wr.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentLength); if (null != sTmp) { Add("CONTENT_LENGTH", sTmp); } Add("CONTENT_TYPE", request.ContentType); Add("GATEWAY_INTERFACE", wr.GetServerVariable("GATEWAY_INTERFACE")); Add("HTTPS", wr.GetServerVariable("HTTPS")); Add("HTTPS_KEYSIZE", wr.GetServerVariable("HTTPS_KEYSIZE")); Add("HTTPS_SECRETKEYSIZE", wr.GetServerVariable("HTTPS_SECRETKEYSIZE")); Add("HTTPS_SERVER_ISSUER", wr.GetServerVariable("HTTPS_SERVER_ISSUER")); Add("HTTPS_SERVER_SUBJECT", wr.GetServerVariable("HTTPS_SERVER_SUBJECT")); Add("INSTANCE_ID", wr.GetServerVariable("INSTANCE_ID")); Add("INSTANCE_META_PATH", wr.GetServerVariable("INSTANCE_META_PATH")); Add("LOCAL_ADDR", wr.GetLocalAddress()); Add("PATH_INFO", request.PathInfo); Add("PATH_TRANSLATED", request.PhysicalPath); Add("QUERY_STRING", request.QueryStringRaw); Add("REMOTE_ADDR", request.UserHostAddress); Add("REMOTE_HOST", request.UserHostName); Add("REMOTE_PORT", wr.GetRemotePort().ToString()); Add("REQUEST_METHOD", request.HttpMethod); Add("SCRIPT_NAME", request.FilePath); Add("SERVER_NAME", wr.GetServerName()); Add("SERVER_PORT", wr.GetLocalPort().ToString()); if (wr.IsSecure()) { Add("SERVER_PORT_SECURE", "1"); } else { Add("SERVER_PORT_SECURE", "0"); } Add("SERVER_PROTOCOL", wr.GetHttpVersion()); Add("SERVER_SOFTWARE", wr.GetServerVariable("SERVER_SOFTWARE")); Add("URL", request.FilePath); AddHeaderVariables(wr); IsReadOnly = true; loaded = true; }