[Gpg4win-commits] r1485 - in trunk: . patches/gpgme
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jul 22 20:55:38 CEST 2010
Author: werner
Date: 2010-07-22 20:55:37 +0200 (Thu, 22 Jul 2010)
New Revision: 1485
Added:
trunk/patches/gpgme/02-w32-io-threads.patch
Modified:
trunk/ChangeLog
trunk/Makefile.am
Log:
Fixed blocking of most operations
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-21 11:42:24 UTC (rev 1484)
+++ trunk/ChangeLog 2010-07-22 18:55:37 UTC (rev 1485)
@@ -1,3 +1,8 @@
+2010-07-22 Werner Koch <wk at g10code.com>
+
+ * patches/gpgme/02-w32-io-threads.patch: Revert the theoretical
+ more robust pipe/thread creation.
+
2010-07-21 Werner Koch <wk at g10code.com>
* src/uninst-gpgol.nsi, src/inst-gpgol.nsi: Install pt and sv locale.
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2010-07-21 11:42:24 UTC (rev 1484)
+++ trunk/Makefile.am 2010-07-22 18:55:37 UTC (rev 1485)
@@ -30,6 +30,7 @@
patches/glib-2.20.0/01-socket.patch \
patches/glib-2.24.0/01-socket.patch \
patches/gpgme/01-gpg2.patch \
+ patches/gpgme/02-w32-io-threads.patch \
patches/gpgme-1.1.7/01-registry.patch \
patches/gpgme-1.1.7/02-extern-umlaute.patch \
patches/gpgme-1.1.7/03-error-parsing.patch \
Added: trunk/patches/gpgme/02-w32-io-threads.patch
===================================================================
--- trunk/patches/gpgme/02-w32-io-threads.patch 2010-07-21 11:42:24 UTC (rev 1484)
+++ trunk/patches/gpgme/02-w32-io-threads.patch 2010-07-22 18:55:37 UTC (rev 1485)
@@ -0,0 +1,136 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+Revert a change that needs more testing.
+
+diff -rup src/w32-io.c src/w32-io.c
+--- src/w32-io.c 2009-06-21 00:55:40.000000000 +0200
++++ src/w32-io.c 2009-06-21 00:56:01.000000000 +0200
+@@ -389,12 +389,9 @@ find_reader (int fd, int start_it)
+ if (i != reader_table_size)
+ {
+ rd = create_reader (fd_to_handle (fd));
+- if (rd)
+- {
+- reader_table[i].fd = fd;
+- reader_table[i].context = rd;
+- reader_table[i].used = 1;
+- }
++ reader_table[i].fd = fd;
++ reader_table[i].context = rd;
++ reader_table[i].used = 1;
+ }
+
+ UNLOCK (reader_table_lock);
+@@ -695,12 +692,9 @@ find_writer (int fd, int start_it)
+ if (i != writer_table_size)
+ {
+ wt = create_writer (fd_to_handle (fd));
+- if (wt)
+- {
+- writer_table[i].fd = fd;
+- writer_table[i].context = wt;
+- writer_table[i].used = 1;
+- }
++ writer_table[i].fd = fd;
++ writer_table[i].context = wt;
++ writer_table[i].used = 1;
+ }
+
+ UNLOCK (writer_table_lock);
+@@ -739,7 +733,7 @@ _gpgme_io_write (int fd, const void *buf
+ if (count == 0)
+ return TRACE_SYSRES (0);
+
+- ctx = find_writer (fd, 0);
++ ctx = find_writer (fd, 1);
+ if (!ctx)
+ return TRACE_SYSRES (-1);
+
+@@ -832,7 +826,6 @@ _gpgme_io_pipe (int filedes[2], int inhe
+ /* Make one end inheritable. */
+ if (inherit_idx == 0)
+ {
+- struct writer_context_s *ctx;
+ HANDLE hd;
+ if (!DuplicateHandle (GetCurrentProcess(), rh,
+ GetCurrentProcess(), &hd, 0,
+@@ -848,22 +841,9 @@ _gpgme_io_pipe (int filedes[2], int inhe
+ }
+ CloseHandle (rh);
+ rh = hd;
+-
+- ctx = find_writer (handle_to_fd (wh), 0);
+- assert (ctx == NULL);
+- ctx = find_writer (handle_to_fd (wh), 1);
+- if (!ctx)
+- {
+- CloseHandle (rh);
+- CloseHandle (wh);
+- /* FIXME: Should translate the error code. */
+- errno = EIO;
+- return TRACE_SYSRES (-1);
+- }
+ }
+ else if (inherit_idx == 1)
+ {
+- struct reader_context_s *ctx;
+ HANDLE hd;
+ if (!DuplicateHandle( GetCurrentProcess(), wh,
+ GetCurrentProcess(), &hd, 0,
+@@ -879,18 +859,6 @@ _gpgme_io_pipe (int filedes[2], int inhe
+ }
+ CloseHandle (wh);
+ wh = hd;
+-
+- ctx = find_reader (handle_to_fd (rh), 0);
+- assert (ctx == NULL);
+- ctx = find_reader (handle_to_fd (rh), 1);
+- if (!ctx)
+- {
+- CloseHandle (rh);
+- CloseHandle (wh);
+- /* FIXME: Should translate the error code. */
+- errno = EIO;
+- return TRACE_SYSRES (-1);
+- }
+ }
+
+ filedes[0] = handle_to_fd (rh);
+@@ -1280,7 +1248,7 @@ _gpgme_io_select (struct io_select_fd_s
+ {
+ if (fds[i].for_read)
+ {
+- struct reader_context_s *ctx = find_reader (fds[i].fd,0);
++ struct reader_context_s *ctx = find_reader (fds[i].fd,1);
+
+ if (!ctx)
+ TRACE_LOG1 ("error: no reader for FD 0x%x (ignored)",
+@@ -1303,7 +1271,7 @@ _gpgme_io_select (struct io_select_fd_s
+ }
+ else if (fds[i].for_write)
+ {
+- struct writer_context_s *ctx = find_writer (fds[i].fd,0);
++ struct writer_context_s *ctx = find_writer (fds[i].fd,1);
+
+ if (!ctx)
+ TRACE_LOG1 ("error: no writer for FD 0x%x (ignored)",
+@@ -1449,7 +1417,7 @@ _gpgme_io_dup (int fd)
+ return TRACE_SYSRES (-1);
+ }
+
+- rd_ctx = find_reader (fd, 0);
++ rd_ctx = find_reader (fd, 1);
+ if (rd_ctx)
+ {
+ /* No need for locking, as the only races are against the reader
+@@ -1468,7 +1436,7 @@ _gpgme_io_dup (int fd)
+ UNLOCK (reader_table_lock);
+ }
+
+- wt_ctx = find_writer (fd, 0);
++ wt_ctx = find_writer (fd, 1);
+ if (wt_ctx)
+ {
+ /* No need for locking, as the only races are against the writer
Property changes on: trunk/patches/gpgme/02-w32-io-threads.patch
___________________________________________________________________
Name: svn:executable
+ *
More information about the Gpg4win-commits
mailing list