Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 61E5117C97 for ; Fri, 10 Oct 2014 12:59:04 +0000 (UTC) Received: (qmail 51399 invoked by uid 500); 10 Oct 2014 12:59:04 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 51369 invoked by uid 500); 10 Oct 2014 12:59:04 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 51360 invoked by uid 99); 10 Oct 2014 12:59:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2014 12:59:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2014 12:58:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7F6DA23888A6; Fri, 10 Oct 2014 12:58:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1630870 - in /qpid/proton/branches/examples/proton-c: include/proton/transport.h src/engine/engine-internal.h src/transport/transport.c Date: Fri, 10 Oct 2014 12:58:40 -0000 To: commits@qpid.apache.org From: gsim@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141010125840.7F6DA23888A6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gsim Date: Fri Oct 10 12:58:40 2014 New Revision: 1630870 URL: http://svn.apache.org/r1630870 Log: add a backwords compatible pn_transport_error Modified: qpid/proton/branches/examples/proton-c/include/proton/transport.h qpid/proton/branches/examples/proton-c/src/engine/engine-internal.h qpid/proton/branches/examples/proton-c/src/transport/transport.c Modified: qpid/proton/branches/examples/proton-c/include/proton/transport.h URL: http://svn.apache.org/viewvc/qpid/proton/branches/examples/proton-c/include/proton/transport.h?rev=1630870&r1=1630869&r2=1630870&view=diff ============================================================================== --- qpid/proton/branches/examples/proton-c/include/proton/transport.h (original) +++ qpid/proton/branches/examples/proton-c/include/proton/transport.h Fri Oct 10 12:58:40 2014 @@ -118,6 +118,11 @@ PN_EXTERN void pn_transport_free(pn_tran PN_EXTERN pn_condition_t *pn_transport_condition(pn_transport_t *transport); /** + * @deprecated + */ +PN_EXTERN pn_error_t *pn_transport_error(pn_transport_t *transport); + +/** * Binds the transport to an AMQP connection. * * @return an error code, or 0 on success Modified: qpid/proton/branches/examples/proton-c/src/engine/engine-internal.h URL: http://svn.apache.org/viewvc/qpid/proton/branches/examples/proton-c/src/engine/engine-internal.h?rev=1630870&r1=1630869&r2=1630870&view=diff ============================================================================== --- qpid/proton/branches/examples/proton-c/src/engine/engine-internal.h (original) +++ qpid/proton/branches/examples/proton-c/src/engine/engine-internal.h Fri Oct 10 12:58:40 2014 @@ -128,6 +128,7 @@ struct pn_transport_t { uint32_t remote_max_frame; pn_condition_t remote_condition; pn_condition_t condition; + pn_error_t *error; #define PN_IO_SSL 0 #define PN_IO_SASL 1 Modified: qpid/proton/branches/examples/proton-c/src/transport/transport.c URL: http://svn.apache.org/viewvc/qpid/proton/branches/examples/proton-c/src/transport/transport.c?rev=1630870&r1=1630869&r2=1630870&view=diff ============================================================================== --- qpid/proton/branches/examples/proton-c/src/transport/transport.c (original) +++ qpid/proton/branches/examples/proton-c/src/transport/transport.c Fri Oct 10 12:58:40 2014 @@ -164,6 +164,7 @@ static void pn_transport_initialize(void transport->disp_data = pn_data(0); pn_condition_init(&transport->remote_condition); pn_condition_init(&transport->condition); + transport->error = pn_error(); transport->local_channels = pn_hash(PN_OBJECT, 0, 0.75); transport->remote_channels = pn_hash(PN_OBJECT, 0, 0.75); @@ -258,6 +259,7 @@ static void pn_transport_finalize(void * pn_free(transport->disp_data); pn_condition_tini(&transport->remote_condition); pn_condition_tini(&transport->condition); + pn_error_free(transport->error); pn_free(transport->local_channels); pn_free(transport->remote_channels); if (transport->input_buf) free(transport->input_buf); @@ -349,7 +351,15 @@ int pn_transport_unbind(pn_transport_t * pn_error_t *pn_transport_error(pn_transport_t *transport) { - return NULL; + assert(transport); + if (pn_condition_is_set(&transport->condition)) { + pn_error_format(transport->error, PN_ERR, "%s: %s", + pn_condition_get_name(&transport->condition), + pn_condition_get_description(&transport->condition)); + } else { + pn_error_clear(transport->error); + } + return transport->error; } pn_condition_t *pn_transport_condition(pn_transport_t *transport) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org