mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-27 07: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
@@ -155,7 +155,7 @@ int dobuf2(struct clientparam * param, unsigned char * buf, const unsigned char
|
||||
i+=5;
|
||||
break;
|
||||
case 'U':
|
||||
if(param->username && *param->username){
|
||||
if(*param->username){
|
||||
for(len = 0; i< 4000 && param->username[len]; len++){
|
||||
buf[i] = param->username[len];
|
||||
if(param->srv->nonprintable && (buf[i] < 0x20 || strchr((char *)param->srv->nonprintable, buf[i]))) buf[i] = param->srv->replace;
|
||||
@@ -171,7 +171,7 @@ int dobuf2(struct clientparam * param, unsigned char * buf, const unsigned char
|
||||
}
|
||||
break;
|
||||
case 'n':
|
||||
len = param->hostname? (int)strlen((char *)param->hostname) : 0;
|
||||
len = (int)strlen((char *)param->hostname);
|
||||
if (len > 0 && !strchr((char *)param->hostname, ':')) for(len = 0; param->hostname[len] && i < 4000; len++, i++){
|
||||
buf[i] = param->hostname[len];
|
||||
if(param->srv->nonprintable && (buf[i] < 0x20 || strchr((char *)param->srv->nonprintable, buf[i]))) buf[i] = param->srv->replace;
|
||||
@@ -338,10 +338,12 @@ void lognone(struct clientparam * param, const unsigned char *s) {
|
||||
clearstat(param);
|
||||
}
|
||||
|
||||
NOINLINE void logstdout(struct clientparam * param, const unsigned char *s) {
|
||||
void logstdout(struct clientparam * param, const unsigned char *s) {
|
||||
FILE *log;
|
||||
unsigned char tmpbuf[8192];
|
||||
unsigned char *tmpbuf;
|
||||
|
||||
/* with no connection, an error from the main thread */
|
||||
tmpbuf = param? param->tmpbuf : logparam.tmpbuf;
|
||||
dobuf(param, tmpbuf, s, NULL);
|
||||
log = (param && param->srv && param->srv->stdlog)?param->srv->stdlog:conf.stdlog?conf.stdlog:stdout;
|
||||
if(!param || !param->nolog)if(fprintf(log, "%s\n", tmpbuf) < 0) {
|
||||
@@ -351,10 +353,8 @@ NOINLINE void logstdout(struct clientparam * param, const unsigned char *s) {
|
||||
}
|
||||
#ifndef _WIN32
|
||||
void logsyslog(struct clientparam * param, const unsigned char *s) {
|
||||
|
||||
unsigned char tmpbuf[8192];
|
||||
dobuf(param, tmpbuf, s, NULL);
|
||||
if(!param->nolog)syslog(LOG_INFO, "%s", tmpbuf);
|
||||
dobuf(param, param->tmpbuf, s, NULL);
|
||||
if(!param->nolog)syslog(LOG_INFO, "%s", param->tmpbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user