mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Replace memcpy with assignment where appropriate
This commit is contained in:
1 parent
3cc9796583
commit
13a7d6be11
8 files changed
+45
-41
No files matched your search
+6
-6
@@ -133,7 +133,7 @@ void * sockschild(struct clientparam* param) {
|
||||
}
|
||||
buf[i] = 0;
|
||||
if(!getip46(param->srv->family, buf, (struct sockaddr *) ¶m->req)) RETURN(100);
|
||||
memcpy(¶m->sinsr, ¶m->req, sizeof(param->req));
|
||||
param->sinsr = param->req;
|
||||
break;
|
||||
default:
|
||||
RETURN(997);
|
||||
@@ -159,7 +159,7 @@ void * sockschild(struct clientparam* param) {
|
||||
if(param->hostname)myfree(param->hostname);
|
||||
param->hostname = (unsigned char *)mystrdup((char *)buf);
|
||||
if(!getip46(param->srv->family, buf, (struct sockaddr *) ¶m->req)) RETURN(100);
|
||||
memcpy(¶m->sinsr, ¶m->req, sizeof(¶m->req));
|
||||
param->sinsr = param->req;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,9 +173,9 @@ void * sockschild(struct clientparam* param) {
|
||||
case 3:
|
||||
|
||||
#ifndef NOIPV6
|
||||
memcpy(¶m->sinsl, *SAFAMILY(¶m->req)==AF_INET6? (struct sockaddr *)¶m->srv->extsa6:(struct sockaddr *)¶m->srv->extsa, SASIZE(¶m->req));
|
||||
param->sinsl = *SAFAMILY(¶m->req)==AF_INET6? param->srv->extsa6 : param->srv->extsa;
|
||||
#else
|
||||
memcpy(¶m->sinsl, ¶m->srv->extsa, SASIZE(¶m->req));
|
||||
param->sinsl = param->srv->extsa;
|
||||
#endif
|
||||
if ((param->remsock=so._socket(SASOCK(¶m->req), command == 2? SOCK_STREAM:SOCK_DGRAM, command == 2?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) {RETURN (11);}
|
||||
param->operation = command == 2?BIND:UDPASSOC;
|
||||
@@ -218,7 +218,7 @@ fflush(stderr);
|
||||
param->ctrlsock = param->clisock;
|
||||
param->clisock = so._socket(SASOCK(¶m->sincr), SOCK_DGRAM, IPPROTO_UDP);
|
||||
if(param->clisock == INVALID_SOCKET) {RETURN(11);}
|
||||
memcpy(&sin, ¶m->sincl, sizeof(&sin));
|
||||
sin = param->sincl;
|
||||
*SAPORT(&sin) = 0;
|
||||
if(so._bind(param->clisock,(struct sockaddr *)&sin,SASIZE(&sin))) {RETURN (12);}
|
||||
#if SOCKSTRACE > 0
|
||||
@@ -328,7 +328,7 @@ fflush(stderr);
|
||||
param->res = sockmap(param, conf.timeouts[CONNECTION_S]);
|
||||
break;
|
||||
case 3:
|
||||
memcpy(¶m->sinsr, ¶m->req, sizeof(param->sinsr));
|
||||
param->sinsr = param->req;
|
||||
myfree(buf);
|
||||
if(!(buf = myalloc(LARGEBUFSIZE))) {RETURN(21);}
|
||||
|
||||
|
||||
Reference in new issue
Block a user