Another popup string

This commit is contained in:
2025-04-19 02:18:15 -04:00
parent 688f2fddf2
commit aaead901ae

View File

@ -839,7 +839,8 @@ static void read_req_cb(int req_fd, void *)
int sock_fd; int sock_fd;
socklen_t csz; socklen_t csz;
Dsh *sh = NULL; Dsh *sh = NULL;
char *dpip_tag = NULL, *cmd = NULL, *url = NULL, *dl_dest = NULL, *ua = NULL; char *dpip_tag = NULL, *cmd_ptr = NULL, *url = NULL, *dl_dest = NULL, *ua = NULL;
std::string cmd;
/* Initialize the value-result parameter */ /* Initialize the value-result parameter */
csz = sizeof(struct sockaddr_un); csz = sizeof(struct sockaddr_un);
@ -873,16 +874,17 @@ static void read_req_cb(int req_fd, void *)
a_Dpip_dsh_close(sh); a_Dpip_dsh_close(sh);
_MSG("Received tag={%s}\n", dpip_tag); _MSG("Received tag={%s}\n", dpip_tag);
if ((cmd = a_Dpip_get_attr(dpip_tag, "cmd")) == NULL) { if ((cmd_ptr = a_Dpip_get_attr(dpip_tag, "cmd")) == NULL) {
MSG("Failed to parse 'cmd' in {%s}\n", dpip_tag); MSG("Failed to parse 'cmd' in {%s}\n", dpip_tag);
goto end; goto end;
} }
if (strcmp(cmd, "DpiBye") == 0) { cmd= cmd_ptr;
if (strcmp(cmd.c_str(), "DpiBye") == 0) {
MSG("got DpiBye, ignoring...\n"); MSG("got DpiBye, ignoring...\n");
goto end; goto end;
} }
if (strcmp(cmd, "download") != 0) { if (strcmp(cmd.c_str(), "download") != 0) {
MSG("unknown command: '%s'. Aborting.\n", cmd); MSG("unknown command: '%s'. Aborting.\n", cmd.c_str());
goto end; goto end;
} }
if (!(url = a_Dpip_get_attr(dpip_tag, "url"))){ if (!(url = a_Dpip_get_attr(dpip_tag, "url"))){
@ -900,7 +902,6 @@ static void read_req_cb(int req_fd, void *)
dl_win->add(dl_dest, url, ua); dl_win->add(dl_dest, url, ua);
end: end:
dFree(cmd);
dFree(url); dFree(url);
dFree(dl_dest); dFree(dl_dest);
dFree(dpip_tag); dFree(dpip_tag);