Changeset 95fdf22
- Timestamp:
- 2015-05-31T02:40:04Z (10 years ago)
- Children:
- 6a89740
- Parents:
- d2411a1
- git-author:
- dequis <dx@…> (11-04-15 20:47:15)
- git-committer:
- dequis <dx@…> (31-05-15 02:40:04)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/ns.c
rd2411a1 r95fdf22 265 265 return(0); 266 266 } 267 } else if (strcmp(cmd[0], "MSG") == 0) {268 if (num_parts < 4) {269 imcb_error(ic, "Syntax error");270 imc_logout(ic, TRUE);271 return(0);272 }273 274 md->msglen = atoi(cmd[3]);275 276 if (md->msglen <= 0) {277 imcb_error(ic, "Syntax error");278 imc_logout(ic, TRUE);279 return(0);280 }281 267 } else if (strcmp(cmd[0], "ADL") == 0) { 282 268 if (num_parts >= 3 && strcmp(cmd[2], "OK") == 0) { 283 269 msn_ns_send_adl(ic); 284 270 return msn_ns_finish_login(ic); 285 } else if (num_parts >= 3) {286 md->msglen = atoi(cmd[2]);287 271 } 288 272 } else if (strcmp(cmd[0], "CHL") == 0) { … … 309 293 imc_logout(ic, TRUE); 310 294 return(0); 311 } else if (strcmp(cmd[0], "GCF") == 0) {312 /* Coming up is cmd[2] bytes of stuff we're supposed to313 censore. Meh. */314 md->msglen = atoi(cmd[2]);315 } else if ((strcmp(cmd[0], "NFY") == 0) || (strcmp(cmd[0], "SDG") == 0)) {316 if (num_parts >= 3) {317 md->msglen = atoi(cmd[2]);318 }319 } else if (strcmp(cmd[0], "PUT") == 0) {320 if (num_parts >= 4) {321 md->msglen = atoi(cmd[3]);322 }323 } else if (strcmp(cmd[0], "NOT") == 0) {324 if (num_parts >= 2) {325 md->msglen = atoi(cmd[1]);326 }327 295 } else if (strcmp(cmd[0], "QNG") == 0) { 328 296 ic->flags |= OPT_PONGED; … … 337 305 return(0); 338 306 } 339 340 /* Oh yes, errors can have payloads too now. Discard them for now. */ 341 if (num_parts >= 3) { 342 md->msglen = atoi(cmd[2]); 343 } 307 } else if ((strcmp(cmd[0], "SDG") == 0) || (strcmp(cmd[0], "NFY") == 0)) { 308 msn_ns_structured_message(md, msg, msglen, cmd); 344 309 } else { 345 310 imcb_error(ic, "Received unknown command from main server: %s", cmd[0]); … … 354 319 char *body; 355 320 int blen = 0; 356 357 if (!num_parts) {358 return(1);359 }360 321 361 322 if ((body = strstr(msg, "\r\n\r\n"))) { … … 474 435 } 475 436 } 476 } else if ((strcmp(cmd[0], "SDG") == 0) || (strcmp(cmd[0], "NFY") == 0)) {477 msn_ns_structured_message(md, msg, msglen, cmd);478 437 } 479 438
Note: See TracChangeset
for help on using the changeset viewer.