commit 91209551fd7463eee86284190b0241ec2b037332
parent 600cfbed28e68094a263a77fac14d18bbe829213
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 6 Jan 2021 23:24:01 -0800
Superficial changes to backend networking functions
Rename `gph_recvto' and `gph_send' to `gphto' and `gphre' respectively
and as fix recvtxt() return type
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/net.c b/net.c
@@ -45,7 +45,7 @@ resolve(char const *host, char const *port)
}
int
-gph_send(int sock, char const *message)
+gphre(int sock, char const *message)
{
char tmp[MY_PATH_MAX];
int n;
@@ -71,7 +71,7 @@ gph_send(int sock, char const *message)
return 0;
}
-ssize_t
+int
recvtxt(int s, FILE *output)
{
FILE *input;
@@ -114,7 +114,7 @@ recvbin(int s, FILE *output)
}
int
-gph_recvto(int sock, char const *path, int bin, int timeout)
+gphto(int sock, char const *path, int bin, int timeout)
{
FILE *fp;
int status;
@@ -148,8 +148,8 @@ gopher(char **addr, char const *path, int bin, int timeout)
if (sock == -1)
return 1;
- if (gph_send(sock, addr[AR_PATH]) != 0 ||
- gph_recvto(sock, path, bin, timeout) != 0) {
+ if (gphre(sock, addr[AR_PATH]) != 0 ||
+ gphto(sock, path, bin, timeout) != 0) {
close(sock);
return 1;
}