mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Pre-allocate client/server/tmp/etc buffers with client structure
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run
This commit is contained in:
1 parent
b9297dc4cf
commit
a20f646169
36 files changed
+431
-492
No files matched your search
+9
-9
@@ -31,13 +31,13 @@ void param2hash_search(const struct hashtable *ht, void *index, uint8_t *hash){
|
||||
int oplen = 0, acllen = 0, ulen = 0, plen = 0, hlen = 0, a1len = 0, a2len = 0, a3len = 0, p1len=0, p2len = 0;
|
||||
|
||||
|
||||
if((type & 2) && param->username) ulen = strlen((const char *)param->username) + 1;
|
||||
if((type & 4) && param->password) plen = strlen((const char *)param->password) + 1;
|
||||
if((type & 2) && *param->username) ulen = strlen((const char *)param->username) + 1;
|
||||
if((type & 4) && *param->password) plen = strlen((const char *)param->password) + 1;
|
||||
if((type & 1) && !(type & 8)) a1len = SAADDRLEN(¶m->sincr);
|
||||
if((type & 16)) acllen = sizeof(param->srv->acl);
|
||||
if((type & 64)) a2len = SAADDRLEN(¶m->req);
|
||||
if((type & 128)) p1len = 2 ;
|
||||
if((type & 256) && param->hostname) hlen = strlen((const char *)param->hostname) + 1;
|
||||
if((type & 256) && *param->hostname) hlen = strlen((const char *)param->hostname) + 1;
|
||||
if((type & 512)) oplen = sizeof(param->operation);
|
||||
if((type & 1024)) a3len = SAADDRLEN(¶m->srv->intsa);
|
||||
if((type & 2048)) p2len = 2;
|
||||
@@ -45,13 +45,13 @@ void param2hash_search(const struct hashtable *ht, void *index, uint8_t *hash){
|
||||
memset(hash, 0, ht->hash_size);
|
||||
if(ulen + plen + a1len + acllen + a2len + p1len + hlen + oplen + a3len + p2len <= ht->hash_size){
|
||||
int offset = 0;
|
||||
if((type & 2) && param->username){ memcpy(hash + offset, param->username, ulen); offset += ulen; }
|
||||
if((type & 4) && param->password){ memcpy(hash + offset, param->password, plen); offset += plen; }
|
||||
if((type & 2) && *param->username){ memcpy(hash + offset, param->username, ulen); offset += ulen; }
|
||||
if((type & 4) && *param->password){ memcpy(hash + offset, param->password, plen); offset += plen; }
|
||||
if((type & 1) && !(type & 8)){ memcpy(hash + offset, SAADDR(¶m->sincr), a1len); offset += a1len; }
|
||||
if((type & 16)){ memcpy(hash + offset, ¶m->srv->acl, acllen); offset += acllen; }
|
||||
if((type & 64)){ memcpy(hash + offset, SAADDR(¶m->req), a2len); offset += a2len; }
|
||||
if((type & 128)){ memcpy(hash + offset, SAPORT(¶m->req), p1len); offset += 2; }
|
||||
if((type & 256) && param->hostname){ memcpy(hash + offset, param->hostname, hlen); offset += hlen; }
|
||||
if((type & 256) && *param->hostname){ memcpy(hash + offset, param->hostname, hlen); offset += hlen; }
|
||||
if((type & 512)){ memcpy(hash + offset, ¶m->operation, oplen); offset += oplen; }
|
||||
if((type & 1024)){ memcpy(hash + offset, SAADDR(¶m->srv->intsa), a3len); offset += a3len; }
|
||||
if((type & 2048)){ memcpy(hash + offset, SAPORT(¶m->srv->intsa), p2len); offset += 2; }
|
||||
@@ -60,13 +60,13 @@ void param2hash_search(const struct hashtable *ht, void *index, uint8_t *hash){
|
||||
mdh_ctx *bctx = mdh_init(MDH_BLAKE2, ht->hash_size);
|
||||
unsigned int blen = ht->hash_size;
|
||||
if(!bctx) { memcpy(param->hash, hash, ht->hash_size); return; }
|
||||
if((type & 2) && param->username)mdh_update(bctx, param->username, ulen);
|
||||
if((type & 4) && param->password)mdh_update(bctx, param->password, plen);
|
||||
if((type & 2) && *param->username)mdh_update(bctx, param->username, ulen);
|
||||
if((type & 4) && *param->password)mdh_update(bctx, param->password, plen);
|
||||
if((type & 1) && !(type & 8))mdh_update(bctx, SAADDR(¶m->sincr), a1len);
|
||||
if((type & 16))mdh_update(bctx, ¶m->srv->acl, acllen);
|
||||
if((type & 64))mdh_update(bctx, SAADDR(¶m->req), a2len);
|
||||
if((type & 128))mdh_update(bctx, SAPORT(¶m->req), 2);
|
||||
if((type & 256) && param->hostname)mdh_update(bctx, param->hostname, hlen);
|
||||
if((type & 256) && *param->hostname)mdh_update(bctx, param->hostname, hlen);
|
||||
if((type & 512))mdh_update(bctx, ¶m->operation, sizeof(param->operation));
|
||||
if((type & 1024))mdh_update(bctx, SAADDR(¶m->srv->intsa), a3len);
|
||||
if((type & 2048))mdh_update(bctx, SAPORT(¶m->srv->intsa), 2);
|
||||
|
||||
Reference in new issue
Block a user