| 566 | } |
| 567 | |
| 568 | sds catAppendOnlyGenericCommand(sds dst, int argc, robj **argv) { |
| 569 | char buf[32]; |
| 570 | int len, j; |
| 571 | robj *o; |
| 572 | |
| 573 | buf[0] = '*'; |
| 574 | len = 1+ll2string(buf+1,sizeof(buf)-1,argc); |
| 575 | buf[len++] = '\r'; |
| 576 | buf[len++] = '\n'; |
| 577 | dst = sdscatlen(dst,buf,len); |
| 578 | |
| 579 | for (j = 0; j < argc; j++) { |
| 580 | if (sdsEncodedObject(argv[j])) |
| 581 | o = argv[j]; |
| 582 | else |
| 583 | o = getDecodedObject(argv[j]); |
| 584 | buf[0] = '$'; |
| 585 | len = 1+ll2string(buf+1,sizeof(buf)-1,sdslen(szFromObj(o))); |
| 586 | buf[len++] = '\r'; |
| 587 | buf[len++] = '\n'; |
| 588 | dst = sdscatlen(dst,buf,len); |
| 589 | dst = sdscatlen(dst,ptrFromObj(o),sdslen(szFromObj(o))); |
| 590 | dst = sdscatlen(dst,"\r\n",2); |
| 591 | if (o != argv[j]) |
| 592 | decrRefCount(o); |
| 593 | } |
| 594 | return dst; |
| 595 | } |
| 596 | |
| 597 | /* Create the sds representation of a PEXPIREAT command, using |
| 598 | * 'seconds' as time to live and 'cmd' to understand what command |
no test coverage detected