Lines Matching refs:ctx
407 struct chunked_writer *ctx = writer->ctx; in cw_chunked_init() local
410 Curl_httpchunk_init(data, &ctx->ch, FALSE); in cw_chunked_init()
417 struct chunked_writer *ctx = writer->ctx; in cw_chunked_close() local
418 Curl_httpchunk_free(data, &ctx->ch); in cw_chunked_close()
425 struct chunked_writer *ctx = writer->ctx; in cw_chunked_write() local
433 result = httpchunk_readwrite(data, &ctx->ch, writer->next, buf, blen, in cw_chunked_write()
437 if(CHUNKE_PASSTHRU_ERROR == ctx->ch.last_code) { in cw_chunked_write()
442 Curl_chunked_strerror(ctx->ch.last_code)); in cw_chunked_write()
448 if(CHUNK_DONE == ctx->ch.state) { in cw_chunked_write()
487 struct chunked_reader *ctx = reader->ctx; in cr_chunked_init() local
489 Curl_bufq_init2(&ctx->chunkbuf, CURL_CHUNKED_MAXLEN, 2, BUFQ_OPT_SOFT_LIMIT); in cr_chunked_init()
496 struct chunked_reader *ctx = reader->ctx; in cr_chunked_close() local
498 Curl_bufq_free(&ctx->chunkbuf); in cr_chunked_close()
504 struct chunked_reader *ctx = reader->ctx; in add_last_chunk() local
512 return Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("0\r\n\r\n"), &n); in add_last_chunk()
515 result = Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("0\r\n"), &n); in add_last_chunk()
537 result = Curl_bufq_cwrite(&ctx->chunkbuf, tr->data, in add_last_chunk()
540 result = Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("\r\n"), &n); in add_last_chunk()
545 result = Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("\r\n"), &n); in add_last_chunk()
558 struct chunked_reader *ctx = reader->ctx; in add_chunk() local
564 DEBUGASSERT(!ctx->read_eos); in add_chunk()
580 ctx->read_eos = TRUE; in add_chunk()
592 result = Curl_bufq_cwrite(&ctx->chunkbuf, hd, hdlen, &n); in add_chunk()
594 result = Curl_bufq_cwrite(&ctx->chunkbuf, buf, nread, &n); in add_chunk()
596 result = Curl_bufq_cwrite(&ctx->chunkbuf, "\r\n", 2, &n); in add_chunk()
603 if(ctx->read_eos) in add_chunk()
613 struct chunked_reader *ctx = reader->ctx; in cr_chunked_read() local
617 *peos = ctx->eos; in cr_chunked_read()
619 if(!ctx->eos) { in cr_chunked_read()
620 if(!ctx->read_eos && Curl_bufq_is_empty(&ctx->chunkbuf)) { in cr_chunked_read()
627 if(!Curl_bufq_is_empty(&ctx->chunkbuf)) { in cr_chunked_read()
628 result = Curl_bufq_cread(&ctx->chunkbuf, buf, blen, pnread); in cr_chunked_read()
629 if(!result && ctx->read_eos && Curl_bufq_is_empty(&ctx->chunkbuf)) { in cr_chunked_read()
631 ctx->eos = TRUE; in cr_chunked_read()
638 DEBUGASSERT(ctx->eos || !ctx->read_eos); in cr_chunked_read()