Browse code

- fixed wrong size in lots of su2a() calls

Andrei Pelinescu-Onciul authored on 22/05/2008 16:08:52
Showing 1 changed files
... ...
@@ -1623,7 +1623,7 @@ no_id:
1623 1623
 				if (unlikely(*tcp_connections_no >= tcp_max_connections)){
1624 1624
 					LOG(L_ERR, "ERROR: tcp_send %s: maximum number of"
1625 1625
 								" connections exceeded (%d/%d)\n",
1626
-								su2a(&dst->to, sizeof(&dst->to)),
1626
+								su2a(&dst->to, sizeof(dst->to)),
1627 1627
 								*tcp_connections_no, tcp_max_connections);
1628 1628
 					return -1;
1629 1629
 				}
... ...
@@ -1632,7 +1632,7 @@ no_id:
1632 1632
 				if (unlikely(c==0)){
1633 1633
 					LOG(L_ERR, "ERROR: tcp_send %s: could not create new"
1634 1634
 							" connection\n",
1635
-							su2a(&dst->to, sizeof(&dst->to)));
1635
+							su2a(&dst->to, sizeof(dst->to)));
1636 1636
 					return -1;
1637 1637
 				}
1638 1638
 				c->flags|=F_CONN_PENDING|F_CONN_FD_CLOSED;
... ...
@@ -1642,7 +1642,7 @@ no_id:
1642 1642
 				if (unlikely(tcpconn_add(c)==0)){
1643 1643
 					LOG(L_ERR, "ERROR: tcp_send %s: could not add "
1644 1644
 								"connection %p\n",
1645
-								su2a(&dst->to, sizeof(&dst->to)),
1645
+								su2a(&dst->to, sizeof(dst->to)),
1646 1646
 									c);
1647 1647
 					_tcpconn_free(c);
1648 1648
 					n=-1;
... ...
@@ -1652,7 +1652,7 @@ no_id:
1652 1652
 				 * aliases */
1653 1653
 				if (unlikely((fd=tcpconn_finish_connect(c, from))<0)){
1654 1654
 					LOG(L_ERR, "ERROR: tcp_send %s: tcpconn_finish_connect(%p)"
1655
-							" failed\n", su2a(&dst->to, sizeof(&dst->to)),
1655
+							" failed\n", su2a(&dst->to, sizeof(dst->to)),
1656 1656
 								c);
1657 1657
 					goto conn_wait_error;
1658 1658
 				}
... ...
@@ -1678,7 +1678,7 @@ no_id:
1678 1678
 								n=-1;
1679 1679
 								LOG(L_ERR, "ERROR: tcp_send %s: EAGAIN and"
1680 1680
 										" write queue full or failed for %p\n",
1681
-										su2a(&dst->to, sizeof(&dst->to)),
1681
+										su2a(&dst->to, sizeof(dst->to)),
1682 1682
 										c);
1683 1683
 								goto conn_wait_error;
1684 1684
 							}
... ...
@@ -1691,7 +1691,7 @@ no_id:
1691 1691
 							LOG(L_ERR, "BUG: tcp_send %s: "
1692 1692
 										"CONN_NEW_PENDING_WRITE  for %p"
1693 1693
 										" failed:" " %s (%d)\n",
1694
-										su2a(&dst->to, sizeof(&dst->to)),
1694
+										su2a(&dst->to, sizeof(dst->to)),
1695 1695
 										c, strerror(errno), errno);
1696 1696
 							goto conn_wait_error;
1697 1697
 						}
... ...
@@ -1701,7 +1701,7 @@ no_id:
1701 1701
 					/* error: destroy it directly */
1702 1702
 					LOG(L_ERR, "ERROR: tcp_send %s: connect & send "
1703 1703
 										" for %p failed:" " %s (%d)\n",
1704
-										su2a(&dst->to, sizeof(&dst->to)),
1704
+										su2a(&dst->to, sizeof(dst->to)),
1705 1705
 										c, strerror(errno), errno);
1706 1706
 					goto conn_wait_error;
1707 1707
 				}
... ...
@@ -1713,7 +1713,7 @@ no_id:
1713 1713
 										sizeof(response), fd) <= 0)){
1714 1714
 					LOG(L_ERR, "BUG: tcp_send %s: CONN_NEW_COMPLETE  for %p"
1715 1715
 								" failed:" " %s (%d)\n",
1716
-								su2a(&dst->to, sizeof(&dst->to)),
1716
+								su2a(&dst->to, sizeof(dst->to)),
1717 1717
 								c, strerror(errno), errno);
1718 1718
 					goto conn_wait_error;
1719 1719
 				}
... ...
@@ -1722,7 +1722,7 @@ no_id:
1722 1722
 #endif /* TCP_CONNECT_WAIT  && TCP_BUF_WRITE */
1723 1723
 			if (unlikely((c=tcpconn_connect(&dst->to, from, dst->proto))==0)){
1724 1724
 				LOG(L_ERR, "ERROR: tcp_send %s: connect failed\n",
1725
-								su2a(&dst->to, sizeof(&dst->to)));
1725
+								su2a(&dst->to, sizeof(dst->to)));
1726 1726
 				return -1;
1727 1727
 			}
1728 1728
 			atomic_set(&c->refcnt, 2); /* ref. from here and it will also
... ...
@@ -1738,7 +1738,7 @@ no_id:
1738 1738
 			n=send_fd(unix_tcp_sock, response, sizeof(response), c->s);
1739 1739
 			if (unlikely(n<=0)){
1740 1740
 				LOG(L_ERR, "BUG: tcp_send %s: failed send_fd: %s (%d)\n",
1741
-						su2a(&dst->to, sizeof(&dst->to)),
1741
+						su2a(&dst->to, sizeof(dst->to)),
1742 1742
 						strerror(errno), errno);
1743 1743
 				/* we can safely delete it, it's not referenced by anybody */
1744 1744
 				_tcpconn_free(c);
... ...
@@ -1896,7 +1896,7 @@ send_it:
1896 1896
 #endif /* TCP_BUF_WRITE */
1897 1897
 		LOG(L_ERR, "ERROR: tcp_send: failed to send on %p (%s:%d->%s): %s (%d)"
1898 1898
 					"\n", c, ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port,
1899
-					su2a(&c->rcv.src_su, sizeof(&c->rcv.src_su)),
1899
+					su2a(&c->rcv.src_su, sizeof(c->rcv.src_su)),
1900 1900
 					strerror(errno), errno);
1901 1901
 #ifdef TCP_BUF_WRITE
1902 1902
 error:
... ...
@@ -1919,7 +1919,7 @@ error:
1919 1919
 		if (unlikely(fd_cache_e)){
1920 1920
 			LOG(L_ERR, "ERROR: tcp_send %s: error on cached fd, removing from"
1921 1921
 					" the cache (%d, %p, %d)\n", 
1922
-					su2a(&c->rcv.src_su, sizeof(&c->rcv.src_su)),
1922
+					su2a(&c->rcv.src_su, sizeof(c->rcv.src_su)),
1923 1923
 					fd, fd_cache_e->con, fd_cache_e->id);
1924 1924
 			tcp_fd_cache_rm(fd_cache_e);
1925 1925
 			close(fd);