added LRU and fixed bug in dequeueN

This commit is contained in:
elvis
2022-05-19 21:32:44 +02:00
parent 27be55993c
commit 4283d5450e
7 changed files with 209 additions and 28 deletions

View File

@ -666,6 +666,15 @@ int writeFile(const char* pathname, const char* dirname) {
}
}
}
freeResponse(res);
free(res);
res = calloc(1, sizeof(response_t));
if(!res){
perror("writeFile: calloc");
free(content);
free(cmd);
return -1;
}
/* send file to server */
if (writen(fd_skt, content, size) == -1) {
@ -677,7 +686,6 @@ int writeFile(const char* pathname, const char* dirname) {
return -1;
}
/* reciveData(, 0) because if we get a MEOK we don't expect files */
if(reciveData(res, 0) < 0) {
/* errno is set by reciveData */