Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Proxy variables and functions. |
| 3 | * |
Willy Tarreau | d825eef | 2007-05-12 22:35:00 +0200 | [diff] [blame] | 4 | * Copyright 2000-2007 Willy Tarreau <w@1wt.eu> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #include <fcntl.h> |
| 14 | #include <unistd.h> |
Willy Tarreau | c8f24f8 | 2007-11-30 18:38:35 +0100 | [diff] [blame] | 15 | #include <string.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 16 | #include <sys/types.h> |
| 17 | #include <sys/socket.h> |
| 18 | #include <sys/stat.h> |
| 19 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 20 | #include <common/defaults.h> |
| 21 | #include <common/compat.h> |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 22 | #include <common/config.h> |
Willy Tarreau | d740bab | 2007-10-28 11:14:07 +0100 | [diff] [blame] | 23 | #include <common/errors.h> |
Willy Tarreau | 4d2d098 | 2007-05-14 00:39:29 +0200 | [diff] [blame] | 24 | #include <common/memory.h> |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 25 | #include <common/time.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 26 | |
| 27 | #include <types/global.h> |
| 28 | #include <types/polling.h> |
| 29 | |
| 30 | #include <proto/client.h> |
Alexandre Cassen | 87ea548 | 2007-10-11 20:48:58 +0200 | [diff] [blame] | 31 | #include <proto/backend.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 32 | #include <proto/fd.h> |
| 33 | #include <proto/log.h> |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 34 | #include <proto/protocols.h> |
| 35 | #include <proto/proto_tcp.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 36 | #include <proto/proxy.h> |
| 37 | |
| 38 | |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 39 | int listeners; /* # of proxy listeners, set by cfgparse, unset by maintain_proxies */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 40 | struct proxy *proxy = NULL; /* list of all existing proxies */ |
Willy Tarreau | dcd4771 | 2007-11-04 23:35:08 +0100 | [diff] [blame] | 41 | int next_pxid = 1; /* UUID assigned to next new proxy, 0 reserved */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 42 | |
Willy Tarreau | 977b8e4 | 2006-12-29 14:19:17 +0100 | [diff] [blame] | 43 | /* |
Willy Tarreau | 816eb54 | 2007-11-04 07:04:43 +0100 | [diff] [blame] | 44 | * This function returns a string containing a name describing capabilities to |
| 45 | * report comprehensible error messages. Specifically, it will return the words |
| 46 | * "frontend", "backend", "ruleset" when appropriate, or "proxy" for all other |
| 47 | * cases including the proxies declared in "listen" mode. |
Willy Tarreau | 977b8e4 | 2006-12-29 14:19:17 +0100 | [diff] [blame] | 48 | */ |
Willy Tarreau | 816eb54 | 2007-11-04 07:04:43 +0100 | [diff] [blame] | 49 | const char *proxy_cap_str(int cap) |
Willy Tarreau | 977b8e4 | 2006-12-29 14:19:17 +0100 | [diff] [blame] | 50 | { |
Willy Tarreau | 816eb54 | 2007-11-04 07:04:43 +0100 | [diff] [blame] | 51 | if ((cap & PR_CAP_LISTEN) != PR_CAP_LISTEN) { |
| 52 | if (cap & PR_CAP_FE) |
| 53 | return "frontend"; |
| 54 | else if (cap & PR_CAP_BE) |
| 55 | return "backend"; |
| 56 | else if (cap & PR_CAP_RS) |
| 57 | return "ruleset"; |
| 58 | } |
| 59 | return "proxy"; |
Willy Tarreau | 977b8e4 | 2006-12-29 14:19:17 +0100 | [diff] [blame] | 60 | } |
| 61 | |
Krzysztof Piotr Oledzki | 6eb730d | 2007-11-03 23:41:58 +0100 | [diff] [blame] | 62 | /* |
| 63 | * This function returns a string containing the mode of the proxy in a format |
| 64 | * suitable for error messages. |
| 65 | */ |
Krzysztof Piotr Oledzki | 6eb730d | 2007-11-03 23:41:58 +0100 | [diff] [blame] | 66 | const char *proxy_mode_str(int mode) { |
| 67 | |
| 68 | if (mode == PR_MODE_TCP) |
| 69 | return "tcp"; |
| 70 | else if (mode == PR_MODE_HTTP) |
| 71 | return "http"; |
| 72 | else if (mode == PR_MODE_HEALTH) |
| 73 | return "health"; |
| 74 | else |
| 75 | return "unknown"; |
| 76 | } |
| 77 | |
| 78 | /* |
| 79 | * This function finds a proxy with matching name, mode and with satisfying |
| 80 | * capabilities. It also checks if there are more matching proxies with |
| 81 | * requested name as this often leads into unexpected situations. |
| 82 | */ |
| 83 | |
| 84 | struct proxy *findproxy(const char *name, int mode, int cap) { |
| 85 | |
| 86 | struct proxy *curproxy, *target=NULL; |
| 87 | |
| 88 | for (curproxy = proxy; curproxy; curproxy = curproxy->next) { |
| 89 | if ((curproxy->cap & cap)!=cap || strcmp(curproxy->id, name)) |
| 90 | continue; |
| 91 | |
| 92 | if (curproxy->mode != mode) { |
| 93 | Alert("Unable to use proxy '%s' with wrong mode, required: %s, has: %s.\n", |
| 94 | name, proxy_mode_str(mode), proxy_mode_str(curproxy->mode)); |
| 95 | Alert("You may want to use 'mode %s'.\n", proxy_mode_str(mode)); |
| 96 | return NULL; |
| 97 | } |
| 98 | |
| 99 | if (!target) { |
| 100 | target = curproxy; |
| 101 | continue; |
| 102 | } |
| 103 | |
Willy Tarreau | 816eb54 | 2007-11-04 07:04:43 +0100 | [diff] [blame] | 104 | Alert("Refusing to use duplicated proxy '%s' with overlapping capabilities: %s/%s!\n", |
Krzysztof Piotr Oledzki | 6eb730d | 2007-11-03 23:41:58 +0100 | [diff] [blame] | 105 | name, proxy_type_str(curproxy), proxy_type_str(target)); |
| 106 | |
| 107 | return NULL; |
| 108 | } |
| 109 | |
| 110 | return target; |
| 111 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 112 | |
| 113 | /* |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 114 | * This function creates all proxy sockets. It should be done very early, |
| 115 | * typically before privileges are dropped. The sockets will be registered |
| 116 | * but not added to any fd_set, in order not to loose them across the fork(). |
| 117 | * The proxies also start in IDLE state, meaning that it will be |
| 118 | * maintain_proxies that will finally complete their loading. |
| 119 | * |
| 120 | * Its return value is composed from ERR_NONE, ERR_RETRYABLE and ERR_FATAL. |
| 121 | * Retryable errors will only be printed if <verbose> is not zero. |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 122 | */ |
| 123 | int start_proxies(int verbose) |
| 124 | { |
| 125 | struct proxy *curproxy; |
| 126 | struct listener *listener; |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 127 | int lerr, err = ERR_NONE; |
| 128 | int pxerr; |
| 129 | char msg[100]; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 130 | |
| 131 | for (curproxy = proxy; curproxy != NULL; curproxy = curproxy->next) { |
| 132 | if (curproxy->state != PR_STNEW) |
| 133 | continue; /* already initialized */ |
| 134 | |
| 135 | pxerr = 0; |
| 136 | for (listener = curproxy->listen; listener != NULL; listener = listener->next) { |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 137 | if (listener->state != LI_ASSIGNED) |
| 138 | continue; /* already started */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 139 | |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 140 | lerr = tcp_bind_listener(listener, msg, sizeof(msg)); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 141 | |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 142 | /* errors are reported if <verbose> is set or if they are fatal */ |
| 143 | if (verbose || (lerr & (ERR_FATAL | ERR_ABORT))) { |
| 144 | if (lerr & ERR_ALERT) |
| 145 | Alert("Starting %s %s: %s\n", |
| 146 | proxy_type_str(curproxy), curproxy->id, msg); |
| 147 | else if (lerr & ERR_WARN) |
| 148 | Warning("Starting %s %s: %s\n", |
| 149 | proxy_type_str(curproxy), curproxy->id, msg); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 150 | } |
| 151 | |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 152 | err |= lerr; |
| 153 | if (lerr & (ERR_ABORT | ERR_FATAL)) { |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 154 | pxerr |= 1; |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 155 | break; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 156 | } |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 157 | else if (lerr & ERR_CODE) { |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 158 | pxerr |= 1; |
| 159 | continue; |
| 160 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | if (!pxerr) { |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 164 | curproxy->state = PR_STIDLE; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 165 | send_log(curproxy, LOG_NOTICE, "Proxy %s started.\n", curproxy->id); |
| 166 | } |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 167 | |
| 168 | if (err & ERR_ABORT) |
| 169 | break; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | return err; |
| 173 | } |
| 174 | |
| 175 | |
| 176 | /* |
| 177 | * this function enables proxies when there are enough free sessions, |
| 178 | * or stops them when the table is full. It is designed to be called from the |
Willy Tarreau | d825eef | 2007-05-12 22:35:00 +0200 | [diff] [blame] | 179 | * select_loop(). It returns the date of next expiration event during stop |
| 180 | * time, ETERNITY otherwise. |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 181 | */ |
Willy Tarreau | d825eef | 2007-05-12 22:35:00 +0200 | [diff] [blame] | 182 | void maintain_proxies(struct timeval *next) |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 183 | { |
| 184 | struct proxy *p; |
| 185 | struct listener *l; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 186 | |
| 187 | p = proxy; |
Willy Tarreau | d825eef | 2007-05-12 22:35:00 +0200 | [diff] [blame] | 188 | tv_eternity(next); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 189 | |
| 190 | /* if there are enough free sessions, we'll activate proxies */ |
| 191 | if (actconn < global.maxconn) { |
| 192 | while (p) { |
Willy Tarreau | f1221aa | 2006-12-17 22:14:12 +0100 | [diff] [blame] | 193 | if (p->feconn < p->maxconn) { |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 194 | if (p->state == PR_STIDLE) { |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 195 | for (l = p->listen; l != NULL; l = l->next) |
| 196 | enable_listener(l); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 197 | p->state = PR_STRUN; |
| 198 | } |
| 199 | } |
| 200 | else { |
| 201 | if (p->state == PR_STRUN) { |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 202 | for (l = p->listen; l != NULL; l = l->next) |
| 203 | disable_listener(l); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 204 | p->state = PR_STIDLE; |
| 205 | } |
| 206 | } |
| 207 | p = p->next; |
| 208 | } |
| 209 | } |
| 210 | else { /* block all proxies */ |
| 211 | while (p) { |
| 212 | if (p->state == PR_STRUN) { |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 213 | for (l = p->listen; l != NULL; l = l->next) |
| 214 | disable_listener(l); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 215 | p->state = PR_STIDLE; |
| 216 | } |
| 217 | p = p->next; |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | if (stopping) { |
| 222 | p = proxy; |
| 223 | while (p) { |
| 224 | if (p->state != PR_STSTOPPED) { |
| 225 | int t; |
Willy Tarreau | 42aae5c | 2007-04-29 17:43:56 +0200 | [diff] [blame] | 226 | t = tv_ms_remain2(&now, &p->stop_time); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 227 | if (t == 0) { |
| 228 | Warning("Proxy %s stopped.\n", p->id); |
| 229 | send_log(p, LOG_WARNING, "Proxy %s stopped.\n", p->id); |
| 230 | |
| 231 | for (l = p->listen; l != NULL; l = l->next) { |
Willy Tarreau | e6b9894 | 2007-10-29 01:09:36 +0100 | [diff] [blame] | 232 | unbind_listener(l); |
| 233 | if (l->state >= LI_ASSIGNED) { |
| 234 | delete_listener(l); |
| 235 | listeners--; |
| 236 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 237 | } |
| 238 | p->state = PR_STSTOPPED; |
Willy Tarreau | 4d2d098 | 2007-05-14 00:39:29 +0200 | [diff] [blame] | 239 | /* try to free more memory */ |
| 240 | pool_gc2(); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 241 | } |
| 242 | else { |
Willy Tarreau | d825eef | 2007-05-12 22:35:00 +0200 | [diff] [blame] | 243 | tv_bound(next, &p->stop_time); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 244 | } |
| 245 | } |
| 246 | p = p->next; |
| 247 | } |
| 248 | } |
Willy Tarreau | d825eef | 2007-05-12 22:35:00 +0200 | [diff] [blame] | 249 | return; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | |
| 253 | /* |
| 254 | * this function disables health-check servers so that the process will quickly be ignored |
| 255 | * by load balancers. Note that if a proxy was already in the PAUSED state, then its grace |
| 256 | * time will not be used since it would already not listen anymore to the socket. |
| 257 | */ |
| 258 | void soft_stop(void) |
| 259 | { |
| 260 | struct proxy *p; |
| 261 | |
| 262 | stopping = 1; |
| 263 | p = proxy; |
| 264 | tv_now(&now); /* else, the old time before select will be used */ |
| 265 | while (p) { |
| 266 | if (p->state != PR_STSTOPPED) { |
| 267 | Warning("Stopping proxy %s in %d ms.\n", p->id, p->grace); |
| 268 | send_log(p, LOG_WARNING, "Stopping proxy %s in %d ms.\n", p->id, p->grace); |
Willy Tarreau | 42aae5c | 2007-04-29 17:43:56 +0200 | [diff] [blame] | 269 | tv_ms_add(&p->stop_time, &now, p->grace); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 270 | } |
| 271 | p = p->next; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | |
| 276 | /* |
| 277 | * Linux unbinds the listen socket after a SHUT_RD, and ignores SHUT_WR. |
| 278 | * Solaris refuses either shutdown(). |
| 279 | * OpenBSD ignores SHUT_RD but closes upon SHUT_WR and refuses to rebind. |
| 280 | * So a common validation path involves SHUT_WR && listen && SHUT_RD. |
| 281 | * If disabling at least one listener returns an error, then the proxy |
| 282 | * state is set to PR_STERROR because we don't know how to resume from this. |
| 283 | */ |
| 284 | void pause_proxy(struct proxy *p) |
| 285 | { |
| 286 | struct listener *l; |
| 287 | for (l = p->listen; l != NULL; l = l->next) { |
| 288 | if (shutdown(l->fd, SHUT_WR) == 0 && |
| 289 | listen(l->fd, p->maxconn) == 0 && |
| 290 | shutdown(l->fd, SHUT_RD) == 0) { |
Willy Tarreau | f161a34 | 2007-04-08 16:59:42 +0200 | [diff] [blame] | 291 | EV_FD_CLR(l->fd, DIR_RD); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 292 | if (p->state != PR_STERROR) |
| 293 | p->state = PR_STPAUSED; |
| 294 | } |
| 295 | else |
| 296 | p->state = PR_STERROR; |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | /* |
| 301 | * This function temporarily disables listening so that another new instance |
| 302 | * can start listening. It is designed to be called upon reception of a |
| 303 | * SIGTTOU, after which either a SIGUSR1 can be sent to completely stop |
| 304 | * the proxy, or a SIGTTIN can be sent to listen again. |
| 305 | */ |
| 306 | void pause_proxies(void) |
| 307 | { |
| 308 | int err; |
| 309 | struct proxy *p; |
| 310 | |
| 311 | err = 0; |
| 312 | p = proxy; |
| 313 | tv_now(&now); /* else, the old time before select will be used */ |
| 314 | while (p) { |
| 315 | if (p->state != PR_STERROR && |
| 316 | p->state != PR_STSTOPPED && |
| 317 | p->state != PR_STPAUSED) { |
| 318 | Warning("Pausing proxy %s.\n", p->id); |
| 319 | send_log(p, LOG_WARNING, "Pausing proxy %s.\n", p->id); |
| 320 | pause_proxy(p); |
| 321 | if (p->state != PR_STPAUSED) { |
| 322 | err |= 1; |
| 323 | Warning("Proxy %s failed to enter pause mode.\n", p->id); |
| 324 | send_log(p, LOG_WARNING, "Proxy %s failed to enter pause mode.\n", p->id); |
| 325 | } |
| 326 | } |
| 327 | p = p->next; |
| 328 | } |
| 329 | if (err) { |
| 330 | Warning("Some proxies refused to pause, performing soft stop now.\n"); |
| 331 | send_log(p, LOG_WARNING, "Some proxies refused to pause, performing soft stop now.\n"); |
| 332 | soft_stop(); |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | |
| 337 | /* |
| 338 | * This function reactivates listening. This can be used after a call to |
| 339 | * sig_pause(), for example when a new instance has failed starting up. |
| 340 | * It is designed to be called upon reception of a SIGTTIN. |
| 341 | */ |
| 342 | void listen_proxies(void) |
| 343 | { |
| 344 | struct proxy *p; |
| 345 | struct listener *l; |
| 346 | |
| 347 | p = proxy; |
| 348 | tv_now(&now); /* else, the old time before select will be used */ |
| 349 | while (p) { |
| 350 | if (p->state == PR_STPAUSED) { |
| 351 | Warning("Enabling proxy %s.\n", p->id); |
| 352 | send_log(p, LOG_WARNING, "Enabling proxy %s.\n", p->id); |
| 353 | |
| 354 | for (l = p->listen; l != NULL; l = l->next) { |
| 355 | if (listen(l->fd, p->maxconn) == 0) { |
Willy Tarreau | f1221aa | 2006-12-17 22:14:12 +0100 | [diff] [blame] | 356 | if (actconn < global.maxconn && p->feconn < p->maxconn) { |
Willy Tarreau | f161a34 | 2007-04-08 16:59:42 +0200 | [diff] [blame] | 357 | EV_FD_SET(l->fd, DIR_RD); |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 358 | p->state = PR_STRUN; |
| 359 | } |
| 360 | else |
| 361 | p->state = PR_STIDLE; |
| 362 | } else { |
| 363 | int port; |
| 364 | |
| 365 | if (l->addr.ss_family == AF_INET6) |
| 366 | port = ntohs(((struct sockaddr_in6 *)(&l->addr))->sin6_port); |
| 367 | else |
| 368 | port = ntohs(((struct sockaddr_in *)(&l->addr))->sin_port); |
| 369 | |
| 370 | Warning("Port %d busy while trying to enable proxy %s.\n", |
| 371 | port, p->id); |
| 372 | send_log(p, LOG_WARNING, "Port %d busy while trying to enable proxy %s.\n", |
| 373 | port, p->id); |
| 374 | /* Another port might have been enabled. Let's stop everything. */ |
| 375 | pause_proxy(p); |
| 376 | break; |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | p = p->next; |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | |
| 385 | /* |
| 386 | * Local variables: |
| 387 | * c-indent-level: 8 |
| 388 | * c-basic-offset: 8 |
| 389 | * End: |
| 390 | */ |