static rstatus_t proxy_recv(struct context *ctx, struct conn *conn) { rstatus_t status; ASSERT(conn->type == CONN_PROXY); ASSERT(conn->recv_active); conn->recv_ready = 1; do { status = proxy_accept(ctx, conn); if (status != DN_OK) { return status; } } while (conn->recv_ready); return DN_OK; }
rstatus_t proxy_recv(struct context *ctx, struct conn *conn) { rstatus_t status; ASSERT(conn->proxy && !conn->client); ASSERT(conn->recv_active); conn->recv_ready = 1; do { status = proxy_accept(ctx, conn); if (status != DN_OK) { return status; } } while (conn->recv_ready); return DN_OK; }
//conn是proxy性质的conn结构 rstatus_t proxy_recv(struct context *ctx, struct conn *conn) { rstatus_t status; ASSERT(conn->proxy && !conn->client); ASSERT(conn->recv_active); conn->recv_ready = 1; do { status = proxy_accept(ctx, conn); if (status != NC_OK) { return status; } } while (conn->recv_ready); //proxy_accept中把所有客户端连接都接收完毕后会置recv_ready为0 return NC_OK; }