aboutsummaryrefslogtreecommitdiff
path: root/proxy-proto.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2024-06-17 20:47:24 +0000
committerOmar Polo <op@omarpolo.com>2024-06-17 20:47:24 +0000
commitfb8311e48f5ee4a4d11299ee7aadabca581eb1da (patch)
tree31437cade13a8308a1ed7c06c4078e3efbd3e34d /proxy-proto.c
parent27c6dc180f5ae74ef07f444ee3732ff95ca5bfff (diff)
replace asserts with error returns
Diffstat (limited to 'proxy-proto.c')
-rw-r--r--proxy-proto.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/proxy-proto.c b/proxy-proto.c
index 9dc1457..bef2633 100644
--- a/proxy-proto.c
+++ b/proxy-proto.c
@@ -159,15 +159,16 @@ proxy_proto_v1_parse(struct proxy_protocol_v1 *s, char *buf, size_t buflen,
return (-1);
break;
- default:
- ASSERT_MSG(0, "unimplemented");
+ default:
+ return (-1);
}
if (check_port_v1(&s->srcport, &buf, &buflen) == -1 ||
check_port_v1(&s->dstport, &buf, &buflen) == -1)
return (-1);
- assert('\n' == *buf);
+ if (*buf != '\n')
+ return (-1);
buf += 1;
*consumed = buf - begin;