uwsgi_cache_del now takes flags

This commit is contained in:
Roberto De Ioris
2012-11-25 17:29:41 +01:00
parent a3bbfde884
commit 6e5fc85e54
7 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -193,7 +193,7 @@ char *uwsgi_cache_get(char *key, uint16_t keylen, uint64_t * valsize) {
return NULL;
}
int uwsgi_cache_del(char *key, uint16_t keylen, uint64_t index) {
int uwsgi_cache_del(char *key, uint16_t keylen, uint64_t index, uint16_t flags) {
struct uwsgi_cache_item *uci;
int ret = -1;
@@ -641,7 +641,7 @@ void *cache_sweeper_loop(void *noarg) {
uwsgi_wlock(uwsgi.cache_lock);
if (uwsgi.cache_items[i].expires) {
if (uwsgi.cache_items[i].expires < (uint64_t) uwsgi.current_time) {
uwsgi_cache_del(NULL, 0, i);
uwsgi_cache_del(NULL, 0, i, 0);
freed_items++;
}
}
+1 -1
View File
@@ -4339,7 +4339,7 @@ SSL_SESSION *uwsgi_ssl_session_get_cb(SSL *ssl, unsigned char *key, int keylen,
void uwsgi_ssl_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess) {
uwsgi_wlock(uwsgi.cache_lock);
if (uwsgi_cache_del((char *) sess->session_id, sess->session_id_length, 0)) {
if (uwsgi_cache_del((char *) sess->session_id, sess->session_id_length, 0, 0)) {
if (uwsgi.ssl_verbose) {
uwsgi_log("[uwsgi-ssl] error removing cache item\n");
}
+1 -1
View File
@@ -63,7 +63,7 @@ int uwsgi_cache_request(struct wsgi_request *wsgi_req) {
case 2:
// del
if (wsgi_req->uh.pktsize > 0) {
uwsgi_cache_del(wsgi_req->buffer, wsgi_req->uh.pktsize, 0);
uwsgi_cache_del(wsgi_req->buffer, wsgi_req->uh.pktsize, 0, 0);
}
break;
case 3:
+1 -1
View File
@@ -381,7 +381,7 @@ PHP_FUNCTION(uwsgi_cache_del) {
}
uwsgi_wlock(uwsgi.cache_lock);
if (uwsgi_cache_del(key, keylen, 0)) {
if (uwsgi_cache_del(key, keylen, 0, 0)) {
uwsgi_rwunlock(uwsgi.cache_lock);
RETURN_TRUE;
}
+2 -2
View File
@@ -3277,7 +3277,7 @@ PyObject *py_uwsgi_cache_clear(PyObject * self, PyObject * args) {
for (i = 1; i < uwsgi.cache_max_items; i++) {
UWSGI_RELEASE_GIL
uwsgi_wlock(uwsgi.cache_lock);
uwsgi_cache_del(NULL, 0, i);
uwsgi_cache_del(NULL, 0, i, 0);
uwsgi_rwunlock(uwsgi.cache_lock);
UWSGI_GET_GIL
}
@@ -3305,7 +3305,7 @@ PyObject *py_uwsgi_cache_del(PyObject * self, PyObject * args) {
else if (uwsgi.cache_max_items) {
UWSGI_RELEASE_GIL
uwsgi_wlock(uwsgi.cache_lock);
if (uwsgi_cache_del(key, keylen, 0)) {
if (uwsgi_cache_del(key, keylen, 0, 0)) {
uwsgi_rwunlock(uwsgi.cache_lock);
UWSGI_GET_GIL
Py_INCREF(Py_None);
+1 -1
View File
@@ -348,7 +348,7 @@ VALUE rack_uwsgi_cache_del(VALUE *class, VALUE rbkey) {
size_t keylen = RSTRING_LEN(rbkey);
uwsgi_wlock(uwsgi.cache_lock);
if (uwsgi_cache_del(key, keylen, 0)) {
if (uwsgi_cache_del(key, keylen, 0, 0)) {
uwsgi_rwunlock(uwsgi.cache_lock);
return Qfalse;
}
+1 -1
View File
@@ -2419,7 +2419,7 @@ ssize_t uwsgi_send_message(int, uint8_t, uint8_t, char *, uint16_t, int, ssize_t
char *uwsgi_cluster_best_node(void);
int uwsgi_cache_set(char *, uint16_t, char *, uint64_t, uint64_t, uint16_t);
int uwsgi_cache_del(char *, uint16_t, uint64_t);
int uwsgi_cache_del(char *, uint16_t, uint64_t, uint16_t);
char *uwsgi_cache_get(char *, uint16_t, uint64_t *);
uint32_t uwsgi_cache_exists(char *, uint16_t);