Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
View | Details | Raw Unified | Return to bug 301828 | Differences between
and this patch

Collapse All | Expand All

(-)squid-3.0.STABLE25.orig/src/cf.data.pre (+54 lines)
Lines 1125-1130 Link Here
1125
	making the request.
1125
	making the request.
1126
DOC_END
1126
DOC_END
1127
1127
1128
NAME: zph_tos_local
1129
TYPE: int
1130
DEFAULT: 0
1131
LOC: Config.zph_tos_local
1132
DOC_START
1133
       Allows you to select a TOS/Diffserv value to mark local hits. Read above
1134
       (tcp_outgoing_tos) for details/requirements about TOS.
1135
       Default: 0 (disabled).
1136
DOC_END
1137
1138
NAME: zph_tos_peer
1139
TYPE: int
1140
DEFAULT: 0
1141
LOC: Config.zph_tos_peer
1142
DOC_START
1143
       Allows you to select a TOS/Diffserv value to mark peer hits. Read above
1144
       (tcp_outgoing_tos) for details/requirements about TOS.
1145
       Default: 0 (disabled).
1146
DOC_END
1147
1148
NAME: zph_tos_parent
1149
COMMENT: on|off
1150
TYPE: onoff
1151
LOC: Config.onoff.zph_tos_parent
1152
DEFAULT: on
1153
DOC_START
1154
       Set this to off if you want only sibling hits to be marked.
1155
       If set to on (default), parent hits are being marked too.
1156
DOC_END
1157
1158
NAME: zph_preserve_miss_tos
1159
COMMENT: on|off
1160
TYPE: onoff
1161
LOC: Config.onoff.zph_preserve_miss_tos
1162
DEFAULT: on
1163
DOC_START
1164
       If set to on (default), any HTTP response towards clients will
1165
       have the TOS value of the response comming from the remote
1166
       server masked with the value of zph_preserve_miss_tos_mask.
1167
       For this to work correctly, you will need to patch your linux
1168
       kernel with the TOS preserving ZPH patch.
1169
DOC_END
1170
1171
NAME: zph_preserve_miss_tos_mask
1172
TYPE: int
1173
DEFAULT: 255
1174
LOC: Config.zph_preserve_miss_tos_mask
1175
DOC_START
1176
       Allows you to mask certain bits in the TOS received from the
1177
       remote server, before copying the value to the TOS send towards
1178
       clients.
1179
       Default: 255 (TOS from server is not changed).
1180
DOC_END
1181
1128
NAME: tcp_outgoing_address
1182
NAME: tcp_outgoing_address
1129
TYPE: acl_address
1183
TYPE: acl_address
1130
DEFAULT: none
1184
DEFAULT: none
(-)squid-3.0.STABLE25.orig/src/client_side_reply.cc (+24 lines)
Lines 48-53 Link Here
48
#include "ESI.h"
48
#include "ESI.h"
49
#endif
49
#endif
50
#include "MemObject.h"
50
#include "MemObject.h"
51
#include "fde.h"
51
#include "ACLChecklist.h"
52
#include "ACLChecklist.h"
52
#include "ACL.h"
53
#include "ACL.h"
53
#if DELAY_POOLS
54
#if DELAY_POOLS
Lines 1549-1554 Link Here
1549
        /* guarantee nothing has been sent yet! */
1550
        /* guarantee nothing has been sent yet! */
1550
        assert(http->out.size == 0);
1551
        assert(http->out.size == 0);
1551
        assert(http->out.offset == 0);
1552
        assert(http->out.offset == 0);
1553
        if (Config.zph_tos_local)
1554
      	{
1555
			debugs(33, 1, "ZPH hit hier.code=" << http->request->hier.code <<" TOS="<<Config.zph_tos_local);
1556
	    	comm_set_tos(http->getConn()->fd,Config.zph_tos_local);
1557
      	}             
1552
        tempBuffer.offset = reqofs;
1558
        tempBuffer.offset = reqofs;
1553
        tempBuffer.length = getNextNode()->readBuffer.length;
1559
        tempBuffer.length = getNextNode()->readBuffer.length;
1554
        tempBuffer.data = getNextNode()->readBuffer.data;
1560
        tempBuffer.data = getNextNode()->readBuffer.data;
Lines 1829-1834 Link Here
1829
    char *buf = next()->readBuffer.data;
1835
    char *buf = next()->readBuffer.data;
1830
1836
1831
    char *body_buf = buf;
1837
    char *body_buf = buf;
1838
    
1839
    if (reqofs==0 && !logTypeIsATcpHit(http->logType))
