mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-27 07:59:41 +08:00
Keep the clock, timetoexit and needreload out of conf
They are the state of the process, not configuration: conf.time (now curtime), timetoexit and needreload are globals of their own. Plugins reach needreload through a pointer added at the end of struct pluginlink; LdapPlugin uses it. The extern for a paused global, never defined, goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3b2d664563
commit
a2592f4038
15 files changed
+61
-58
No files matched your search
+3
-3
@@ -15,7 +15,7 @@ int socksend(struct clientparam *param, SOCKET sock, unsigned char * buf, int bu
|
||||
fds.fd = sock;
|
||||
fds.events = POLLOUT;
|
||||
do {
|
||||
if(conf.timetoexit) return 0;
|
||||
if(timetoexit) return 0;
|
||||
/* try to send first; poll only when the socket would block */
|
||||
res = param?param->srv->so._send(param->sostate, sock, (char *)buf + sent, bufsize - sent, 0) : so._send(so.state, sock, (char *)buf + sent, bufsize - sent, 0);
|
||||
if(res > 0) {
|
||||
@@ -38,7 +38,7 @@ int socksendto(struct clientparam *param, SOCKET sock, struct sockaddr * sin, un
|
||||
|
||||
fds.fd = sock;
|
||||
do {
|
||||
if(conf.timetoexit) return 0;
|
||||
if(timetoexit) return 0;
|
||||
fds.events = POLLOUT;
|
||||
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
|
||||
if(res < 0 && (errno == EAGAIN || errno == EINTR)) continue;
|
||||
@@ -60,7 +60,7 @@ int sockrecvfrom(struct clientparam *param, SOCKET sock, struct sockaddr * sin,
|
||||
|
||||
fds.fd = sock;
|
||||
fds.events = POLLIN;
|
||||
if(conf.timetoexit) return EOF;
|
||||
if(timetoexit) return EOF;
|
||||
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
|
||||
if (res<1) return 0;
|
||||
sasize = sizeof(PROXYSOCKADDRTYPE);
|
||||
|
||||
Reference in new issue
Block a user