Browse Source

a better fix for problem 123

mom040267 11 years ago
parent
commit
454396e5cc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/apps/relay/ns_ioalib_engine_impl.c

+ 2 - 2
src/apps/relay/ns_ioalib_engine_impl.c

@@ -2687,12 +2687,12 @@ static void socket_input_handler_bev(struct bufferevent *bev, void* arg)
 			size_t cycle = 0;
 			do {
 				if(ioa_socket_tobeclosed(s)) {
-					read_spare_buffer_bev(bev);
+					read_spare_buffer_bev(s->bev);
 					break;
 				}
 				if (socket_input_worker(s) <= 0)
 					break;
-			} while(cycle++<128);
+			} while((cycle++<128) && (s->bev));
 		}
 
 		if((s->magic != SOCKET_MAGIC)||(s->done)) {