Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only do parseTimeout for servers

  • Loading branch information...
commit b31d0ea634707c2ca64d740b2a835dbf4c9bc94f 1 parent a889fdd
@embedthis authored
Showing with 16 additions and 16 deletions.
  1. +7 −0 Makefile
  2. +1 −2  README.md
  3. +8 −14 src/deps/http/httpLib.c
View
7 Makefile
@@ -34,10 +34,17 @@ else
endif
MAKE:= projects/windows.bat $(ARCH)
EXT := nmake
+else
+ ARCH:= $(shell uname -m | sed 's/i.86/x86/;s/x86_64/x64/')
endif
all compile:
$(MAKE) -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) $@
+ @echo ; echo 'You can now run Appweb via: "make run"'
+ @echo ; echo "To run manually, put $(OS)-$(ARCH)-$(PROFILE)/bin in your path" ; echo
+
+run:
+ sudo $(OS)-$(ARCH)-$(PROFILE)/bin/appweb --home src/server -v
clean clobber:
$(MAKE) -f projects/$(NAME)-$(OS)-$(PROFILE).$(EXT) $@
View
3  README.md
@@ -35,8 +35,7 @@ Images are built into */bin. The build configuration is saved in */inc/bit.h.
sudo bit run
This will run appweb in the src/server directory using the src/server/appweb.conf configuration file.
-To run appweb manually, you will need to put the target bin directory in your PATH. This is under
-OS-ARCH-PROFILE/bin.
+To run appweb manually, you will need to put the target bin directory (OS-ARCH-PROFILE/bin) in your PATH.
### To Install:
View
22 src/deps/http/httpLib.c
@@ -3489,14 +3489,12 @@ PUBLIC void httpStopEndpoint(HttpEndpoint *endpoint)
*/
PUBLIC bool httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn)
{
- HttpLimits *limits;
- Http *http;
- cchar *action;
- int count, level, dir;
+ HttpLimits *limits;
+ Http *http;
+ int count, level, dir;
limits = conn->limits;
dir = HTTP_TRACE_RX;
- action = "unknown";
assure(conn->endpoint == endpoint);
http = endpoint->http;
@@ -3525,7 +3523,6 @@ PUBLIC bool httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn
}
mprAddKey(endpoint->clientLoad, conn->ip, ITOP(count + 1));
endpoint->clientCount = (int) mprGetHashLength(endpoint->clientLoad);
- action = "open conn";
dir = HTTP_TRACE_RX;
break;
@@ -3537,7 +3534,6 @@ PUBLIC bool httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn
mprRemoveKey(endpoint->clientLoad, conn->ip);
}
endpoint->clientCount = (int) mprGetHashLength(endpoint->clientLoad);
- action = "close conn";
dir = HTTP_TRACE_TX;
break;
@@ -3551,7 +3547,6 @@ PUBLIC bool httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn
}
endpoint->requestCount++;
conn->rx->flags |= HTTP_LIMITS_OPENED;
- action = "open request";
dir = HTTP_TRACE_RX;
break;
@@ -3560,7 +3555,6 @@ PUBLIC bool httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn
/* Requests incremented only when conn->rx is assigned */
endpoint->requestCount--;
assure(endpoint->requestCount >= 0);
- action = "close request";
dir = HTTP_TRACE_TX;
conn->rx->flags &= ~HTTP_LIMITS_OPENED;
}
@@ -3574,7 +3568,6 @@ PUBLIC bool httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn
mprLog(2, "Too many concurrent processes %d/%d", http->processCount, limits->processMax);
return 0;
}
- action = "start process";
dir = HTTP_TRACE_RX;
break;
@@ -3585,12 +3578,12 @@ PUBLIC bool httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn
}
if (event == HTTP_VALIDATE_CLOSE_CONN || event == HTTP_VALIDATE_CLOSE_REQUEST) {
if ((level = httpShouldTrace(conn, dir, HTTP_TRACE_LIMITS, NULL)) >= 0) {
- LOG(4, "Validate request for %s. Active connections %d, active requests: %d/%d, active client IP %d/%d",
- action, mprGetListLength(http->connections), endpoint->requestCount, limits->requestMax,
+ LOG(4, "Validate request for %d. Active connections %d, active requests: %d/%d, active client IP %d/%d",
+ event, mprGetListLength(http->connections), endpoint->requestCount, limits->requestMax,
endpoint->clientCount, limits->clientMax);
}
}
-#if KEEP
+#if UNUSED
LOG(0, "Validate Active connections %d, requests: %d/%d, IP %d/%d, Processes %d/%d",
mprGetListLength(http->connections), endpoint->requestCount, limits->requestMax,
endpoint->clientCount, limits->clientMax, http->processCount, limits->processMax);
@@ -4929,7 +4922,8 @@ static void httpTimer(Http *http, MprEvent *event)
limits = conn->limits;
if (!conn->timeoutEvent) {
abort = 0;
- if (conn->state < HTTP_STATE_PARSED && (conn->started + limits->requestParseTimeout) < http->now) {
+ if (conn->endpoint && conn->state < HTTP_STATE_PARSED &&
+ (conn->started + limits->requestParseTimeout) < http->now) {
abort = 1;
} else if ((conn->lastActivity + limits->inactivityTimeout) < http->now ||
(conn->started + limits->requestTimeout) < http->now) {
Please sign in to comment.
Something went wrong with that request. Please try again.