Lines Matching refs:state

279 static void mimesetstate(struct mime_state *state,  in mimesetstate()  argument
282 state->state = tok; in mimesetstate()
283 state->ptr = ptr; in mimesetstate()
284 state->offset = 0; in mimesetstate()
666 size_t sz = curlx_sotouz(part->datasize - part->state.offset); in mime_mem_read()
676 memcpy(buffer, part->data + curlx_sotouz(part->state.offset), sz); in mime_mem_read()
687 offset += part->state.offset; in mime_mem_seek()
697 part->state.offset = offset; in mime_mem_seek()
763 static size_t readback_bytes(struct mime_state *state, in readback_bytes() argument
769 size_t offset = curlx_sotouz(state->offset); in readback_bytes()
787 state->offset += sz; in readback_bytes()
809 part->state.offset >= part->datasize) { in read_part_content()
848 part->state.offset += sz; in read_part_content()
926 struct curl_slist *hdr = (struct curl_slist *) part->state.ptr; in readback_part()
927 switch(part->state.state) { in readback_part()
929 mimesetstate(&part->state, in readback_part()
936 mimesetstate(&part->state, MIMESTATE_EOH, NULL); in readback_part()
940 mimesetstate(&part->state, MIMESTATE_USERHEADERS, hdr->next); in readback_part()
946 mimesetstate(&part->state, MIMESTATE_USERHEADERS, part->userheaders); in readback_part()
948 sz = readback_bytes(&part->state, buffer, bufsize, in readback_part()
951 mimesetstate(&part->state, part->state.state, hdr->next); in readback_part()
955 sz = readback_bytes(&part->state, buffer, bufsize, STRCONST("\r\n"), in readback_part()
958 mimesetstate(&part->state, MIMESTATE_BODY, NULL); in readback_part()
962 mimesetstate(&part->state, MIMESTATE_CONTENT, NULL); in readback_part()
971 mimesetstate(&part->state, MIMESTATE_END, NULL); in readback_part()
1010 curl_mimepart *part = mime->state.ptr; in mime_subparts_read()
1011 switch(mime->state.state) { in mime_subparts_read()
1014 mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, mime->firstpart); in mime_subparts_read()
1018 mime->state.offset += 2; in mime_subparts_read()
1021 sz = readback_bytes(&mime->state, buffer, nitems, STRCONST("\r\n--"), in mime_subparts_read()
1024 mimesetstate(&mime->state, MIMESTATE_BOUNDARY2, part); in mime_subparts_read()
1028 sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary, in mime_subparts_read()
1031 sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary, in mime_subparts_read()
1034 mimesetstate(&mime->state, MIMESTATE_CONTENT, part); in mime_subparts_read()
1039 mimesetstate(&mime->state, MIMESTATE_END, NULL); in mime_subparts_read()
1050 mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, part->nextpart); in mime_subparts_read()
1077 if(part->state.state > targetstate) { in mime_part_rewind()
1097 mimesetstate(&part->state, targetstate, NULL); in mime_part_rewind()
1112 if(mime->state.state == MIMESTATE_BEGIN) in mime_subparts_seek()
1122 mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL); in mime_subparts_seek()
1144 part->state.state = MIMESTATE_BEGIN; in cleanup_part_content()
1303 mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL); in curl_mime_init()
1314 mimesetstate(&part->state, MIMESTATE_BEGIN, NULL); in Curl_mime_initpart()
1780 if(part->state.state == MIMESTATE_CURLHEADERS) in Curl_mime_prepare_headers()
1781 mimesetstate(&part->state, MIMESTATE_CURLHEADERS, NULL); in Curl_mime_prepare_headers()
1884 if(part->state.state == MIMESTATE_CURLHEADERS) in Curl_mime_prepare_headers()
1885 mimesetstate(&part->state, MIMESTATE_CURLHEADERS, part->curlheaders); in Curl_mime_prepare_headers()