[git] GnuPG - branch, master, updated. gnupg-2.1.20-81-g4b2581d
by NIIBE Yutaka
cvs at cvs.gnupg.org
Tue Apr 18 02:04:30 CEST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via 4b2581dc0ea1d03e70023bb0748aa0c21c0a2173 (commit)
via 0d0a7efa8fa0accc1da851917376e2328ef33c96 (commit)
from 9296aed4bd2ad09d23339e658264e557c5312585 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4b2581dc0ea1d03e70023bb0748aa0c21c0a2173
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Tue Apr 18 09:04:11 2017 +0900
dirmngr: Fix final close of LISTEN_FD.
* dirmngr/dirmngr.c (handle_connections): Close LISTEN_FD.
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 36716c6..8393e0b 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -2046,7 +2046,6 @@ handle_connections (assuan_fd_t listen_fd)
#endif
struct sockaddr_un paddr;
socklen_t plen = sizeof( paddr );
- gnupg_fd_t fd;
int nfd, ret;
fd_set fdset, read_fdset;
struct timespec abstime;
@@ -2190,6 +2189,8 @@ handle_connections (assuan_fd_t listen_fd)
if (FD_ISSET (FD2INT (listen_fd), &read_fdset))
{
+ gnupg_fd_t fd;
+
plen = sizeof paddr;
fd = INT2FD (npth_accept (FD2INT(listen_fd),
(struct sockaddr *)&paddr, &plen));
@@ -2218,7 +2219,6 @@ handle_connections (assuan_fd_t listen_fd)
}
npth_setname_np (thread, threadname);
}
- fd = GNUPG_INVALID_FD;
}
}
@@ -2228,7 +2228,7 @@ handle_connections (assuan_fd_t listen_fd)
#endif /*HAVE_INOTIFY_INIT*/
npth_attr_destroy (&tattr);
if (listen_fd != GNUPG_INVALID_FD)
- assuan_sock_close (fd);
+ assuan_sock_close (listen_fd);
cleanup ();
log_info ("%s %s stopped\n", strusage(11), strusage(13));
}
commit 0d0a7efa8fa0accc1da851917376e2328ef33c96
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Tue Apr 18 09:03:14 2017 +0900
dirmngr: Fix API difference for Windows.
* dirmngr/http.c (read_server, write_server): Use assuan_fd_t.
(http_wait_response): Use FD2INT to get unsigned integer fd.
(read_server, write_server): Likewise.
(simple_cookie_read, simple_cookie_write): Use assuan_fd_t.
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/dirmngr/http.c b/dirmngr/http.c
index 9b70599..e74d051 100644
--- a/dirmngr/http.c
+++ b/dirmngr/http.c
@@ -98,6 +98,7 @@
#include "../common/util.h"
#include "../common/i18n.h"
+#include "../common/sysutils.h" /* (gnupg_fd_t) */
#include "dns-stuff.h"
#include "http.h"
#include "http-common.h"
@@ -159,8 +160,8 @@ static gpg_error_t parse_response (http_t hd);
static gpg_error_t connect_server (const char *server, unsigned short port,
unsigned int flags, const char *srvtag,
assuan_fd_t *r_sock);
-static gpgrt_ssize_t read_server (int sock, void *buffer, size_t size);
-static gpg_error_t write_server (int sock, const char *data, size_t length);
+static gpgrt_ssize_t read_server (assuan_fd_t sock, void *buffer, size_t size);
+static gpg_error_t write_server (assuan_fd_t sock, const char *data, size_t length);
static gpgrt_ssize_t cookie_read (void *cookie, void *buffer, size_t size);
static gpgrt_ssize_t cookie_write (void *cookie,
@@ -1065,7 +1066,7 @@ http_wait_response (http_t hd)
is not required but some very old servers (e.g. the original pksd
keyserver didn't worked without it. */
if ((hd->flags & HTTP_FLAG_SHUTDOWN))
- shutdown (hd->sock->fd, 1);
+ shutdown (FD2INT (hd->sock->fd), 1);
hd->in_data = 0;
/* Create a new cookie and a stream for reading. */
@@ -2694,7 +2695,7 @@ connect_server (const char *server, unsigned short port,
/* Helper to read from a socket. This handles npth things and
* EINTR. */
static gpgrt_ssize_t
-read_server (int sock, void *buffer, size_t size)
+read_server (assuan_fd_t sock, void *buffer, size_t size)
{
int nread;
@@ -2705,7 +2706,7 @@ read_server (int sock, void *buffer, size_t size)
# if defined(USE_NPTH)
npth_unprotect ();
# endif
- nread = recv (sock, buffer, size, 0);
+ nread = recv (FD2INT (sock), buffer, size, 0);
# if defined(USE_NPTH)
npth_protect ();
# endif
@@ -2727,7 +2728,7 @@ read_server (int sock, void *buffer, size_t size)
static gpg_error_t
-write_server (int sock, const char *data, size_t length)
+write_server (assuan_fd_t sock, const char *data, size_t length)
{
int nleft;
int nwritten;
@@ -2739,7 +2740,7 @@ write_server (int sock, const char *data, size_t length)
# if defined(USE_NPTH)
npth_unprotect ();
# endif
- nwritten = send (sock, data, nleft, 0);
+ nwritten = send (FD2INT (sock), data, nleft, 0);
# if defined(USE_NPTH)
npth_protect ();
# endif
@@ -2927,14 +2928,14 @@ cookie_write (void *cookie, const void *buffer_arg, size_t size)
static gpgrt_ssize_t
simple_cookie_read (void *cookie, void *buffer, size_t size)
{
- int sock = (int)(uintptr_t)cookie;
+ assuan_fd_t sock = (assuan_fd_t)cookie;
return read_server (sock, buffer, size);
}
static gpgrt_ssize_t
simple_cookie_write (void *cookie, const void *buffer_arg, size_t size)
{
- int sock = (int)(uintptr_t)cookie;
+ assuan_fd_t sock = (assuan_fd_t)cookie;
const char *buffer = buffer_arg;
int nwritten;
-----------------------------------------------------------------------
Summary of changes:
dirmngr/dirmngr.c | 6 +++---
dirmngr/http.c | 19 ++++++++++---------
2 files changed, 13 insertions(+), 12 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list