+/*********************************************************************
+ *
+ * Function : connect_port_is_forbidden
+ *
+ * Description : Check to see if CONNECT requests to the destination
+ * port of this request are forbidden. The check is
+ * independend of the actual request method.
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ *
+ * Returns : True if yes, false otherwise.
+ *
+ *********************************************************************/
+int connect_port_is_forbidden(const struct client_state *csp)
+{
+ return ((!(csp->action->flags & ACTION_LIMIT_CONNECT) && csp->http->port != 443)
+ || (csp->action->flags & ACTION_LIMIT_CONNECT &&
+ !match_portlist(csp->action->string[ACTION_STRING_LIMIT_CONNECT], csp->http->port)));
+}
+
+