- cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL);
- k = application_property_argv_size(dle);
- for (scriptlist = dle->scriptlist; scriptlist != NULL;
- scriptlist = scriptlist->next) {
- script = (script_t *)scriptlist->data;
- if (script->result && script->result->proplist) {
- k += property_argv_size(script->result->proplist);
+ application_api_info_tapeheader(mesgfd, dle->program, dle);
+
+ /* find directt-tcp address from indirect direct-tcp */
+ if (dle->data_path == DATA_PATH_DIRECTTCP &&
+ bsu->data_path_set & DATA_PATH_DIRECTTCP &&
+ strncmp(dle->directtcp_list->data, "255.255.255.255:", 16) == 0) {
+ char *indirect_tcp;
+ char *str_port;
+ in_port_t port;
+ int fd;
+ char buffer[32770];
+ int size;
+ char *s, *s1;
+
+ indirect_tcp = g_strdup(dle->directtcp_list->data);
+ g_slist_free(dle->directtcp_list);
+ dle->directtcp_list = NULL;
+ str_port = strchr(indirect_tcp, ':');
+ str_port++;
+ port = atoi(str_port);
+ fd = stream_client("localhost", port, 32768, 32768, NULL, 0);
+ if (fd <= 0) {
+ g_debug("Failed to connect to indirect-direct-tcp port: %s",
+ strerror(errno));
+ exit(1);
+ }
+ size = full_read(fd, buffer, 32768);
+ if (size <= 0) {
+ g_debug("Failed to read from indirect-direct-tcp port: %s",
+ strerror(errno));
+ exit(1);