{
/* try to read more */
eh->off += ret;
- eh->task
+ eh->task
= GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
eh->r,
&read_external_ipv4,
eh->buf,
&addr))
{
- if (0 != addr.s_addr)
+ if (0 == addr.s_addr)
eh->ret = GNUNET_NAT_ERROR_EXTERNAL_IP_ADDRESS_INVALID; /* got 0.0.0.0 */
else
eh->ret = GNUNET_NAT_ERROR_SUCCESS;
GNUNET_DISK_PIPE_END_WRITE);
eh->r = GNUNET_DISK_pipe_handle (eh->opipe,
GNUNET_DISK_PIPE_END_READ);
- eh->task
+ eh->task
= GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
eh->r,
&read_external_ipv4,
{
(void) GNUNET_OS_process_kill (eh->eip,
SIGKILL);
+ GNUNET_break (GNUNET_OK ==
+ GNUNET_OS_process_wait (eh->eip));
GNUNET_OS_process_destroy (eh->eip);
}
if (NULL != eh->opipe)
sizeof (pstr),
"%u",
(unsigned int) mini->port);
- mini->map_cmd
+ mini->map_cmd
= GNUNET_OS_command_run (&process_map_output,
mini,
MAP_TIMEOUT,
}
return;
}
- if (!mini->did_map)
+ if (! mini->did_map)
return; /* never mapped, won't find our mapping anyway */
/* we're looking for output of the form:
struct GNUNET_NAT_MiniHandle *mini = cls;
int ac;
- mini->refresh_task
+ mini->refresh_task
= GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ,
&do_refresh,
mini);
mini->refresh_cmd = NULL;
ac = GNUNET_YES;
}
- mini->refresh_cmd =
- GNUNET_OS_command_run (&process_refresh_output,
+ mini->refresh_cmd
+ = GNUNET_OS_command_run (&process_refresh_output,
mini,
MAP_TIMEOUT,
"upnpc",
if (GNUNET_YES != mini->did_map)
mini->ac (mini->ac_cls,
GNUNET_SYSERR,
- NULL, 0,
+ NULL,
+ 0,
GNUNET_NAT_ERROR_UPNPC_PORTMAP_FAILED);
if (NULL == mini->refresh_task)
- mini->refresh_task =
- GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ,
- &do_refresh,
- mini);
+ mini->refresh_task
+ = GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ,
+ &do_refresh,
+ mini);
return;
}
/*
}
ipa = GNUNET_strdup (ipaddr + 1);
strstr (ipa, ":")[0] = '\0';
- if (1 != inet_pton (AF_INET, ipa, &mini->current_addr.sin_addr))
+ if (1 != inet_pton (AF_INET,
+ ipa,
+ &mini->current_addr.sin_addr))
{
GNUNET_free (ipa);
return; /* skip line */
mini->current_addr.sin_len = sizeof (struct sockaddr_in);
#endif
mini->did_map = GNUNET_YES;
- mini->ac (mini->ac_cls, GNUNET_YES,
+ mini->ac (mini->ac_cls,
+ GNUNET_YES,
(const struct sockaddr *) &mini->current_addr,
sizeof (mini->current_addr),
GNUNET_NAT_ERROR_SUCCESS);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Unmapping port %u with UPnP\n",
ntohs (mini->current_addr.sin_port));
- mini->unmap_cmd
+ mini->unmap_cmd
= GNUNET_OS_command_run (&process_unmap_output,
mini,
UNMAP_TIMEOUT,