Skip to content

Commit 918dd33

Browse files
author
Sebastiano Merlino
committed
changed webserver interface to remove dangerous methods
1 parent 7681d96 commit 918dd33

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

src/httpserver/webserver.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ class webserver
268268

269269
http_response* get_from_cache(const std::string& key, bool* valid, bool lock = false, bool write = false);
270270
http_response* get_from_cache(const std::string& key, bool* valid, cache_entry** ce, bool lock = false, bool write = false);
271-
void lock_cache_element(const std::string& key, bool write = false);
272271
void lock_cache_element(cache_entry* ce, bool write = false);
273-
void unlock_cache_element(const std::string& key);
274272
void unlock_cache_element(cache_entry* ce);
275273
cache_entry* put_in_cache(const std::string& key, http_response* value, bool* new_elem, bool lock = false, bool write = false, int validity = -1);
276274
void remove_from_cache(const std::string& key);

src/webserver.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,34 +1791,12 @@ bool webserver::is_valid(const std::string& key)
17911791
return false;
17921792
}
17931793

1794-
void webserver::lock_cache_element(const std::string& key, bool write)
1795-
{
1796-
pthread_rwlock_rdlock(&cache_guard);
1797-
map<string, cache_entry*>::iterator it(response_cache.find(key));
1798-
if(it != response_cache.end())
1799-
{
1800-
pthread_rwlock_unlock(&cache_guard);
1801-
(*it).second->lock(write);
1802-
}
1803-
else
1804-
pthread_rwlock_unlock(&cache_guard);
1805-
}
1806-
18071794
void webserver::lock_cache_element(cache_entry* ce, bool write)
18081795
{
18091796
if(ce)
18101797
ce->lock(write);
18111798
}
18121799

1813-
void webserver::unlock_cache_element(const std::string& key)
1814-
{
1815-
pthread_rwlock_rdlock(&cache_guard);
1816-
map<string, cache_entry*>::iterator it(response_cache.find(key));
1817-
if(it != response_cache.end())
1818-
(*it).second->unlock();
1819-
pthread_rwlock_unlock(&cache_guard);
1820-
}
1821-
18221800
void webserver::unlock_cache_element(cache_entry* ce)
18231801
{
18241802
if(ce)

0 commit comments

Comments
 (0)