/soc/2013/ashmew2/filetransferX: 465666a8ce4c: Fixed asynchronou...
Ashish Gupta
ashmew2 at gmail.com
Mon Sep 9 07:14:41 EDT 2013
Changeset: 465666a8ce4c28f1bac84f079c289aa6dbc0c001
Author: Ashish Gupta <ashmew2 at gmail.com>
Date: 2013-09-09 15:43 +0530
Branch: filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/465666a8ce4c
Description:
Fixed asynchronous accept issue
diffstat:
libpurple/protocols/jabber/google/google_session.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diffs (66 lines):
diff --git a/libpurple/protocols/jabber/google/google_session.c b/libpurple/protocols/jabber/google/google_session.c
--- a/libpurple/protocols/jabber/google/google_session.c
+++ b/libpurple/protocols/jabber/google/google_session.c
@@ -483,9 +483,9 @@ jabber_google_relay_response_session_ini
if(session_data->share) {
if(!agent) {
- if(purple_xfer_get_type(share_session->xfer) == PURPLE_XFER_RECEIVE)
+/* if(purple_xfer_get_type(share_session->xfer) == PURPLE_XFER_RECEIVE)
purple_xfer_request(share_session->xfer);
- /*if xfer is of type PURPLE_XFER_SEND, We've already requested it*/
+*/ /*if xfer is of type PURPLE_XFER_SEND, We've already requested it*/
stream_id = gtalk_xfer_init_agent(session);
agent = share_session->share_agent;
@@ -999,8 +999,12 @@ FT XML:
jabber_google_relay_response_session_initiate_cb(session, NULL, 0, 0, 0,
NULL, NULL);
}
- /*TODO: Uncomment the following?*/
- gtalk_xfer_send_transport_accept(js, session);
+ /*Ask the user to accept the file transfer*/
+ purple_xfer_request(share_session->xfer);
+
+ /*TODO: Uncomment the send_transport_accept and sent it __ONLY__ when we have accepted the file request
+ Moving to gtalk_xfer_init*/
+// gtalk_xfer_send_transport_accept(js, session);
/**//*
ResponseIq2 = jabber_iq_new(js,JABBER_IQ_SET);
@@ -1985,17 +1989,18 @@ cb_nice_recv(NiceAgent *agent, guint str
share_session->channel_state =
GTALK_XFER_CHANNEL_PARSED_HTTP_RESPONSE_HEADER;
purple_debug_info("google_session", "Calling purple_xfer_start\n");
+ share_session->channel_state = GTALK_XFER_CHANNEL_HTTP_RECEIVING;
purple_xfer_start(xfer, -1, NULL, 0);
}
/* otherwise the remaining headers would come in the next package
not sure if this will ever happen */
} else if (share_session->channel_state ==
- GTALK_XFER_CHANNEL_PARSED_HTTP_RESPONSE_HEADER) {
+ GTALK_XFER_CHANNEL_HTTP_RECEIVING) {
static int curlen = 0;
/* write data to transfer */
curlen+=len;
- purple_debug_info("google-share",
+ purple_debug_info("google-session",
"got %d bytes to write to transfer, CURLEN: %d\n", len, curlen);
if (len <= purple_xfer_get_bytes_remaining(xfer)) {
@@ -2787,10 +2792,13 @@ gtalk_xfer_init(PurpleXfer *xfer)
GoogleSession *session = (GoogleSession *)(xfer->data);
GoogleAVSessionData *session_data = (GoogleAVSessionData *)session->session_data;
GoogleXferSessionData *share_session = session_data->share_session;
- JabberStream *js = session->js;
+ JabberStream *js = session->js;
purple_debug_info("google_session", "Inside gtalk_xfer_init\n");
+ if(purple_xfer_get_type(xfer) == PURPLE_XFER_RECEIVE)
+ gtalk_xfer_send_transport_accept(js, session);
+
if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND)
gtalk_xfer_send_session_initiate(xfer);
}
More information about the Commits
mailing list