mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
[MINOR] stream_sock_data_finish() should not expose fd
stream_sock_data_finish was still using a file descriptor as only argument, while a stream interface is preferred. This is now fixed.
This commit is contained in:
parent
42ffbf248b
commit
b025325274
@ -33,7 +33,7 @@
|
||||
/* main event functions used to move data between sockets and buffers */
|
||||
int stream_sock_read(int fd);
|
||||
int stream_sock_write(int fd);
|
||||
int stream_sock_data_finish(int fd);
|
||||
void stream_sock_data_finish(struct stream_interface *si);
|
||||
void stream_sock_shutr(struct stream_interface *si);
|
||||
void stream_sock_shutw(struct stream_interface *si);
|
||||
|
||||
|
||||
@ -882,10 +882,10 @@ resync_stream_interface:
|
||||
session_process_counters(s);
|
||||
|
||||
if (s->rep->cons->state == SI_ST_EST)
|
||||
stream_sock_data_finish(s->rep->cons->fd);
|
||||
stream_sock_data_finish(s->rep->cons);
|
||||
|
||||
if (s->req->cons->state == SI_ST_EST)
|
||||
stream_sock_data_finish(s->req->cons->fd);
|
||||
stream_sock_data_finish(s->req->cons);
|
||||
|
||||
s->req->flags &= BF_CLEAR_READ & BF_CLEAR_WRITE & BF_CLEAR_TIMEOUT;
|
||||
s->rep->flags &= BF_CLEAR_READ & BF_CLEAR_WRITE & BF_CLEAR_TIMEOUT;
|
||||
|
||||
@ -523,10 +523,11 @@ void stream_sock_shutr(struct stream_interface *si)
|
||||
* buffer flags have settled down, and before they are cleared. It doesn't
|
||||
* harm to call it as often as desired (it just slightly hurts performance).
|
||||
*/
|
||||
int stream_sock_data_finish(int fd)
|
||||
void stream_sock_data_finish(struct stream_interface *si)
|
||||
{
|
||||
struct buffer *ib = fdtab[fd].cb[DIR_RD].b;
|
||||
struct buffer *ob = fdtab[fd].cb[DIR_WR].b;
|
||||
struct buffer *ib = si->ib;
|
||||
struct buffer *ob = si->ob;
|
||||
int fd = si->fd;
|
||||
|
||||
DPRINTF(stderr,"[%u] %s: fd=%d owner=%p ib=%p, ob=%p, exp(r,w)=%u,%u ibf=%08x obf=%08x ibl=%d obl=%d si=%d\n",
|
||||
now_ms, __FUNCTION__,
|
||||
@ -534,7 +535,7 @@ int stream_sock_data_finish(int fd)
|
||||
ib, ob,
|
||||
ib->rex, ob->wex,
|
||||
ib->flags, ob->flags,
|
||||
ib->l, ob->l, ob->cons->state);
|
||||
ib->l, ob->l, si->state);
|
||||
|
||||
/* Check if we need to close the read side */
|
||||
if (!(ib->flags & BF_SHUTR)) {
|
||||
@ -583,7 +584,6 @@ int stream_sock_data_finish(int fd)
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user