Fix the timeout problem by correctly setting ctx->bufLen.