[PATCH 2/3] directconn: non-build fixes that were left around.

0 views
Skip to first unread message

Octavio Alvarez

unread,
Dec 4, 2009, 3:01:48 AM12/4/09
to msn-...@googlegroups.com
---
cvr/pn_direct_conn.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/cvr/pn_direct_conn.c b/cvr/pn_direct_conn.c
index 11e4b48..ae8f53f 100644
--- a/cvr/pn_direct_conn.c
+++ b/cvr/pn_direct_conn.c
@@ -196,6 +196,9 @@ pn_direct_conn_write(struct pn_direct_conn *direct_conn,
{
/* Let's write the data. */
status = pn_stream_write (direct_conn->stream, data, len, &tmp, NULL);
+
+ if (status == G_IO_STATUS_NORMAL)
+ pn_stream_flush (direct_conn->stream, NULL);
}

if (status == G_IO_STATUS_NORMAL)
@@ -302,6 +305,7 @@ read_cb(GIOChannel *source, GIOCondition condition, gpointer data)
{
pn_error ("failed to allocate memory for read");

+ pn_direct_conn_destroy(direct_conn);
return FALSE;
}

--
1.6.5.3

Felipe Contreras

unread,
Dec 4, 2009, 5:32:27 AM12/4/09
to Octavio Alvarez, msn-...@googlegroups.com
On Fri, Dec 4, 2009 at 10:01 AM, Octavio Alvarez
<alva...@alvarezp.ods.org> wrote:
> ---

While the title of the patch makes sense in the rebase context, when I
merge this changes nobody will know anything about that old branch, so
they must look as any other change.

So how about this instead:
---
directconn: generic bug fixes

It wasn't actually working before.
---

>  cvr/pn_direct_conn.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/cvr/pn_direct_conn.c b/cvr/pn_direct_conn.c
> index 11e4b48..ae8f53f 100644
> --- a/cvr/pn_direct_conn.c
> +++ b/cvr/pn_direct_conn.c
> @@ -196,6 +196,9 @@ pn_direct_conn_write(struct pn_direct_conn *direct_conn,
>     {
>         /* Let's write the data. */
>         status = pn_stream_write (direct_conn->stream, data, len, &tmp, NULL);
> +
> +        if (status == G_IO_STATUS_NORMAL)
> +            pn_stream_flush (direct_conn->stream, NULL);

This is not needed unless the channel encoding is changed, which
happens on patch #3. So it would make more sense to join together
patch #2 and #3 to make it a logically atomic change.

>     }
>
>     if (status == G_IO_STATUS_NORMAL)
> @@ -302,6 +305,7 @@ read_cb(GIOChannel *source, GIOCondition condition, gpointer data)
>     {
>         pn_error ("failed to allocate memory for read");
>
> +        pn_direct_conn_destroy(direct_conn);
>         return FALSE;
>     }
>
> --

Thanks.

--
Felipe Contreras
Reply all
Reply to author
Forward
0 new messages