mirror of
https://github.com/sonertari/SSLproxy
synced 2024-11-19 21:25:28 +00:00
Do not terminate redirected connection until src outbuf is empty, otherwise 302 redirection may not have been sent yet
This commit is contained in:
parent
1f451aa04d
commit
fcd24a2cbe
@ -534,7 +534,6 @@ protohttp_bev_readcb_src(struct bufferevent *bev, pxy_conn_ctx_t *ctx)
|
||||
} else {
|
||||
evbuffer_add_printf(bufferevent_get_output(bev), redirect, ctx->opts->user_auth_url);
|
||||
}
|
||||
ctx->redirected = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
|
10
prototcp.c
10
prototcp.c
@ -385,12 +385,18 @@ prototcp_bev_writecb_src(struct bufferevent *bev, pxy_conn_ctx_t *ctx)
|
||||
log_dbg_level_printf(LOG_DBG_MODE_FINEST, "prototcp_bev_writecb_src: ENTER, fd=%d\n", ctx->fd);
|
||||
#endif /* DEBUG_PROXY */
|
||||
|
||||
if (ctx->opts->user_auth && !ctx->user && ctx->redirected) {
|
||||
if (ctx->opts->user_auth && !ctx->user) {
|
||||
size_t outbuflen = evbuffer_get_length(bufferevent_get_output(bev));
|
||||
if (outbuflen > 0) {
|
||||
#ifdef DEBUG_PROXY
|
||||
log_dbg_level_printf(LOG_DBG_MODE_FINEST, "prototcp_bev_writecb_src: Not closing redirected conn, outbuflen=%zu, fd=%d\n", outbuflen, ctx->fd);
|
||||
#endif /* DEBUG_PROXY */
|
||||
} else {
|
||||
#ifdef DEBUG_PROXY
|
||||
log_dbg_level_printf(LOG_DBG_MODE_FINEST, "prototcp_bev_writecb_src: Closing redirected conn, fd=%d\n", ctx->fd);
|
||||
#endif /* DEBUG_PROXY */
|
||||
|
||||
pxy_conn_term(ctx, 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user