This commit is contained in:
Your Name 2024-07-01 10:26:22 +03:00
parent f207924062
commit 83063037ac

View File

@ -20,7 +20,7 @@
#define MSG4 "No namespace available.\n"
#ifndef VERSION
#define VERSION "1"
#define VERSION "1.1"
#endif
int iport = 8080;
@ -99,7 +99,7 @@ char *rand_string(void) {
}
char *rand_name(void) {
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 1000; i++) {
char *filename = rand_string();
if (filename == NULL)
continue;
@ -186,14 +186,16 @@ void upload(int cfd, pid_t par) {
/* Clear */
UPL_ERROR:
if (buf != NULL)
if (buf)
free(buf);
if (ffd != -1)
close(ffd);
if (ret == -1)
fprintf(stderr, "%s: input thread: %s: %s\n", prog_name, filename, strerror(errno));
fprintf(stderr, "%s: input thread: %s: %s\n", prog_name, (filename) ? filename : "NULL", strerror(errno));
if (filename)
free(filename);
close(cfd);
@ -267,14 +269,16 @@ void load(int cfd, pid_t par) {
/* Clear */
LD_ERROR:
if (buf != NULL)
if (buf)
free(buf);
if (ffd != -1)
close(ffd);
if (ret == -1)
fprintf(stderr, "%s: output thread: %s: %s\n", prog_name, filename, strerror(errno));
fprintf(stderr, "%s: output thread: %s: %s\n", prog_name, (filename) ? filename : "NULL", strerror(errno));
if (filename)
free(filename);
sleep(1);