浏览代码

tcp: typo fixes when blacklisting on error

- because of a '=' instead of a '==' a tcp connection that failed
  after some time was always blacklisted with BLST_ERR_CONNECT
  (even in cases when BLST_ERR_SEND should have been used).
- same thing for blacklisting on read failure.

Reported-by: Libor Chocholaty <[email protected]>
Andrei Pelinescu-Onciul 16 年之前
父节点
当前提交
71eae780d5
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      tcp_main.c
  2. 1 1
      tcp_read.c

+ 1 - 1
tcp_main.c

@@ -3498,7 +3498,7 @@ inline static int handle_tcpconn_ev(struct tcp_connection* tcpconn, short ev,
 							tcpconn);
 			}
 			if (unlikely(ev & POLLERR)){
-				if (unlikely(tcpconn->state=S_CONN_CONNECT)){
+				if (unlikely(tcpconn->state==S_CONN_CONNECT)){
 #ifdef USE_DST_BLACKLIST
 					if (cfg_get(core, core_cfg, use_dst_blacklist))
 						dst_blacklist_su(BLST_ERR_CONNECT, tcpconn->rcv.proto,

+ 1 - 1
tcp_read.c

@@ -149,7 +149,7 @@ again:
 				bytes_read=0; /* nothing has been read */
 			}else if (errno == EINTR) goto again;
 			else{
-				if (unlikely(c->state=S_CONN_CONNECT)){
+				if (unlikely(c->state==S_CONN_CONNECT)){
 					switch(errno){
 						case ECONNRESET:
 #ifdef USE_DST_BLACKLIST