Very odd problem running squid 2.7 on Windows

From: Guido Serassio <guido.serassio_at_acmeconsulting.it>
Date: Sat, 23 May 2009 19:08:37 +0200

Hi,

One user has reported a very strange problem using cache_peer
directive on 2.7 STABLE6 running on Windows:

When using the following config:

cache_peer 192.168.0.63 parent 3329 0 no-query
cache_peer rea.acmeconsulting.loc parent 3328 3130

the result is always:

2009/05/23 12:35:28| Configuring 192.168.0.63 Parent 192.168.0.63/3329/0
2009/05/23 12:35:28| Configuring rea.acmeconsulting.loc Parent
rea.acmeconsulting.loc/13/3130

Very odd ....

Debugging the code, I have found where is situated the problem.

The following if GetService() from cache_cf.c:

static u_short
GetService(const char *proto)
{
     struct servent *port = NULL;
     char *token = strtok(NULL, w_space);
     if (token == NULL) {
         self_destruct();
         return -1; /* NEVER REACHED */
     }
     port = getservbyname(token, proto);
     if (port != NULL) {
         return ntohs((u_short) port->s_port);
     }
     return xatos(token);
}

When the value of port->s_port is 3328, ntohs() always returns 13.
Other values seems to work fine.

Any idea ?

Regards

Guido

-
========================================================
Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135 Fax. : +39.011.9781115
Email: guido.serassio_at_acmeconsulting.it
WWW: http://www.acmeconsulting.it/
Received on Sat May 23 2009 - 17:09:37 MDT

This archive was generated by hypermail 2.2.0 : Mon May 25 2009 - 12:00:02 MDT