Skip to content
Snippets Groups Projects
Commit 4b2723d7 authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files

[+] Some updates for cache

parent b6321d8a
No related branches found
No related tags found
No related merge requests found
Pipeline #7211 passed with stage
in 13 seconds
...@@ -36,8 +36,18 @@ dap_http_cache_t * dap_http_cache_update(struct dap_http_url_proc * a_url_proc, ...@@ -36,8 +36,18 @@ dap_http_cache_t * dap_http_cache_update(struct dap_http_url_proc * a_url_proc,
l_ret->body_size = a_body_size; l_ret->body_size = a_body_size;
} }
l_ret->headers = dap_http_headers_dup( a_headers); l_ret->headers = dap_http_headers_dup( a_headers);
l_ret->ts_expire = a_ts_expire; l_ret->ts_expire = a_ts_expire;
l_ret->url_proc = a_url_proc; l_ret->url_proc = a_url_proc;
//Here we cut off 'Date' header because we add it new on each cached request
dap_http_header_t * l_hdr_date= dap_http_header_find(l_ret->headers,"Date");
if(l_hdr_date)
dap_http_header_remove(&l_ret->headers,l_hdr_date);
// Reset current cache for url_proc and replace with our own
pthread_rwlock_wrlock(&a_url_proc->cache_rwlock); pthread_rwlock_wrlock(&a_url_proc->cache_rwlock);
dap_http_cache_delete(a_url_proc->cache); dap_http_cache_delete(a_url_proc->cache);
a_url_proc->cache = l_ret; a_url_proc->cache = l_ret;
......
...@@ -25,9 +25,12 @@ ...@@ -25,9 +25,12 @@
#pragma once #pragma once
#include "dap_http.h" #include "dap_http.h"
#include "dap_enc_http.h" #include "dap_enc_http.h"
#include "dap_config.h"
#define DAP_CHAIN_NET_SRV_VPN_CDB_GDB_PREFIX "srv.vpn" #define DAP_CHAIN_NET_SRV_VPN_CDB_GDB_PREFIX "srv.vpn"
extern dap_config_t * g_dap_config_cdb;
int dap_chain_net_srv_vpn_cdb_init(dap_http_t * a_http); int dap_chain_net_srv_vpn_cdb_init(dap_http_t * a_http);
void dap_chain_net_srv_vpn_cdb_deinit(); void dap_chain_net_srv_vpn_cdb_deinit();
void dap_chain_net_srv_vpn_cdb_auth_after(enc_http_delegate_t* a_delegate, const char * a_login, const char * a_pkey_b64 ); void dap_chain_net_srv_vpn_cdb_auth_after(enc_http_delegate_t* a_delegate, const char * a_login, const char * a_pkey_b64 );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment