--------------------- PatchSet 3013 Date: 2001/09/12 15:01:56 Author: adri Branch: peertwiddle Tag: (none) Log: Fill out the enable/disable peer code. Initial testing (no requests, just enable/disable via a HTTP GET request) have shown this to succeed. Members: src/neighbors.c:1.12.14.5->1.12.14.6 Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v retrieving revision 1.12.14.5 retrieving revision 1.12.14.6 diff -u -r1.12.14.5 -r1.12.14.6 --- squid/src/neighbors.c 12 Sep 2001 14:54:35 -0000 1.12.14.5 +++ squid/src/neighbors.c 12 Sep 2001 15:01:56 -0000 1.12.14.6 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.12.14.5 2001/09/12 14:54:35 adri Exp $ + * $Id: neighbors.c,v 1.12.14.6 2001/09/12 15:01:56 adri Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -1468,11 +1468,25 @@ } /* Nice, valid peer. Get the admin request type */ + if (strcmp(adminreq, "enable") == 0) { /* Enable - enable the peer */ - /* Return valid */ + debug(17, 2) ("Peer %s:%d enabled administratively\n", + peer_host, peer_port); + peer->flags.enabled = 1; + /* Return valid */ + neighborAdminReturn(e, "Peer enabled\n", 1); + return; + } else if (strcmp(adminreq, "disable") == 0) { /* Disable - disable the peer */ + debug(17, 2) ("Peer %s:%d disabled administratively\n", + peer_host, peer_port); + peer->flags.enabled = 0; + /* Return valid */ + neighborAdminReturn(e, "Peer disabled\n", 0); + return; + } /* If we get to here, we don't know the request type */ neighborAdminReturn(e, "Unknown admin request\n", 0);