Browse code

- fixed get_ticks* usage: only get_ticks_raw() must be used and everything must be converted to ticks. Thanks to Alfred E. Heggestad" <aeh@db.org> for spotting this.

Andrei Pelinescu-Onciul authored on 21/02/2007 01:42:25
Showing 1 changed files
... ...
@@ -690,7 +690,7 @@ void tcp_receive_loop(int unix_sock)
690 690
 	fd_set sel_set;
691 691
 	int maxfd;
692 692
 	struct timeval timeout;
693
-	int ticks;
693
+	ticks_t ticks;
694 694
 	
695 695
 	
696 696
 	/* init */
... ...
@@ -750,7 +750,7 @@ void tcp_receive_loop(int unix_sock)
750 750
 					release_tcpconn(con, resp, unix_sock);
751 751
 					goto skip;
752 752
 				}
753
-				con->timeout=get_ticks()+TCP_CHILD_TIMEOUT;
753
+				con->timeout=get_ticks_raw()+S_TO_TICKS(TCP_CHILD_TIMEOUT);
754 754
 				FD_SET(s, &master_set);
755 755
 				if (maxfd<s) maxfd=s;
756 756
 				if (con==list){
... ...
@@ -765,7 +765,7 @@ void tcp_receive_loop(int unix_sock)
765 765
 				tcpconn_listadd(list, con, c_next, c_prev);
766 766
 			}
767 767
 skip:
768
-			ticks=get_ticks();
768
+			ticks=get_ticks_raw();
769 769
 			for (con=list; con ; con=c_next){
770 770
 				c_next=con->c_next; /* safe for removing*/
771 771
 #ifdef EXTRA_DEBUG
... ...
@@ -882,7 +882,7 @@ again:
882 882
 			 * handle_io might decide to del. the new connection =>
883 883
 			 * must be in the list */
884 884
 			tcpconn_listadd(tcp_conn_lst, con, c_next, c_prev);
885
-			con->timeout=get_ticks()+TCP_CHILD_TIMEOUT;
885
+			con->timeout=get_ticks_raw()+S_TO_TICKS(TCP_CHILD_TIMEOUT);
886 886
 			if (io_watch_add(&io_w, s, F_TCPCONN, con)<0){
887 887
 				LOG(L_CRIT, "ERROR: tcp_receive: handle_io: failed to add"
888 888
 						" new socket to the fd list\n");
... ...
@@ -901,7 +901,7 @@ again:
901 901
 				release_tcpconn(con, resp, tcpmain_sock);
902 902
 			}else{
903 903
 				/* update timeout */
904
-				con->timeout=get_ticks()+TCP_CHILD_TIMEOUT;
904
+				con->timeout=get_ticks_raw()+S_TO_TICKS(TCP_CHILD_TIMEOUT);
905 905
 			}
906 906
 			break;
907 907
 		case F_NONE:
... ...
@@ -930,9 +930,9 @@ static inline void tcp_receive_timeout()
930 930
 {
931 931
 	struct tcp_connection* con;
932 932
 	struct tcp_connection* next;
933
-	int ticks;
933
+	ticks_t ticks;
934 934
 	
935
-	ticks=get_ticks();
935
+	ticks=get_ticks_raw();
936 936
 	for (con=tcp_conn_lst; con; con=next){
937 937
 		next=con->c_next; /* safe for removing */
938 938
 		if (con->state<0){   /* kill bad connections */