diff options
| author | Fabian Mauchle <fabian.mauchle@switch.ch> | 2017-03-03 11:04:56 +0100 |
|---|---|---|
| committer | Fabian Mauchle <fabian.mauchle@switch.ch> | 2017-03-16 11:17:48 +0100 |
| commit | 85d3999d58aafa0127f45070c49fd23be2d03423 (patch) | |
| tree | 3bfff60e07402e9f0ac16f2f8f157a8d1d17ad3b /tcp.c | |
| parent | ec469f65cdda1a668d105763a7d788fb23b42261 (diff) | |
- fix wrong comparison of server->state
- move enum to top
- prefix enum with rsp_ / RSP_
Conflicts:
radsecproxy.c
Diffstat (limited to 'tcp.c')
| -rw-r--r-- | tcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -102,8 +102,8 @@ int tcpconnect(struct server *server, struct timeval *when, int timeout, char *t pthread_mutex_unlock(&server->lock); return 0; } - if (server->state == SERVER_STATE_CONNECTED) { - server->state = SERVER_STATE_RECONNECTING; + if (server->state == RSP_SERVER_STATE_CONNECTED) { + server->state = RSP_SERVER_STATE_RECONNECTING; sleep(2); } else if (elapsed < 1) sleep(2); @@ -121,7 +121,7 @@ int tcpconnect(struct server *server, struct timeval *when, int timeout, char *t if ((server->sock = connecttcphostlist(server->conf->hostports, srcres)) >= 0) break; } - server->state = SERVER_STATE_CONNECTED; + server->state = RSP_SERVER_STATE_CONNECTED; gettimeofday(&server->lastconnecttry, NULL); pthread_mutex_unlock(&server->lock); return 1; @@ -202,7 +202,7 @@ int clientradputtcp(struct server *server, unsigned char *rad) { size_t len; struct clsrvconf *conf = server->conf; - if (!server->state == SERVER_STATE_CONNECTED) + if (server->state != RSP_SERVER_STATE_CONNECTED) return 0; len = RADLEN(rad); if ((cnt = write(server->sock, rad, len)) <= 0) { |
