Skip to content

Commit

Permalink
proxy: inline the `goto retry'
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-polo committed Jul 2, 2024
1 parent 7249505 commit 55ae6c6
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ proxy_tls_readcb(int fd, short event, void *d)
switch (ret = tls_read(c->proxyctx, buf, howmuch)) {
case TLS_WANT_POLLIN:
case TLS_WANT_POLLOUT:
goto retry;
event_add(&bufev->ev_read, NULL);
return;
case -1:
what |= EVBUFFER_ERROR;
goto err;
Expand Down Expand Up @@ -83,10 +84,6 @@ proxy_tls_readcb(int fd, short event, void *d)
(*bufev->readcb)(bufev, bufev->cbarg);
return;

retry:
event_add(&bufev->ev_read, NULL);
return;

err:
(*bufev->errorcb)(bufev, what, bufev->cbarg);
}
Expand All @@ -111,7 +108,8 @@ proxy_tls_writecb(int fd, short event, void *d)
switch (ret) {
case TLS_WANT_POLLIN:
case TLS_WANT_POLLOUT:
goto retry;
event_add(&bufev->ev_write, NULL);
return;
case -1:
what |= EVBUFFER_ERROR;
goto err;
Expand All @@ -129,10 +127,6 @@ proxy_tls_writecb(int fd, short event, void *d)
(*bufev->writecb)(bufev, bufev->cbarg);
return;

retry:
event_add(&bufev->ev_write, NULL);
return;

err:
(*bufev->errorcb)(bufev, what, bufev->cbarg);
}
Expand Down

0 comments on commit 55ae6c6

Please sign in to comment.