# HG changeset patch # User Luke Schierer # Date 1041611009 0 # Node ID 9615c699634867a6de9be75410eae114e82fb0b4 # Parent e52b0571ca95c16a0806e796a28643a0222e1c7b [gaim-migrate @ 4417] Felipe Contreras (revo) writes: " This fixes two problems with msn ft. 1. Application-Name is not always the same we should check for Application-GUID. 2. GET_NEXT was changed recently, I added GET_NEXT_LINE wich does a better job for multiple lines to fix it. Now it works for me ;)" committer: Tailor Script diff -r e52b0571ca95 -r 9615c6996348 src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Fri Jan 03 14:55:11 2003 +0000 +++ b/src/protocols/msn/msn.c Fri Jan 03 16:23:29 2003 +0000 @@ -148,6 +148,7 @@ while (*(tmp) && *(tmp) == ' ') \ (tmp)++; +#define GET_NEXT_LINE(tmp,s) strsep (&tmp, " "); s = strsep (&tmp, "\r"); static char *msn_normalize(const char *s) { @@ -762,7 +763,7 @@ struct msn_data *md = ms->gc->proto_data; char *tmp = msg; - if (strstr(msg, "Application-Name: File Transfer") && + if (strstr(msg, "Application-GUID: {5D3E02AB-6190-11d3-BBBB-00C04F795683}") && strstr(msg, "Invitation-Command: INVITE")) { /* @@ -774,21 +775,10 @@ char *cookie_s, *filesize_s; size_t filesize; - tmp = strstr(msg, "Invitation-Cookie"); - GET_NEXT(tmp); - cookie_s = tmp; - GET_NEXT(tmp); - GET_NEXT(tmp); - filename = tmp; - - /* Needed for filenames with spaces */ - tmp = strchr(tmp, '\r'); - *tmp = '\0'; - tmp += 2; - - GET_NEXT(tmp); - filesize_s = tmp; - GET_NEXT(tmp); + tmp = strstr(msg, "Invitation-Cookie:"); + GET_NEXT_LINE(tmp, cookie_s); + GET_NEXT_LINE(tmp, filename); + GET_NEXT_LINE(tmp, filesize_s); mft = g_new0(struct msn_file_transfer, 1); mft->gc = ms->gc; @@ -821,19 +811,12 @@ char *cookie_s, *ip, *port_s, *authcookie_s; - tmp = strstr(msg, "Invitation-Cookie"); - GET_NEXT(tmp); - cookie_s = tmp; - GET_NEXT(tmp); - GET_NEXT(tmp); - ip = tmp; - GET_NEXT(tmp); - GET_NEXT(tmp); - port_s = tmp; - GET_NEXT(tmp); - GET_NEXT(tmp); - authcookie_s = tmp; - GET_NEXT(tmp); + tmp = strstr(msg, "Invitation-Cookie:"); + GET_NEXT_LINE(tmp, cookie_s); + GET_NEXT_LINE(tmp, ip); + GET_NEXT_LINE(tmp, port_s); + GET_NEXT_LINE(tmp, authcookie_s); + GET_NEXT_LINE(tmp, authcookie_s); mft = find_mft_by_cookie(ms->gc, atoi(cookie_s));