Browse Source

Fix bug in mg_poll for negative timeout

See also https://github.com/civetweb/civetweb/issues/891#issuecomment-657036856
bel2125 5 years ago
parent
commit
8011417bcb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -6402,7 +6402,7 @@ mg_poll(struct mg_pollfd *pfd,
 			milliseconds -= ms_now;
 		}
 
-	} while (milliseconds != 0);
+	} while (milliseconds > 0);
 
 	/* timeout: return 0 */
 	return 0;
@@ -18615,7 +18615,7 @@ produce_socket(struct mg_context *ctx, const struct socket *sp)
 	/* If the queue is full, wait */
 	while (STOP_FLAG_IS_ZERO(&ctx->stop_flag)
 	       && (queue_filled >= ctx->sq_size)) {
-		ctx->sq_blocked = 1; /* Status information: All threads bussy */
+		ctx->sq_blocked = 1; /* Status information: All threads busy */
 #if defined(USE_SERVER_STATS)
 		if (queue_filled > ctx->sq_max_fill) {
 			ctx->sq_max_fill = queue_filled;