mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-16 17:54:02 +00:00
Refine key string
This commit is contained in:
+3
-1
@@ -280,8 +280,10 @@ cache_insert(struct cache *cache, char *key, size_t key_len, void *data)
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
entry->key = ss_malloc(key_len);
|
||||
entry->key = ss_malloc(key_len + 1);
|
||||
memcpy(entry->key, key, key_len);
|
||||
entry->key[key_len] = 0;
|
||||
|
||||
entry->data = data;
|
||||
entry->ts = ev_time();
|
||||
HASH_ADD_KEYPTR(hh, cache->entries, entry->key, key_len, entry);
|
||||
|
||||
@@ -311,7 +311,6 @@ set_linger(int fd)
|
||||
so_linger.l_linger = 0;
|
||||
setsockopt(fd, SOL_SOCKET, SO_LINGER, &so_linger, sizeof so_linger);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user