Skip to content
Snippets Groups Projects
Commit 3709ae9d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Free/zero out the file_t struct *after* sending the MQTT action msg

... not before. This explains why FTP-uploaded actions had a (null) filename.
parent 4f8a243a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3750 passed
...@@ -1093,7 +1093,6 @@ static void receive_thread(void* arg) ...@@ -1093,7 +1093,6 @@ static void receive_thread(void* arg)
lprintf(LOG_ERR,"%04d <%s> !DATA ERROR adding file (%s) to database" lprintf(LOG_ERR,"%04d <%s> !DATA ERROR adding file (%s) to database"
,xfer.ctrl_sock, xfer.user->alias, f.name); ,xfer.ctrl_sock, xfer.user->alias, f.name);
} }
smb_freefilemem(&f);
if(scfg.dir[f.dir]->upload_sem[0]) if(scfg.dir[f.dir]->upload_sem[0])
ftouch(scfg.dir[f.dir]->upload_sem); ftouch(scfg.dir[f.dir]->upload_sem);
...@@ -1113,6 +1112,7 @@ static void receive_thread(void* arg) ...@@ -1113,6 +1112,7 @@ static void receive_thread(void* arg)
inc_upload_stats(&scfg, 1, (ulong)total); inc_upload_stats(&scfg, 1, (ulong)total);
mqtt_file_upload(&mqtt, xfer.user, &f, total, xfer.client); mqtt_file_upload(&mqtt, xfer.user, &f, total, xfer.client);
smb_freefilemem(&f);
} }
/* Send ACK */ /* Send ACK */
sockprintf(xfer.ctrl_sock,sess,"226 Upload complete (%lu cps).",cps); sockprintf(xfer.ctrl_sock,sess,"226 Upload complete (%lu cps).",cps);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment