penguin/tinyproxy

An L4 proxy designed to act as a tiny transparent shim

commit 54d9b6dbfd3832362213cb772592dbc6c96d7bd9

author斟酌 鵬兄 <tgckpg@gmail.com>
date2026-06-05T20:07:20Z
subjectFixed misleading error message
commit 54d9b6dbfd3832362213cb772592dbc6c96d7bd9
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2026-06-05T20:07:20Z

    Fixed misleading error message
---
 src/file_conf.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/file_conf.c b/src/file_conf.c
index 65fe613..ccef7a2 100644
--- a/src/file_conf.c
+++ b/src/file_conf.c
@@ -427,7 +427,7 @@ int parse_route_line(char *line, struct route *route)
 	tok = strtok_r(line, " \t\r\n", &saveptr);
 	while (tok != NULL) {
 		if (count >= MAX_ROUTE_FIELDS) {
-			return -1;
+			return -EINVAL;
 		}
 
 		fields[count++] = tok;
@@ -435,7 +435,7 @@ int parse_route_line(char *line, struct route *route)
 	}
 
 	if (count == 0) {
-		return -1;
+		return -EINVAL;
 	}
 
 	/* Config file form:
@@ -449,35 +449,35 @@ int parse_route_line(char *line, struct route *route)
 	}
 
 	if (count - pos < 4) {
-		return -1;
+		return -EINVAL;
 	}
 
 	memset(route, 0, sizeof(*route));
 	route_options_set_defaults(&route->opts);
 
 	if (parse_proto(fields[pos], &listen_proto) != 0) {
-		return -1;
+		return -EINVAL;
 	}
 	pos++;
 
 	if (parse_endpoint(listen_proto, fields[pos], &route->listen) != 0) {
-		return -1;
+		return -EINVAL;
 	}
 	pos++;
 
 	if (parse_proto(fields[pos], &backend_proto) != 0) {
-		return -1;
+		return -EINVAL;
 	}
 	pos++;
 
 	if (parse_endpoint(backend_proto, fields[pos], &route->upstream) != 0) {
-		return -1;
+		return -EINVAL;
 	}
 	pos++;
 
 	for (; pos < count; pos++) {
 		if (parse_route_options(fields[pos], &route->opts) != 0) {
-			return -1;
+			return -EINVAL;
 		}
 	}