Whitespace fixes

This commit is contained in:
Radim Kolar 2020-06-05 07:39:16 +02:00
parent 7d3e62336d
commit bfd5fc3f7b

View File

@ -99,9 +99,9 @@ static const char * print_command(unsigned char cmd)
case CC_BYE: case CC_BYE:
return "BYE"; return "BYE";
case CC_VERSION: case CC_VERSION:
return "VER"; return "VER";
case CC_INFO: case CC_INFO:
return "INFO"; return "INFO";
case CC_ERR: case CC_ERR:
return "ERR"; return "ERR";
case CC_GET_DIR: case CC_GET_DIR:
@ -125,7 +125,7 @@ static const char * print_command(unsigned char cmd)
case CC_GRAB_FILE: case CC_GRAB_FILE:
return "GRAB"; return "GRAB";
case CC_GRAB_DONE: case CC_GRAB_DONE:
return "GRABDONE"; return "GRABDONE";
case CC_STAT: case CC_STAT:
return "STAT"; return "STAT";
case CC_RENAME: case CC_RENAME:
@ -185,19 +185,19 @@ int server_loop (int fd, time_t timeout)
FILE *fp; FILE *fp;
if(dbug) fprintf(stderr,"Got USR1, dumping tables...\n"); if(dbug) fprintf(stderr,"Got USR1, dumping tables...\n");
if(dumpname) if(dumpname)
fp=fopen(dumpname,"a"); fp=fopen(dumpname,"a");
else else
fp=NULL; fp=NULL;
dump_htab(fp); dump_htab(fp);
dump_iptab(iptab,fp); dump_iptab(iptab,fp);
stat_caches(fp); stat_caches(fp);
if(fp) if(fp)
{ {
fclose(fp); fclose(fp);
} }
dump = 0; dump = 0;
} else } else
if(shutdowning) return 1; if(shutdowning) return 1;
retval = _x_select(&mask, timeout); retval = _x_select(&mask, timeout);
@ -215,19 +215,19 @@ int server_loop (int fd, time_t timeout)
if(dbug) fprintf(stderr,"Header truncated.\n"); if(dbug) fprintf(stderr,"Header truncated.\n");
continue; continue;
} }
rlen = BB_READ2(rbuf.bb_len); rlen = BB_READ2(rbuf.bb_len);
if((rlen+UBUF_HSIZE) > bytes) if((rlen+UBUF_HSIZE) > bytes)
{ {
if(dbug) fprintf(stderr,"Message truncated.\n"); if(dbug) fprintf(stderr,"Message truncated.\n");
continue; /* truncated. */ continue; /* truncated. */
} }
if(!(ir = check_ip_table(from.sin_addr.s_addr,iptab))) if(!(ir = check_ip_table(from.sin_addr.s_addr,iptab)))
{ /* host not found in table */ { /* host not found in table */
ir = priv_mode ? "DFSP service not available": "N"; ir = priv_mode ? "DFSP service not available": "N";
} }
switch (*ir) { switch (*ir) {
case 'D': /* disabled host - return error message */ case 'D': /* disabled host - return error message */
if (rbuf.cmd == CC_BYE) if (rbuf.cmd == CC_BYE)
@ -242,17 +242,17 @@ int server_loop (int fd, time_t timeout)
fputs("check_ip() returned illegal host type\n",stderr); fputs("check_ip() returned illegal host type\n",stderr);
exit(99); exit(99);
} }
hp = find_host(from.sin_addr.s_addr); hp = find_host(from.sin_addr.s_addr);
if(hp->hostname == 0 && no_unnamed) { if(hp->hostname == 0 && no_unnamed) {
send_error(&from,&rbuf, REVERSE_ERR_MSG); send_error(&from,&rbuf, REVERSE_ERR_MSG);
continue; continue;
} }
old = 0; old = 0;
cur_time = time((time_t *) 0); cur_time = time((time_t *) 0);
rkey = BB_READ2(rbuf.bb_key); rkey = BB_READ2(rbuf.bb_key);
if(hp->next_key != rkey) { if(hp->next_key != rkey) {
if(!hp->active) if(!hp->active)
@ -290,7 +290,7 @@ int server_loop (int fd, time_t timeout)
if(dbug) fprintf(stderr,"Wrong checksum got %x, expected %x\n",u,sum); if(dbug) fprintf(stderr,"Wrong checksum got %x, expected %x\n",u,sum);
continue; /* wrong check sum */ continue; /* wrong check sum */
} }
server_process_packet(bytes,&rbuf,old,hp,&from); server_process_packet(bytes,&rbuf,old,hp,&from);
} else return(0); /* got a timeout */ } else return(0); /* got a timeout */
} }
@ -436,12 +436,12 @@ static void server_show_version (struct sockaddr_in * from, UBUF * ub)
if (no_unnamed) verflags |= VER_REVNAME; if (no_unnamed) verflags |= VER_REVNAME;
if (priv_mode) verflags |= VER_PRIVMODE; if (priv_mode) verflags |= VER_PRIVMODE;
if (maxthcallowed) verflags |= VER_THRUPUT; if (maxthcallowed) verflags |= VER_THRUPUT;
/* we are accepting xtra data on input */ /* we are accepting xtra data on input */
/* because UDP tranport provides data size */ /* because UDP tranport provides data size */
verflags |= VER_XTRADATA; verflags |= VER_XTRADATA;
strcpy(ub->buf, buf); strcpy(ub->buf, buf);
ub->buf[strlen(ub->buf)] = '\0'; ub->buf[strlen(ub->buf)] = '\0';
ub->buf[strlen(ub->buf)+1] = verflags; ub->buf[strlen(ub->buf)+1] = verflags;
@ -705,7 +705,7 @@ static void server_process_packet (unsigned bytes, UBUF * ub, int old,
} }
if(l1>1) { if(l1>1) {
CHECK_ACCESS_RIGHTS(DIR_ADD,L_INSTALL); CHECK_ACCESS_RIGHTS(DIR_ADD,L_INSTALL);
} }
pe = server_install(&pp,inet_num,port_num,pe,di,l2,s2); pe = server_install(&pp,inet_num,port_num,pe,di,l2,s2);
if(pe) if(pe)
{ {
@ -908,9 +908,9 @@ static void server_process_packet (unsigned bytes, UBUF * ub, int old,
send_error(from, ub, pe) ; send_error(from, ub, pe) ;
return; return;
} }
CHECK_ACCESS_RIGHTS(DIR_RENAME,L_RENAME); CHECK_ACCESS_RIGHTS(DIR_RENAME,L_RENAME);
srcdir=di; srcdir=di;
srcpath=pp; srcpath=pp;
@ -923,7 +923,7 @@ static void server_process_packet (unsigned bytes, UBUF * ub, int old,
{ {
if(FSP_STAT(s2,&sb)) if(FSP_STAT(s2,&sb))
istargetdir=-1; /* non - existent! */ istargetdir=-1; /* non - existent! */
else else
if(S_ISDIR(sb.st_mode)) if(S_ISDIR(sb.st_mode))
istargetdir=1; istargetdir=1;
else else
@ -932,7 +932,7 @@ static void server_process_packet (unsigned bytes, UBUF * ub, int old,
else else
pe = ("Refusing to operate on special files"); pe = ("Refusing to operate on special files");
} }
if (!pe) if (!pe)
{ {
if (istargetdir == 1) if (istargetdir == 1)