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

Method get_buf

lib_acl_cpp/src/session/redis_session.cpp:54–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54const session_string* redis_session::get_buf(const char* name)
55{
56 command_->clear();
57 const char* sid = get_sid();
58 if (sid == NULL || *sid == 0) {
59 return NULL;
60 }
61
62 // �ȳ��Դӻ�����л��һ�������������û�к��ʵģ��򴴽��µĻ���������
63 // ����֮������������У��Ա��´��ظ���ѯ��ͬ����ʱʹ��
64
65 session_string* ss;
66 std::map<string, session_string*>::iterator it = buffers_.find(name);
67 if (it == buffers_.end()) {
68 ss = NEW session_string;
69 buffers_[name] = ss;
70 } else {
71 ss = it->second;
72 ss->clear();
73 }
74
75 if (!command_->hget(sid, name, *ss)) {
76 return NULL;
77 }
78 return ss;
79}
80
81bool redis_session::del(const char* name)
82{

Callers

nothing calls this directly

Calls 5

hgetMethod · 0.80
get_sidFunction · 0.50
clearMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected