X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fnetwork%2Fserv_network.c;h=8e8847546ec5e2b8ca42da5689588894194cd8c3;hp=29ad8379bdf78ef1045f23b98f7e08bebb78e189;hb=e024165eb98df86eb314c5ddea3cb38fcf478e67;hpb=219143dd54eeaa1769917cba748891a2b2aa64ea diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index 29ad8379b..8e8847546 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -1655,7 +1655,7 @@ void receive_spool(int sock, char *remote_nodename) { CtdlMakeTempFileName(tempfilename, sizeof tempfilename); if (sock_puts(sock, "NDOP") < 0) return; - if (sock_gets(sock, buf) < 0) return; + if (sock_getln(sock, buf, sizeof buf) < 0) return; lprintf(CTDL_DEBUG, "<%s\n", buf); if (buf[0] != '2') { return; @@ -1680,7 +1680,7 @@ void receive_spool(int sock, char *remote_nodename) { unlink(tempfilename); return; } - if (sock_gets(sock, buf) < 0) { + if (sock_getln(sock, buf, sizeof buf) < 0) { fclose(fp); unlink(tempfilename); return; @@ -1702,7 +1702,7 @@ void receive_spool(int sock, char *remote_nodename) { unlink(tempfilename); return; } - if (sock_gets(sock, buf) < 0) { + if (sock_getln(sock, buf, sizeof buf) < 0) { unlink(tempfilename); return; } @@ -1736,7 +1736,7 @@ void transmit_spool(int sock, char *remote_nodename) char sfname[128]; if (sock_puts(sock, "NUOP") < 0) return; - if (sock_gets(sock, buf) < 0) return; + if (sock_getln(sock, buf, sizeof buf) < 0) return; lprintf(CTDL_DEBUG, "<%s\n", buf); if (buf[0] != '2') { return; @@ -1763,7 +1763,7 @@ void transmit_spool(int sock, char *remote_nodename) close(fd); return; } - if (sock_gets(sock, buf) < 0) { + if (sock_getln(sock, buf, sizeof buf) < 0) { close(fd); return; } @@ -1785,7 +1785,7 @@ void transmit_spool(int sock, char *remote_nodename) ABORTUPL: close(fd); if (sock_puts(sock, "UCLS 1") < 0) return; - if (sock_gets(sock, buf) < 0) return; + if (sock_getln(sock, buf, sizeof buf) < 0) return; lprintf(CTDL_NOTICE, "Sent %ld octets to <%s>\n", bytes_written, remote_nodename); lprintf(CTDL_DEBUG, "<%s\n", buf); @@ -1818,14 +1818,14 @@ void network_poll_node(char *node, char *secret, char *host, char *port) { lprintf(CTDL_DEBUG, "Connected!\n"); /* Read the server greeting */ - if (sock_gets(sock, buf) < 0) goto bail; + if (sock_getln(sock, buf, sizeof buf) < 0) goto bail; lprintf(CTDL_DEBUG, ">%s\n", buf); /* Identify ourselves */ snprintf(buf, sizeof buf, "NETP %s|%s", config.c_nodename, secret); lprintf(CTDL_DEBUG, "<%s\n", buf); if (sock_puts(sock, buf) <0) goto bail; - if (sock_gets(sock, buf) < 0) goto bail; + if (sock_getln(sock, buf, sizeof buf) < 0) goto bail; lprintf(CTDL_DEBUG, ">%s\n", buf); if (buf[0] != '2') goto bail;