return GNUNET_NO;
}
+
/**
* Read data from a connected socket (always non-blocking).
* @param desc socket
#endif
}
+
+/**
+ * Return file descriptor for this network handle
+ *
+ * @param desc wrapper to process
+ * @return POSIX file descriptor
+ */
int
GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc)
{
return desc->fd;
}
+
/**
* Copy a native fd set
*
void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
int nfd)
{
+ GNUNET_assert(nfd >= 0);
FD_SET (nfd, &to->sds);
to->nsds = GNUNET_MAX (nfd + 1, to->nsds);
}
{
if (!PeekNamedPipe (fh->h, NULL, 0, NULL, &dwBytes, NULL))
{
- retcode = -1;
- SetErrnoFromWinError (GetLastError ());
+ DWORD error_code = GetLastError ();
+ switch (error_code)
+ {
+ case ERROR_BROKEN_PIPE:
+ GNUNET_CONTAINER_slist_add (handles_read,
+ GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+ fh, sizeof (struct GNUNET_DISK_FileHandle));
+ retcode++;
+ break;
+ default:
+ retcode = -1;
+ SetErrnoFromWinError (error_code);
#if DEBUG_NETWORK
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
- "PeekNamedPipe");
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
+ "PeekNamedPipe");
#endif
- goto select_loop_end;
+ goto select_loop_end;
+ }
}
else if (dwBytes)