This commit is contained in:
Your Name 2024-09-28 22:53:02 +03:00
parent e409d6e7eb
commit 1b84b07f8c

View File

@ -20,7 +20,7 @@
#define MSG4 "No namespace available.\n"
#ifndef VERSION
#define VERSION "1.2.2"
#define VERSION "1.2.3"
#endif
typedef struct {
@ -102,6 +102,7 @@ NEW_SOCKET_ERROR:
char rand_name(char *buf) {
const char abc[] = "asdfghjklzxcvbnmqwertyuiopQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
srand(time(NULL));
for (int i = 0; i < 1000; i++) {
for (size_t i = 0; i < cfg.name_len; i++)
buf[i] = abc[rand() % (sizeof(abc) - 1)];
@ -111,8 +112,6 @@ char rand_name(char *buf) {
struct stat sb;
if (stat(buf, &sb) < 0)
return 0;
return 1;
}
return 1;
@ -248,7 +247,6 @@ void Proc(int fd, int flag) {
if (cfd < 0)
continue;
printf("%d\n", clients);
if (clients < cfg.max_clients) {
clients++;
@ -294,8 +292,6 @@ void Proc(int fd, int flag) {
}
int main(int argc, char **argv) {
srand(time(NULL));
signal(SIGUSR1, sig_handler);
signal(SIGINT, sig_handler);
signal(SIGTERM, sig_handler);