bool redirect_done;
bool no_cache_done;
bool interpreted_req_hdrs;
+ bool clientside_tos_done;
private:
CBDATA_CLASS(ClientRequestContext);
#
-# $Id: cf.data.pre,v 1.437 2007/05/22 17:12:38 rousskov Exp $
+# $Id: cf.data.pre,v 1.438 2007/05/26 06:38:03 wessels Exp $
#
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
matching line.
DOC_END
+NAME: clientside_tos
+TYPE: acl_tos
+DEFAULT: none
+LOC: Config.accessList.clientside_tos
+DOC_START
+ Allows you to select a TOS/Diffserv value to mark client-side
+ connections with, based on the username or source address
+ making the request.
+DOC_END
+
NAME: tcp_outgoing_address
TYPE: acl_address
DEFAULT: none
/*
- * $Id: client_side_request.cc,v 1.87 2007/05/18 18:26:01 wessels Exp $
+ * $Id: client_side_request.cc,v 1.88 2007/05/26 06:38:04 wessels Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
* the callout. This is strictly for convenience.
*/
+extern int aclMapTOS (acl_tos * head, ACLChecklist * ch);
+
void
ClientHttpRequest::doCallouts()
{
}
}
+ if (!calloutContext->clientside_tos_done) {
+ calloutContext->clientside_tos_done = true;
+ if (getConn() != NULL) {
+ ACLChecklist ch;
+ ch.src_addr = request->client_addr;
+ ch.my_addr = request->my_addr;
+ ch.my_port = request->my_port;
+ ch.request = HTTPMSGLOCK(request);
+ int tos = aclMapTOS(Config.accessList.clientside_tos, &ch);
+ if (tos)
+ comm_set_tos(getConn()->fd, tos);
+ }
+ }
+
cbdataReferenceDone(calloutContext->http);
delete calloutContext;
calloutContext = NULL;
/*
- * $Id: comm.cc,v 1.430 2007/04/30 16:56:09 wessels Exp $
+ * $Id: comm.cc,v 1.431 2007/05/26 06:38:04 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
return anErrno == ENFILE || anErrno == EMFILE;
}
+int
+comm_set_tos(int fd, int tos)
+{
+#ifdef IP_TOS
+ int x = setsockopt(fd, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof(int));
+ if (x < 0)
+ debugs(50, 1, "comm_set_tos: setsockopt(IP_TOS) on FD " << fd << ": " << xstrerror());
+ return x;
+#else
+ debugs(50, 0, "comm_set_tos: setsockopt(IP_TOS) not supported on this platform");
+ return -1
+#endif
+}
+
+
/* Create a socket. Default is blocking, stream (TCP) socket. IO_TYPE
* is OR of flags specified in defines.h:COMM_* */
int
SQUIDCEXTERN int comm_openex(int, int, struct IN_ADDR, u_short, int, unsigned char TOS, const char *);
SQUIDCEXTERN u_short comm_local_port(int fd);
+SQUIDCEXTERN int comm_set_tos(int fd, int tos);
SQUIDCEXTERN void commSetSelect(int, unsigned int, PF *, void *, time_t);
/*
- * $Id: forward.cc,v 1.164 2007/05/11 13:20:57 rousskov Exp $
+ * $Id: forward.cc,v 1.165 2007/05/26 06:38:04 wessels Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
return addr;
}
-static int
+/*
+ * DPW 2007-05-19
+ * Formerly static, but now used by client_side_request.cc
+ */
+int
aclMapTOS(acl_tos * head, ACLChecklist * ch)
{
acl_tos *l;
/*
- * $Id: structs.h,v 1.556 2007/05/18 06:41:25 amosjeffries Exp $
+ * $Id: structs.h,v 1.557 2007/05/26 06:38:05 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
acl_access *reply;
acl_address *outgoing_address;
acl_tos *outgoing_tos;
+ acl_tos *clientside_tos;
#if USE_HTCP
acl_access *htcp;