end:
- shctx_wrlock(shctx);
fb = shctx_row_reserve_hot(shctx, st->first_block, trash.data);
if (!fb) {
- shctx_wrunlock(shctx);
goto no_cache;
}
- shctx_wrunlock(shctx);
ret = shctx_row_data_append(shctx, st->first_block,
(unsigned char *)b_head(&trash), b_data(&trash));
}
cache_wrunlock(cache);
- shctx_wrlock(shctx);
first = shctx_row_reserve_hot(shctx, NULL, sizeof(struct cache_entry));
- shctx_wrunlock(shctx);
if (!first) {
goto out;
}
if (set_secondary_key_encoding(htx, object->secondary_key))
goto out;
- shctx_wrlock(shctx);
if (!shctx_row_reserve_hot(shctx, first, trash.data)) {
- shctx_wrunlock(shctx);
goto out;
}
- shctx_wrunlock(shctx);
/* cache the headers in a http action because it allows to chose what
* to cache, for example you might want to cache a response before
BUG_ON(data_len < 0);
- /* not enough usable blocks */
- if (data_len > shctx->nbav * shctx->block_size)
- goto out;
-
/* Check the object size limit. */
if (shctx->max_obj_size > 0) {
if ((first && first->len + data_len > shctx->max_obj_size) ||
}
}
+ shctx_wrlock(shctx);
+
+ /* not enough usable blocks */
+ if (data_len > shctx->nbav * shctx->block_size) {
+ shctx_wrunlock(shctx);
+ goto out;
+ }
+
+
if (data_len <= 0 || LIST_ISEMPTY(&shctx->avail)) {
- return NULL;
+ ret = NULL;
+ shctx_wrunlock(shctx);
+ goto out;
}
list_for_each_entry_safe(block, sblock, &shctx->avail, list) {
}
}
+ shctx_wrunlock(shctx);
+
out:
return ret;
}
return 0;
}
+ shctx_wrlock(ssl_shctx);
+
/* STORE the key in the first elem */
sh_ssl_sess = (struct sh_ssl_sess_hdr *)first->data;
memcpy(sh_ssl_sess->key_data, s_id, SSL_MAX_SSL_SESSION_ID_LENGTH);
shctx_row_reattach(ssl_shctx, first);
+ shctx_wrunlock(ssl_shctx);
+
return 1;
}
i2d_SSL_SESSION(sess, &p);
- shctx_wrlock(ssl_shctx);
/* store to cache */
sh_ssl_sess_store(encid, encsess, data_len);
- shctx_wrunlock(ssl_shctx);
err:
/* reset original length values */
SSL_SESSION_set1_id(sess, encid, sid_length);