1840
    {
1841
		int tos = 0;
1842
		if (Config.zph_tos_peer && 
1843
    	 	 (http->request->hier.code==SIBLING_HIT ||
1844
			 (Config.onoff.zph_tos_parent && http->request->hier.code==PARENT_HIT)))
1845
		{
1846
			tos = Config.zph_tos_peer;
1847
			debugs(33, 1, "ZPH: Peer hit, TOS="<<tos<<" hier.code="<<http->request->hier.code);
1848
		}
1849
		else if (Config.onoff.zph_preserve_miss_tos && Config.zph_preserve_miss_tos_mask)
1850
		{
1851
			tos = fd_table[fd].upstreamTOS & Config.zph_preserve_miss_tos_mask;
1852
			debugs(33, 1, "ZPH: Preserving TOS on miss, TOS="<<tos);
1853
		}
1854
		comm_set_tos(fd,tos);
1855
    }     
1832
1856
1833
    if (buf != result.data) {
1857
    if (buf != result.data) {
1834
        /* we've got to copy some data */
1858
        /* we've got to copy some data */
(-)squid-3.0.STABLE25.orig/src/fde.h (-1 / +1 lines)
Lines 106-112 Link Here
106
        long handle;
106
        long handle;
107
    } win32;
107
    } win32;
108
#endif
108
#endif
109
109
    unsigned char upstreamTOS;			/* see FwdState::dispatch()  */
110
};
110
};
111
111
112
#endif /* SQUID_FDE_H */
112
#endif /* SQUID_FDE_H */
(-)squid-3.0.STABLE25.orig/src/forward.cc (+51 lines)
Lines 965-970 Link Here
965
965
966
    netdbPingSite(request->host);
966
    netdbPingSite(request->host);
967
967
968
    /* Retrieves remote server TOS value, and stores it as part of the
969
     * original client request FD object. It is later used to forward
970
     * remote server's TOS in the response to the client in case of a MISS.
971
     */
972
	fde * clientFde = &fd_table[client_fd];
973
	if (clientFde)
974
	{
975
		int tos = 1;
976
		int tos_len = sizeof(tos);
977
		clientFde->upstreamTOS = 0;
978
	    if (setsockopt(server_fd,SOL_IP,IP_RECVTOS,&tos,tos_len)==0)
979
	    {
980
	       unsigned char buf[512];
981
	       int len = 512;
982
	       if (getsockopt(server_fd,SOL_IP,IP_PKTOPTIONS,buf,(socklen_t*)&len) == 0)
983
	       {
984
	           /* Parse the PKTOPTIONS structure to locate the TOS data message
985
	            * prepared in the kernel by the ZPH incoming TCP TOS preserving
986
	            * patch.
987
	            */
988
	    	   unsigned char * p = buf;
989
	           while (p-buf < len)
990
	           {
991
	              struct cmsghdr *o = (struct cmsghdr*)p;
992
	              if (o->cmsg_len<=0)
993
	                 break;
994
	
995
	              if (o->cmsg_level == SOL_IP && o->cmsg_type == IP_TOS)
996
	              {
997
	            	  union {
998
			     unsigned char *pchar;
999
			     int  *pint;
1000
			  } data;
1001
			  data.pchar = CMSG_DATA(o);
1002
	            	  clientFde->upstreamTOS = (unsigned char)*data.pint;
1003
	            	  break;
1004
	              }
1005
	              p += CMSG_LEN(o->cmsg_len);
1006
	           }
1007
	       }
1008
	       else
1009
	       {
1010
	           debugs(33, 1, "ZPH: error in getsockopt(IP_PKTOPTIONS) on FD "<<server_fd<<" "<<xstrerror());
1011
	       }
1012
	    }
1013
	    else
1014
	    {
1015
	    	debugs(33, 1, "ZPH: error in setsockopt(IP_RECVTOS) on FD "<<server_fd<<" "<<xstrerror());
1016
	    }
1017
	}    
1018
968
    if (servers && (p = servers->_peer)) {
1019
    if (servers && (p = servers->_peer)) {
969
        p->stats.fetches++;
1020
        p->stats.fetches++;
970
        request->peer_login = p->login;
1021
        request->peer_login = p->login;
(-)squid-3.0.STABLE25.orig/src/structs.h (+5 lines)
Lines 554-559 Link Here
554
        int emailErrData;
554
        int emailErrData;
555
        int httpd_suppress_version_string;
555
        int httpd_suppress_version_string;
556
        int global_internal_static;
556
        int global_internal_static;
557
        int zph_tos_parent;
558
        int zph_preserve_miss_tos;
557
        int debug_override_X;
559
        int debug_override_X;
558
        int WIN32_IpAddrChangeMonitor;
560
        int WIN32_IpAddrChangeMonitor;
559
    }
561
    }
Lines 722-727 Link Here
722
    int sleep_after_fork;	/* microseconds */
724
    int sleep_after_fork;	/* microseconds */
723
    time_t minimum_expiry_time;	/* seconds */
725
    time_t minimum_expiry_time;	/* seconds */
724
    external_acl *externalAclHelperList;
726
    external_acl *externalAclHelperList;
727
    int zph_tos_local;
728
    int zph_tos_peer;
729
    int zph_preserve_miss_tos_mask;
725
#if USE_SSL
730
#if USE_SSL
726
731
727
    struct
732
    struct

Return to bug 301828