Choses best reply socket now.
FossilOrigin-Name: 842fac75485981afcd5d6c637155df9551bbf2de5af3d9e621ac5471b8cf686c
This commit is contained in:
		| @ -493,10 +493,13 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr) | |||||||
|  |  | ||||||
|  |  | ||||||
| 	int replyfd; | 	int replyfd; | ||||||
| 	if (srcaddr->sa_family == AF_INET | 	if (socklist[socklistindex].type != SOCKLIST_UNICAST_SOCKET) { | ||||||
| 	    && socklist[socklistindex].type != SOCKLIST_UNICAST_SOCKET) { | 		extern int socklist_find_reply_socket(struct sockaddr *sa,int port); | ||||||
| 		extern int socklist_find_reply_socket(struct sockaddr *sa); |  | ||||||
| 		replyfd = socklist_find_reply_socket(srcaddr); |  | ||||||
|  | 		int port=sock_getport(&socklist[socklistindex].addr); | ||||||
|  | 		replyfd = socklist_find_reply_socket(srcaddr,port); | ||||||
|  |  | ||||||
| 		if (replyfd == -1) { | 		if (replyfd == -1) { | ||||||
| 			cw_log(LOG_ERR, "Can't find reply socket for request from %s", | 			cw_log(LOG_ERR, "Can't find reply socket for request from %s", | ||||||
| 			       sock_addr2str(srcaddr)); | 			       sock_addr2str(srcaddr)); | ||||||
| @ -511,6 +514,13 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr) | |||||||
|  |  | ||||||
| 	int sockfd = replyfd;	//socklist[socklistindex].reply_sockfd; | 	int sockfd = replyfd;	//socklist[socklistindex].reply_sockfd; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | 	struct sockaddr dbgaddr; | ||||||
|  | 	socklen_t dbgaddrl=sizeof(dbgaddr); | ||||||
|  | 	getsockname(sockfd,&dbgaddr,&dbgaddrl); | ||||||
|  |  | ||||||
|  | 	cw_dbg(DBG_INFO,"Creating wtpman with socket %d, %s:%d",sockfd,sock_addr2str(&dbgaddr),sock_getport(&dbgaddr)); | ||||||
|  |  | ||||||
| 	wtpman->conn = conn_create(sockfd, srcaddr, 100); | 	wtpman->conn = conn_create(sockfd, srcaddr, 100); | ||||||
| 	if (!wtpman->conn) { | 	if (!wtpman->conn) { | ||||||
| 		wtpman_destroy(wtpman); | 		wtpman_destroy(wtpman); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user