MCPcopy Create free account
hub / github.com/acl-dev/acl / list_tubes_fmt

Method list_tubes_fmt

lib_acl_cpp/src/beanstalk/beanstalk.cpp:728–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728bool beanstalk::list_tubes_fmt(string& buf, const char* fmt, ...)
729{
730 buf.clear(); // ��Ȼ����������Ҳ����ջ���
731
732 string cmdline(128);
733 va_list ap;
734 va_start(ap, fmt);
735 cmdline.vformat(fmt, ap);
736 va_end(ap);
737
738 ACL_ARGV* tokens = beanstalk_request(cmdline);
739 if (tokens == NULL) {
740 logger_error("'%s' error", cmdline.c_str());
741 return false;
742 }
743 if (tokens->argc < 2 || strcasecmp(tokens->argv[0], "OK")) {
744 errbuf_ = tokens->argv[0];
745 acl_argv_free(tokens);
746 close();
747 return false;
748 }
749 unsigned short n = (unsigned short) atoi(tokens->argv[1]);
750 acl_argv_free(tokens);
751
752 if (n == 0) {
753 logger_error("list data's length 0");
754 errbuf_ = "length";
755 close();
756 return false;
757 }
758
759 // ��ȡ�涨���ֽ���
760 if (!conn_.read(buf, n, true)) {
761 logger_error("peek read body failed");
762 errbuf_ = "read";
763 close();
764 return false;
765 }
766 return true;
767}
768
769bool beanstalk::list_tubes(string& buf)
770{

Callers

nothing calls this directly

Calls 6

acl_argv_freeFunction · 0.85
closeFunction · 0.50
clearMethod · 0.45
vformatMethod · 0.45
c_strMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected