Signed-off-by: Octavio Alvarez <alva...@alvarezp.ods.org>
---
cvr/pn_direct_conn.c | 8 ++++----
cvr/pn_direct_conn.h | 8 +++++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/cvr/pn_direct_conn.c b/cvr/pn_direct_conn.c
index cb83d19..a950195 100644
--- a/cvr/pn_direct_conn.c
+++ b/cvr/pn_direct_conn.c
@@ -41,7 +41,7 @@ static void
foo_cb(struct pn_direct_conn *direct_conn,
void *data)
{
- direct_conn->status = 1;
+ direct_conn->status = PN_DIRECT_CONN_STATUS_CONNECTING;
pn_direct_conn_send_handshake(direct_conn);
}
@@ -149,7 +149,7 @@ pn_direct_conn_send_msg(struct pn_direct_conn *direct_conn, MsnMessage *msg)
body = msn_message_gen_slp_body(msg, &body_len);
- if (direct_conn->status == 1) {
+ if (direct_conn->status == PN_DIRECT_CONN_STATUS_CONNECTING) {
async_write(direct_conn, NULL, NULL, body, body_len, NULL, NULL);
goto leave;
}
@@ -185,8 +185,8 @@ pn_direct_conn_process_chunk(struct pn_direct_conn *direct_conn,
msg = msn_message_new_msnslp();
msn_message_parse_slp_body(msg, buf, bytes_read);
- if (direct_conn->status == 1) {
- direct_conn->status = 2;
+ if (direct_conn->status == PN_DIRECT_CONN_STATUS_CONNECTING) {
+ direct_conn->status = PN_DIRECT_CONN_STATUS_OPEN;
got_nonce(direct_conn, msg);
return;
}
diff --git a/cvr/pn_direct_conn.h b/cvr/pn_direct_conn.h
index cff69ec..d70da70 100644
--- a/cvr/pn_direct_conn.h
+++ b/cvr/pn_direct_conn.h
@@ -30,6 +30,12 @@ struct pn_direct_conn;
typedef void (*pn_io_cb_t) (struct pn_direct_conn *direct_conn, void *data);
+enum pn_direct_conn_status {
+ PN_DIRECT_CONN_STATUS_UNKNOWN = 0,
+ PN_DIRECT_CONN_STATUS_CONNECTING,
+ PN_DIRECT_CONN_STATUS_OPEN
+};
+
struct pn_direct_conn {
struct pn_peer_link *link;
struct pn_peer_call *initial_call;
@@ -52,7 +58,7 @@ struct pn_direct_conn {
void *io_cb_data;
MsnMessage *last_msg;
- int status;
+ enum pn_direct_conn_status status;
GQueue *addrs;
};
--
1.6.3.3
Thanks, I should have done this but was too lazy :P
> --- a/cvr/pn_direct_conn.h
> +++ b/cvr/pn_direct_conn.h
> @@ -30,6 +30,12 @@ struct pn_direct_conn;
>
> typedef void (*pn_io_cb_t) (struct pn_direct_conn *direct_conn, void *data);
>
> +enum pn_direct_conn_status {
> + PN_DIRECT_CONN_STATUS_UNKNOWN = 0,
No need to specify the first one as 0.
> + PN_DIRECT_CONN_STATUS_CONNECTING,
> + PN_DIRECT_CONN_STATUS_OPEN
> +};
I'll apply the patch with the aforementioned change.
Cheers.
--
Felipe Contreras
Why did you send this again?
--
Felipe Contreras
Yeah, if you are not subscribed your messages go into moderation.
--
Felipe Contreras
Because I sent it on Wednesday to the ML with Cc
to myself. I got it immediately. However, in the
ML it didn't.
I noticed other messages (like yours) were delivered
by the ML quick enough.
I assumed a problem with the ML or my subscription to
it. (And now I wonder why it took 2 days to appear.)
Given the above, I resent it, but this time with Cc
to you.
Thanks.
> On Fri, Feb 12, 2010 at 7:34 PM, Octavio Alvarez
> <alva...@alvarezp.ods.org> wrote:
>> On Fri, 12 Feb 2010 01:09:15 -0800, Felipe Contreras
>> <felipe.c...@gmail.com> wrote:
>>> Why did you send this again?
>>
>> Because I sent it on Wednesday to the ML with Cc
>> to myself. I got it immediately. However, in the
>> ML it didn't.
>>
>> I noticed other messages (like yours) were delivered
>> by the ML quick enough.
>
> Yeah, if you are not subscribed your messages go into moderation.
>
I am subscribed. I just got this message through the ML,
addressed to the same account I used for sending.