diff options
author | Omar Polo <op@omarpolo.com> | 2024-06-17 20:47:24 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-06-17 20:47:24 +0000 |
commit | f92ef76b28fa484a75f93b30bcee907f024cb8b7 (patch) | |
tree | 41946ded254e926db09569f67747715aff57e3a8 /server.c | |
parent | cc399bfabfdc793dbe848120df6a7ed5b8f013b4 (diff) |
invert the arguments in some comparisons
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1304,7 +1304,7 @@ read_cb(struct tls *ctx, void *buf, size_t buflen, void *cb_arg) // no buffer to cache into, read into libtls buffer errno = 0; ssize_t ret = read(c->fd, buf, buflen); - if (-1 == ret && errno == EWOULDBLOCK) + if (ret == -1 && errno == EWOULDBLOCK) ret = TLS_WANT_POLLIN; return ret; @@ -1333,7 +1333,7 @@ read_cb(struct tls *ctx, void *buf, size_t buflen, void *cb_arg) c->buf.data + c->buf.len, BUFLAYER_MAX - c->buf.len ); - if (-1 == n_read && errno == EWOULDBLOCK) + if (n_read == -1 && errno == EWOULDBLOCK) return TLS_WANT_POLLIN; c->buf.len += n_read; @@ -1361,7 +1361,7 @@ read_cb(struct tls *ctx, void *buf, size_t buflen, void *cb_arg) break; } - if (PROTO_UNKNOWN != pp1.proto) { + if (pp1.proto != PROTO_UNKNOWN) { snprintf(c->rserv, sizeof(c->rserv), "%u", pp1.srcport); } @@ -1387,7 +1387,7 @@ static ssize_t write_cb(struct tls *ctx, const void *buf, size_t buflen, void *c struct client *c = cb_arg; ssize_t ret = write(c->fd, buf, buflen); - if (-1 == ret && EAGAIN == errno) + if (ret == -1 && errno == EAGAIN) return TLS_WANT_POLLOUT; return ret; |