openFile, readFile
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
#define LOGBUFSIZE 2048
|
||||
|
||||
#define MEOK "20" //OK
|
||||
#define MEHE "21" // help message
|
||||
// #define ME "21" // not used
|
||||
// #define ME "22" // not used
|
||||
#define MEFP "25" // file purged
|
||||
|
||||
@ -131,6 +131,12 @@ void sendMessageFile(char *m, fileT *f, long fd_c, taglia_t *taglia, char *mlog)
|
||||
goto _sendMF_cleanup;
|
||||
}
|
||||
|
||||
int n = 1;
|
||||
if(writen(fd_c, &n, sizeof(n)) < 0) {
|
||||
perror("writen");
|
||||
goto _sendMF_cleanup;
|
||||
}
|
||||
|
||||
if(sendFile(f, fd_c, taglia) < 0) {
|
||||
perror("sendFile");
|
||||
goto _sendMF_cleanup;
|
||||
@ -165,6 +171,11 @@ void sendMessageFileN(char *m, fileT **f, int n, long fd_c, taglia_t *taglia, ch
|
||||
goto _sendMFN_cleanup;
|
||||
}
|
||||
|
||||
if(write(fd_c, &n, sizeof(n)) < 0) {
|
||||
perror("writen");
|
||||
goto _sendMFN_cleanup;
|
||||
}
|
||||
|
||||
for(int i=0; i<n && (f[i]!=NULL); ++i) {
|
||||
if(sendFile(f[i], fd_c, taglia) < 0) {
|
||||
perror("sendFile");
|
||||
|
||||
Reference in New Issue
Block a user