| 52 | } |
| 53 | |
| 54 | const 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 | |
| 81 | bool redis_session::del(const char* name) |
| 82 | { |