On Fri, 2006-08-18 at 11:53 +0100, Simon Slaytor wrote:
Ok, I'm no programmer so forgive me if this is wrong.
I've added the following line to the SESS_IP section in svc.c,
immediately following the pri = 0; line.
from_host is structure. Try printing out addr instead, as it contains
just the information you want. Ideally use inet_ntoa for a
I've also added the following line, immediately before the break; statement.
res is a pointer to a structure, but the results are good enough.
I've then set pound to not run as a daemon.
Ok the the following is the output I get.
When connecting from host 10.190.66.66
When connecting from host 10.190.70.70
As a matter of interest I also added the latter printf statement just
prior to the break; in the SESS_NONE section.
When running with 'no sessions' I get the following output:
Backend -2029771520 <- client connects to server 1
Backend -2029771008 <-client connects to server 2
The sequence is obviously random.
I hope thats what your after, if not treat me as an idiot and tell me
what you want.
That is almost what we need. If you could change the printing of
from_host as described above it would be very helpful, if you could also
show the value of pri it would be even better. The code would look a bit
/* "sticky" mappings */
fprintf(stderr, "from_host: %s\n", inet_ntoa(&from_host));
addr = from_host.s_addr;
pri = 0;
pri = (pri << 3) ^ (addr & 0xff);
addr = (addr >> 8);
fprintf(stderr, "pri: %d\n", pri & 0xffff);
res = rand_backend(svc->backends, (pri & 0xffff) %svc->tot_pri);
fprintf(stderr, "backend %ld\n",res);
I sincerely hope you don't think this is idiot-like treatment - we are
certainly interested in your feedback and we would like to fix the bug
rather than insult people.