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;
unlink(tempfilename);
return;
}
- if (sock_gets(sock, buf) < 0) {
+ if (sock_getln(sock, buf, sizeof buf) < 0) {
fclose(fp);
unlink(tempfilename);
return;
unlink(tempfilename);
return;
}
- if (sock_gets(sock, buf) < 0) {
+ if (sock_getln(sock, buf, sizeof buf) < 0) {
unlink(tempfilename);
return;
}
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;
close(fd);
return;
}
- if (sock_gets(sock, buf) < 0) {
+ if (sock_getln(sock, buf, sizeof buf) < 0) {
close(fd);
return;
}
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);
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;