- Timestamp:
- 2015-05-31T02:40:04Z (9 years ago)
- Children:
- d2411a1
- Parents:
- 767b2d1
- git-author:
- dequis <dx@…> (10-04-15 11:33:58)
- git-committer:
- dequis <dx@…> (31-05-15 02:40:04)
- Location:
- protocols/msn
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r767b2d1 r074c9b6 193 193 "/user", "application/user+xml", 194 194 strlen(body), body); 195 msn_ns_write(ic, -1,"PUT %d %zd\r\n%s", ++md->trId, strlen(buf), buf);195 msn_ns_write(ic, "PUT %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 196 196 197 197 g_free(buf); … … 244 244 static void msn_keepalive(struct im_connection *ic) 245 245 { 246 msn_ns_write(ic, -1,"PNG\r\n");246 msn_ns_write(ic, "PNG\r\n"); 247 247 } 248 248 -
protocols/msn/msn.h
r767b2d1 r074c9b6 217 217 218 218 /* ns.c */ 219 int msn_ns_write(struct im_connection *ic, int fd, const char *fmt, ...) G_GNUC_PRINTF(3, 4);219 int msn_ns_write(struct im_connection *ic, const char *fmt, ...) G_GNUC_PRINTF(2, 3); 220 220 gboolean msn_ns_connect(struct im_connection *ic, const char *host, int port); 221 221 void msn_ns_close(struct msn_data *handler); -
protocols/msn/msn_util.c
r767b2d1 r074c9b6 71 71 72 72 if ((adl = adlrml_entry(who, list))) { 73 int st = msn_ns_write(ic, -1,"ADL %d %zd\r\n%s",73 int st = msn_ns_write(ic, "ADL %d %zd\r\n%s", 74 74 ++md->trId, strlen(adl), adl); 75 75 g_free(adl); … … 105 105 106 106 if ((adl = adlrml_entry(who, list))) { 107 int st = msn_ns_write(ic, -1,"RML %d %zd\r\n%s",107 int st = msn_ns_write(ic, "RML %d %zd\r\n%s", 108 108 ++md->trId, strlen(adl), adl); 109 109 g_free(adl); -
protocols/msn/ns.c
r767b2d1 r074c9b6 43 43 static void msn_ns_nfy(struct msn_data *md, char *who, char **parts, char *action, gboolean is_put); 44 44 45 int msn_ns_write(struct im_connection *ic, int fd,const char *fmt, ...)45 int msn_ns_write(struct im_connection *ic, const char *fmt, ...) 46 46 { 47 47 struct msn_data *md = ic->proto_data; … … 55 55 va_end(params); 56 56 57 if (fd < 0) {58 fd = md->fd;59 }60 61 57 if (getenv("BITLBEE_DEBUG")) { 62 fprintf(stderr, "\x1b[91m>>>[NS %d] %s\n\x1b[97m", fd, out);58 fprintf(stderr, "\x1b[91m>>>[NS] %s\n\x1b[97m", out); 63 59 } 64 60 … … 138 134 } 139 135 140 if (msn_ns_write(ic, -1,"VER %d %s CVR0\r\n", ++md->trId, MSNP_VER)) {136 if (msn_ns_write(ic, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER)) { 141 137 if (!md->is_http) { 142 138 md->inpa = b_input_add(md->fd, B_EV_IO_READ, msn_ns_callback, md); … … 218 214 } 219 215 220 return(msn_ns_write(ic, md->fd,"CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s VmVyc2lvbjogMQ0KWGZyQ291bnQ6IDINClhmclNlbnRVVENUaW1lOiA2MzU2MTQ3OTU5NzgzOTAwMDANCklzR2VvWGZyOiB0cnVlDQo=\r\n",216 return(msn_ns_write(ic, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s VmVyc2lvbjogMQ0KWGZyQ291bnQ6IDINClhmclNlbnRVVENUaW1lOiA2MzU2MTQ3OTU5NzgzOTAwMDANCklzR2VvWGZyOiB0cnVlDQo=\r\n", 221 217 ++md->trId, ic->acc->user)); 222 218 } else if (strcmp(cmd[0], "CVR") == 0) { 223 219 /* We don't give a damn about the information we just received */ 224 return msn_ns_write(ic, md->fd,"USR %d SSO I %s\r\n", ++md->trId, ic->acc->user);220 return msn_ns_write(ic, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user); 225 221 } else if (strcmp(cmd[0], "XFR") == 0) { 226 222 char *server; … … 302 298 resp = msn_p11_challenge(cmd[2]); 303 299 304 st = msn_ns_write(ic, -1,"QRY %d %s %zd\r\n%s",300 st = msn_ns_write(ic, "QRY %d %s %zd\r\n%s", 305 301 ++md->trId, MSNP11_PROD_ID, 306 302 strlen(resp), resp); … … 602 598 603 599 if (token) { 604 msn_ns_write(ic, -1,"USR %d SSO S %s %s {%s}\r\n", ++md->trId, md->tokens[0], token, md->uuid);600 msn_ns_write(ic, "USR %d SSO S %s %s {%s}\r\n", ++md->trId, md->tokens[0], token, md->uuid); 605 601 } else { 606 602 imcb_error(ic, "Error during Passport authentication: %s", error); … … 681 677 adls = xt_to_string(adl); 682 678 xt_free_node(adl); 683 msn_ns_write(ic, -1,"ADL %d %zd\r\n%s", ++md->trId, strlen(adls), adls);679 msn_ns_write(ic, "ADL %d %zd\r\n%s", ++md->trId, strlen(adls), adls); 684 680 g_free(adls); 685 681 } … … 738 734 739 735 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text); 740 retval = msn_ns_write(ic, -1,"SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf);736 retval = msn_ns_write(ic, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 741 737 g_free(buf); 742 738 return retval;
Note: See TracChangeset
for help on using the changeset viewer.