[svn] assuan - r265 - trunk/src
svn author marcus
cvs at cvs.gnupg.org
Mon Sep 24 11:50:14 CEST 2007
Author: marcus
Date: 2007-09-24 11:50:01 +0200 (Mon, 24 Sep 2007)
New Revision: 265
Modified:
trunk/src/ChangeLog
trunk/src/assuan-uds.c
Log:
2007-09-24 Marcus Brinkmann <marcus at g10code.de>
* assuan-uds.c (uds_reader) [HAVE_W32_SYSTEM]: Do not touch the
UDS structure in the context. Reported by Frank Osterfeld.
(uds_writer): Clarify code.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2007-09-14 14:23:45 UTC (rev 264)
+++ trunk/src/ChangeLog 2007-09-24 09:50:01 UTC (rev 265)
@@ -1,3 +1,9 @@
+2007-09-24 Marcus Brinkmann <marcus at g10code.de>
+
+ * assuan-uds.c (uds_reader) [HAVE_W32_SYSTEM]: Do not touch the
+ UDS structure in the context. Reported by Frank Osterfeld.
+ (uds_writer): Clarify code.
+
2007-09-14 Marcus Brinkmann <marcus at g10code.de>
* assuan-pipe-connect.c (do_finish) [HAVE_W32_SYSTEM]: Close
Modified: trunk/src/assuan-uds.c
===================================================================
--- trunk/src/assuan-uds.c 2007-09-14 14:23:45 UTC (rev 264)
+++ trunk/src/assuan-uds.c 2007-09-24 09:50:01 UTC (rev 265)
@@ -70,9 +70,9 @@
static ssize_t
uds_reader (assuan_context_t ctx, void *buf, size_t buflen)
{
+#ifndef HAVE_W32_SYSTEM
int len = ctx->uds.buffersize;
-#ifndef HAVE_W32_SYSTEM
if (!ctx->uds.bufferallocated)
{
ctx->uds.buffer = xtrymalloc (2048);
@@ -139,12 +139,6 @@
#endif /*USE_DESCRIPTOR_PASSING*/
}
-#else /*HAVE_W32_SYSTEM*/
-
- len = recvfrom (HANDLE2SOCKET(ctx->inbound.fd), buf, buflen, 0, NULL, NULL);
-
-#endif /*HAVE_W32_SYSTEM*/
-
/* Return some data to the user. */
if (len > buflen) /* We have more than the user requested. */
@@ -157,6 +151,9 @@
assert (ctx->uds.bufferoffset <= ctx->uds.bufferallocated);
return len;
+#else /*HAVE_W32_SYSTEM*/
+ return recvfrom (HANDLE2SOCKET(ctx->inbound.fd), buf, buflen, 0, NULL, NULL);
+#endif /*HAVE_W32_SYSTEM*/
}
@@ -179,14 +176,13 @@
iovec.iov_len = buflen;
len = _assuan_simple_sendmsg (ctx, &msg);
+
+ return len;
#else /*HAVE_W32_SYSTEM*/
- int len;
-
- len = sendto (HANDLE2SOCKET(ctx->outbound.fd), buf, buflen, 0,
- (struct sockaddr *)&ctx->serveraddr,
- sizeof (struct sockaddr_in));
+ return sendto (HANDLE2SOCKET(ctx->outbound.fd), buf, buflen, 0,
+ (struct sockaddr *)&ctx->serveraddr,
+ sizeof (struct sockaddr_in));
#endif /*HAVE_W32_SYSTEM*/
- return len;
}
More information about the Gnupg-commits
mailing list