diff options
author | pjd <pjd@FreeBSD.org> | 2011-04-02 09:25:13 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-04-02 09:25:13 +0000 |
commit | 52d273ec9959ccf9598a661f0a5a837ee5579642 (patch) | |
tree | aa8444fa1d6e606bb8bcd8bbb619f18137d90429 /sbin/hastd/secondary.c | |
parent | 0a787e13ebdc9ffd37cc7980f2ba4f69d85ecb1b (diff) | |
download | FreeBSD-src-52d273ec9959ccf9598a661f0a5a837ee5579642.zip FreeBSD-src-52d273ec9959ccf9598a661f0a5a837ee5579642.tar.gz |
Declare directions for sockets between primary and secondary.
In HAST we use two sockets - one for only sending the data and one for only
receiving the data.
MFC after: 1 month
Diffstat (limited to 'sbin/hastd/secondary.c')
-rw-r--r-- | sbin/hastd/secondary.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c index f2e58bd..d47f8fa 100644 --- a/sbin/hastd/secondary.c +++ b/sbin/hastd/secondary.c @@ -183,6 +183,10 @@ init_remote(struct hast_resource *res, struct nv *nvin) unsigned char *map; size_t mapsize; + /* Setup direction. */ + if (proto_send(res->hr_remoteout, NULL, 0) == -1) + pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); + map = NULL; mapsize = 0; nvout = nv_alloc(); @@ -346,6 +350,9 @@ init_remote(struct hast_resource *res, struct nv *nvin) if (map != NULL) free(map); nv_free(nvout); + /* Setup direction. */ + if (proto_recv(res->hr_remotein, NULL, 0) == -1) + pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); if (res->hr_secondary_localcnt > res->hr_primary_remotecnt && res->hr_primary_localcnt > res->hr_secondary_remotecnt) { /* Exit on split-brain. */ |