
mcramer at pbs
Oct 23, 2001, 11:51 AM
Post #1 of 2
(1597 views)
Permalink
|
|
Multiple server instances on one machine
|
|
This is a multi-part message in MIME format. --------------060808000702090108010704 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Here's a small patch that should fix the case where two apache instances are running on different ports, on the same machine, broadcasting the same IP address. Very simply, when adding a machine to the serverstats list it should check to see if an entry exists which matches BOTH the IP address and port, not just the IP. With this patch all the instances show up properly on the backhand-handler page. --Mike Cramer --------------060808000702090108010704 Content-Type: text/plain; name="sin_port-compare.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sin_port-compare.patch" Index: mod_backhand/back_util.c =================================================================== RCS file: /storage/cvs/jesus/mod_backhand/back_util.c,v retrieving revision 1.15 diff -u -r1.15 back_util.c --- mod_backhand/back_util.c 2001/07/06 01:09:38 1.15 +++ mod_backhand/back_util.c 2001/10/23 18:49:46 @@ -517,9 +517,10 @@ astat.mtime = time(NULL); /* Copy it into the shared memory... if it is already there */ for(j=-1, i=0; i<MAXSERVERS; i++) { /* as if has been inserted */ - if(memcmp(&(serverstats[i].contact.sin_addr), + if((memcmp(&(serverstats[i].contact.sin_addr), &astat.contact.sin_addr, - sizeof(struct in_addr))==0) { + sizeof(struct in_addr))==0) && + (serverstats[i].contact.sin_port == astat.contact.sin_port)) { memcpy(&serverstats[i], &astat, sizeof(serverstat)); j=-1; /* has been inserted */ break; --------------060808000702090108010704--
|