BUFFER_SIZE);
if (fc->service_to_client_bufferDataLength <= 0)
{
+#if DEBUG_SERVICE_MANAGER
if (fc->service_to_client_bufferDataLength == 0)
{
-#if DEBUG_SERVICE_MANAGER
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Service `%s' stopped sending data.\n",
fc->listen_info->serviceName);
-#endif
}
+#endif
if (fc->first_write_done != GNUNET_YES)
{
fc->service_to_client_bufferDataLength = 0;
(unsigned int) type,
GNUNET_i2s (&sender->peer));
#endif
- /* FIXME: stats... */
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# messages not delivered to any client"),
+ 1, GNUNET_NO);
}
}
}
}
if (hbits > 0)
- ret[len++] = tbl[bits & 63];
+ ret[len] = tbl[bits & 63];
return ret;
}
/**
* Handle to the core service (NULL until we've connected to it).
*/
-struct GNUNET_CORE_Handle *core;
+static struct GNUNET_CORE_Handle *core;
/**
* Handle to the peerinfo notify service (NULL until we've connected to it).
*/
-struct GNUNET_PEERINFO_NotifyContext *notify;
+static struct GNUNET_PEERINFO_NotifyContext *notify;
/**
* Our primary task for IPv4.
GNUNET_assert (dirName != NULL);
dname = GNUNET_STRINGS_filename_expand (dirName);
+ if (dname == NULL)
+ return GNUNET_SYSERR;
while ((strlen (dname) > 0) && (dname[strlen (dname) - 1] == DIR_SEPARATOR))
dname[strlen (dname) - 1] = '\0';
if (0 != STAT (dname, &istat))
GNUNET_snprintf (fn,
sizeof(fn), "/proc/%u/exe", getpid ());
size = readlink (fn, lnk, sizeof (lnk)-1);
- if ((size == 0) || (size >= sizeof(lnk)-1))
+ if (size <= 0)
{
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "readlink", fn);
return NULL;
}
+ GNUNET_assert (size < sizeof (lnk));
lnk[size] = '\0';
while ((lnk[size] != '/') && (size > 0))
size--;
unixpath,
slen);
un->sun_path[slen] = '\0';
- slen += sizeof (sa_family_t);
#if LINUX
un->sun_path[0] = '\0';
slen = sizeof (struct sockaddr_un);
+#else
+ slen += sizeof (sa_family_t);
#endif
*saddrs = (struct sockaddr*) un;
*saddrlens = slen;