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

Method del

lib_acl_cpp/src/session/session.cpp:267–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267bool session::del(const char* name)
268{
269 // ֱ�Ӳ������ cache ��������ɾ�������ֶ�
270
271 if (!get_attrs(attrs_)) {
272 return true;
273 }
274
275 std::map<string, session_string>::iterator it = attrs_.find(name);
276 if (it == attrs_.end()) {
277 return false;
278 }
279
280 // ��ɾ�����ͷŶ�Ӧ�Ķ���
281 attrs_.erase(it);
282
283 // ��� sid ���Ѿ�û�������ݣ���Ӧ�ý� sid ����� memcached ��ɾ��
284 if (attrs_.empty()) {
285 // �����麯����ɾ���� sid ��Ӧ�Ļ�������
286 if (!this->remove()) {
287 logger_error("del sid(%s) error", sid_.c_str());
288 return false;
289 }
290 return true;
291 }
292
293 // ��������ʣ�������
294
295 if (!set_attrs(attrs_)) {
296 logger_error("set cache error, sid(%s)", sid_.c_str());
297 attrs_clear(attrs_); // ������Լ�������
298
299 return false;
300 }
301
302 attrs_clear(attrs_); // ������Լ�������
303 return true;
304}
305
306// ���� handlersocket �ı��뷽ʽ
307

Callers 4

acl_mdb_delFunction · 0.45
acl_mdt_deleteFunction · 0.45
test_url_coderFunction · 0.45
removeMethod · 0.45

Calls 5

findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
removeMethod · 0.45
c_strMethod · 0.45

Tested by 1

test_url_coderFunction · 0.36