{
struct pendconn *p = NULL;
struct server *rsrv;
- int remote;
rsrv = srv->track;
if (!rsrv)
px->lbprm.server_take_conn(srv);
__stream_add_srv_conn(p->strm, srv);
- remote = !(p->strm->task->thread_mask & tid_bit);
task_wakeup(p->strm->task, TASK_WOKEN_RES);
- /* Returns 1 if the current thread can process the stream, otherwise returns 2. */
- return remote ? 2 : 1;
+ return 1;
}
/* Manages a server's connection queue. This function will try to dequeue as
void process_srv_queue(struct server *s)
{
struct proxy *p = s->proxy;
- int maxconn, remote = 0;
+ int maxconn;
HA_SPIN_LOCK(PROXY_LOCK, &p->lock);
HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
int ret = pendconn_process_next_strm(s, p);
if (!ret)
break;
- remote |= (ret == 2);
}
HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
HA_SPIN_UNLOCK(PROXY_LOCK, &p->lock);
-
- if (remote)
- THREAD_WANT_SYNC();
}
/* Adds the stream <strm> to the pending connection list of server <strm>->srv
{
struct pendconn *p, *pback;
int xferred = 0;
- int remote = 0;
/* The REDISP option was specified. We will ignore cookie and force to
* balance or use the dispatcher. */
__pendconn_unlink(p);
p->strm_flags &= ~(SF_DIRECT | SF_ASSIGNED | SF_ADDR_SET);
- remote |= !(p->strm->task->thread_mask & tid_bit);
task_wakeup(p->strm->task, TASK_WOKEN_RES);
}
HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
-
- if (remote)
- THREAD_WANT_SYNC();
return xferred;
}
{
struct pendconn *p, *pback;
int maxconn, xferred = 0;
- int remote = 0;
if (!srv_currently_usable(s))
return 0;
__pendconn_unlink(p);
p->target = s;
- remote |= !(p->strm->task->thread_mask & tid_bit);
task_wakeup(p->strm->task, TASK_WOKEN_RES);
xferred++;
}
HA_SPIN_UNLOCK(PROXY_LOCK, &s->proxy->lock);
-
- if (remote)
- THREAD_WANT_SYNC();
return xferred;
}