fixed
This commit is contained in:
parent
83063037ac
commit
4e856a1324
12
plainbin.c
12
plainbin.c
@ -15,7 +15,7 @@
|
|||||||
#define SEND_TIMEOUT 1
|
#define SEND_TIMEOUT 1
|
||||||
#define RECV_TIMEOUT 2
|
#define RECV_TIMEOUT 2
|
||||||
#define MSG1 "Server is very busy.\n"
|
#define MSG1 "Server is very busy.\n"
|
||||||
#define MSG2 "The file is very large.\n"
|
#define MSG2 "File is very large.\n"
|
||||||
#define MSG3 "No such file.\n"
|
#define MSG3 "No such file.\n"
|
||||||
#define MSG4 "No namespace available.\n"
|
#define MSG4 "No namespace available.\n"
|
||||||
|
|
||||||
@ -288,11 +288,15 @@ LD_ERROR:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sig_handler(int sig) {
|
void sig_handler(int sig) {
|
||||||
if (sig == SIGUSR1)
|
if (sig == SIGUSR1) {
|
||||||
|
if (ifd_clients)
|
||||||
ifd_clients--;
|
ifd_clients--;
|
||||||
|
}
|
||||||
|
|
||||||
else if (sig == SIGUSR2)
|
else if (sig == SIGUSR2) {
|
||||||
|
if (ofd_clients)
|
||||||
ofd_clients--;
|
ofd_clients--;
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
close(ifd);
|
close(ifd);
|
||||||
@ -393,7 +397,7 @@ int main(int argc, char **argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("%s [iomdsnbtV] - Simple file sharing server\n\t-i NUM Input port\tdefault: %d\n\t-o NUM Output port\tdefault: %d\n\t-m NUM Max clients\tdefault: %zu\n\t-d DIR Word directory\tdefault: %s\n\t-s NUM Max file size\tdefault: %zuMB\n\t-n NUM Filename length\tdefault: %zu\n\t-b NUM Buffer size\tdefault: %zuB\n\t-t STR Set MOTD\n\t-V Print version and license\n", prog_name, iport, oport, max_clients, dir, max_size, name_len, buf_size);
|
printf("%s [iomdsnbtV] - Simple file sharing server\n\t-i NUM Input port\tdefault: %d\n\t-o NUM Output port\tdefault: %d\n\t-m NUM Max clients\tdefault: %zu\n\t-d STR Working dir\tdefault: %s\n\t-s NUM Max file size\tdefault: %zuMB\n\t-n NUM Filename length\tdefault: %zu\n\t-b NUM Buffer size\tdefault: %zuB\n\t-t STR Set MOTD\n\t-V Print version and license\n", prog_name, iport, oport, max_clients, dir, max_size, name_len, buf_size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user