sargs[sargc] = NULL;
- p = strchr(path,'/');
- if (p) *p = 0;
- io_printf(fd,"%s\n",path);
- if (p) *p = '/';
-
if (!read_line(fd, line, sizeof(line)-1)) {
return -1;
}
return -1;
}
+ io_printf(fd,"@RSYNCD: %d\n", PROTOCOL_VERSION);
+
+ p = strchr(path,'/');
+ if (p) *p = 0;
+ io_printf(fd,"%s\n",path);
+ if (p) *p = '/';
+
while (1) {
if (!read_line(fd, line, sizeof(line)-1)) {
return -1;
{
char line[1024];
char *motd;
+ int version;
set_socket_options(fd,"SO_KEEPALIVE");
io_printf(fd,"@RSYNCD: %d\n", PROTOCOL_VERSION);
+ if (!read_line(fd, line, sizeof(line)-1)) {
+ return -1;
+ }
+
+ if (sscanf(line,"@RSYNCD: %d", &version) != 1) {
+ return -1;
+ }
+
motd = lp_motd_file();
if (*motd) {
FILE *f = fopen(motd,"r");