You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/09/15 14:55:37 UTC

[3/3] qpid-proton git commit: PROTON-1302: Remove use of pn_io_t from C++ binding - Added pn_reactor_error() API

PROTON-1302: Remove use of pn_io_t from C++ binding
- Added pn_reactor_error() API


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/077eea5a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/077eea5a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/077eea5a

Branch: refs/heads/master
Commit: 077eea5a8912c251202c3b2102d69b818795625b
Parents: bf615ad
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Sep 12 16:02:16 2016 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Sep 15 10:10:16 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/cpp/src/container_impl.cpp | 2 +-
 proton-c/bindings/cpp/src/reactor.cpp        | 4 ----
 proton-c/include/proton/reactor.h            | 2 +-
 proton-c/src/reactor/reactor.c               | 5 +++++
 4 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/bindings/cpp/src/container_impl.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/container_impl.cpp b/proton-c/bindings/cpp/src/container_impl.cpp
index f2cad7f..aca67ae 100644
--- a/proton-c/bindings/cpp/src/container_impl.cpp
+++ b/proton-c/bindings/cpp/src/container_impl.cpp
@@ -244,7 +244,7 @@ listener container_impl::listen(const std::string& url, listen_handler& lh) {
     pn_acceptor_t *acptr = pn_reactor_acceptor(
         reactor_.pn_object(), u.host().c_str(), u.port().c_str(), chandler.get());
     if (!acptr) {
-        std::string err(pn_error_text(pn_io_error(reactor_.pn_io())));
+        std::string err(pn_error_text(pn_reactor_error(reactor_.pn_object())));
         lh.on_error(err);
         lh.on_close();
         throw error(err);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/bindings/cpp/src/reactor.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/reactor.cpp b/proton-c/bindings/cpp/src/reactor.cpp
index 20d331c..15547f0 100644
--- a/proton-c/bindings/cpp/src/reactor.cpp
+++ b/proton-c/bindings/cpp/src/reactor.cpp
@@ -61,10 +61,6 @@ connection reactor::connection_to_host(const std::string &host, const std::strin
     return make_wrapper(pn_reactor_connection_to_host(pn_object(), host.c_str(), port.c_str(), h));
 }
 
-pn_io_t* reactor::pn_io() const {
-    return pn_reactor_io(pn_object());
-}
-
 void reactor::pn_handler(pn_handler_t* h) {
     pn_reactor_set_handler(pn_object(), h);
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/include/proton/reactor.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/reactor.h b/proton-c/include/proton/reactor.h
index 5a33a0b..78fe57b 100644
--- a/proton-c/include/proton/reactor.h
+++ b/proton-c/include/proton/reactor.h
@@ -74,7 +74,7 @@ PN_EXTERN pn_selectable_t *pn_reactor_selectable(pn_reactor_t *reactor);
 PN_EXTERN void pn_reactor_update(pn_reactor_t *reactor, pn_selectable_t *selectable);
 PN_EXTERN pn_acceptor_t *pn_reactor_acceptor(pn_reactor_t *reactor, const char *host, const char *port,
                                              pn_handler_t *handler);
-
+PN_EXTERN pn_error_t *pn_reactor_error(pn_reactor_t *reactor);
 
 /**
  * Create an outgoing connection that will be managed by the reactor.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/077eea5a/proton-c/src/reactor/reactor.c
----------------------------------------------------------------------
diff --git a/proton-c/src/reactor/reactor.c b/proton-c/src/reactor/reactor.c
index 31cce08..a83a881 100644
--- a/proton-c/src/reactor/reactor.c
+++ b/proton-c/src/reactor/reactor.c
@@ -169,6 +169,11 @@ pn_io_t *pn_reactor_io(pn_reactor_t *reactor) {
   return reactor->io;
 }
 
+pn_error_t *pn_reactor_error(pn_reactor_t *reactor) {
+  assert(reactor);
+  return pn_io_error(reactor->io);
+}
+
 pn_collector_t *pn_reactor_collector(pn_reactor_t *reactor) {
   assert(reactor);
   return reactor->collector;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org