فهرست منبع

Fix for Visual Studio 2010/2012

bel2125 5 سال پیش
والد
کامیت
1aa46785ec
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      src/civetweb.c

+ 3 - 1
src/civetweb.c

@@ -18169,9 +18169,11 @@ consume_socket(struct mg_context *ctx, struct socket *sp, int thread_index)
 static void
 static void
 produce_socket(struct mg_context *ctx, const struct socket *sp)
 produce_socket(struct mg_context *ctx, const struct socket *sp)
 {
 {
+	int queue_filled;
+
 	(void)pthread_mutex_lock(&ctx->thread_mutex);
 	(void)pthread_mutex_lock(&ctx->thread_mutex);
 
 
-	int queue_filled = ctx->sq_head - ctx->sq_tail;
+	queue_filled = ctx->sq_head - ctx->sq_tail;
 
 
 	/* If the queue is full, wait */
 	/* If the queue is full, wait */
 	while ((ctx->stop_flag == 0) && (queue_filled >= ctx->sq_size)) {
 	while ((ctx->stop_flag == 0) && (queue_filled >= ctx->sq_size)) {