Lines Matching refs:req

43 void Curl_req_init(struct SingleRequest *req)  in Curl_req_init()  argument
45 memset(req, 0, sizeof(*req)); in Curl_req_init()
48 CURLcode Curl_req_soft_reset(struct SingleRequest *req, in Curl_req_soft_reset() argument
53 req->done = FALSE; in Curl_req_soft_reset()
54 req->upload_done = FALSE; in Curl_req_soft_reset()
55 req->upload_aborted = FALSE; in Curl_req_soft_reset()
56 req->download_done = FALSE; in Curl_req_soft_reset()
57 req->eos_written = FALSE; in Curl_req_soft_reset()
58 req->eos_read = FALSE; in Curl_req_soft_reset()
59 req->eos_sent = FALSE; in Curl_req_soft_reset()
60 req->ignorebody = FALSE; in Curl_req_soft_reset()
61 req->shutdown = FALSE; in Curl_req_soft_reset()
62 req->bytecount = 0; in Curl_req_soft_reset()
63 req->writebytecount = 0; in Curl_req_soft_reset()
64 req->header = TRUE; /* assume header */ in Curl_req_soft_reset()
65 req->headerline = 0; in Curl_req_soft_reset()
66 req->headerbytecount = 0; in Curl_req_soft_reset()
67 req->allheadercount = 0; in Curl_req_soft_reset()
68 req->deductheadercount = 0; in Curl_req_soft_reset()
74 if(!req->sendbuf_init) { in Curl_req_soft_reset()
75 Curl_bufq_init2(&req->sendbuf, data->set.upload_buffer_size, 1, in Curl_req_soft_reset()
77 req->sendbuf_init = TRUE; in Curl_req_soft_reset()
80 Curl_bufq_reset(&req->sendbuf); in Curl_req_soft_reset()
81 if(data->set.upload_buffer_size != req->sendbuf.chunk_size) { in Curl_req_soft_reset()
82 Curl_bufq_free(&req->sendbuf); in Curl_req_soft_reset()
83 Curl_bufq_init2(&req->sendbuf, data->set.upload_buffer_size, 1, in Curl_req_soft_reset()
91 CURLcode Curl_req_start(struct SingleRequest *req, in Curl_req_start() argument
94 req->start = Curl_now(); in Curl_req_start()
95 return Curl_req_soft_reset(req, data); in Curl_req_start()
100 CURLcode Curl_req_done(struct SingleRequest *req, in Curl_req_done() argument
103 (void)req; in Curl_req_done()
113 void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data) in Curl_req_hard_reset() argument
119 Curl_safefree(req->p.ftp); in Curl_req_hard_reset()
120 Curl_safefree(req->newurl); in Curl_req_hard_reset()
122 if(req->sendbuf_init) in Curl_req_hard_reset()
123 Curl_bufq_reset(&req->sendbuf); in Curl_req_hard_reset()
129 req->size = -1; in Curl_req_hard_reset()
130 req->maxdownload = -1; in Curl_req_hard_reset()
131 req->bytecount = 0; in Curl_req_hard_reset()
132 req->writebytecount = 0; in Curl_req_hard_reset()
133 req->start = t0; in Curl_req_hard_reset()
134 req->headerbytecount = 0; in Curl_req_hard_reset()
135 req->allheadercount = 0; in Curl_req_hard_reset()
136 req->deductheadercount = 0; in Curl_req_hard_reset()
137 req->headerline = 0; in Curl_req_hard_reset()
138 req->offset = 0; in Curl_req_hard_reset()
139 req->httpcode = 0; in Curl_req_hard_reset()
140 req->keepon = 0; in Curl_req_hard_reset()
141 req->upgr101 = UPGR101_INIT; in Curl_req_hard_reset()
142 req->timeofdoc = 0; in Curl_req_hard_reset()
143 req->location = NULL; in Curl_req_hard_reset()
144 req->newurl = NULL; in Curl_req_hard_reset()
146 req->setcookies = 0; in Curl_req_hard_reset()
148 req->header = FALSE; in Curl_req_hard_reset()
149 req->content_range = FALSE; in Curl_req_hard_reset()
150 req->download_done = FALSE; in Curl_req_hard_reset()
151 req->eos_written = FALSE; in Curl_req_hard_reset()
152 req->eos_read = FALSE; in Curl_req_hard_reset()
153 req->eos_sent = FALSE; in Curl_req_hard_reset()
154 req->upload_done = FALSE; in Curl_req_hard_reset()
155 req->upload_aborted = FALSE; in Curl_req_hard_reset()
156 req->ignorebody = FALSE; in Curl_req_hard_reset()
157 req->http_bodyless = FALSE; in Curl_req_hard_reset()
158 req->chunk = FALSE; in Curl_req_hard_reset()
159 req->ignore_cl = FALSE; in Curl_req_hard_reset()
160 req->upload_chunky = FALSE; in Curl_req_hard_reset()
161 req->getheader = FALSE; in Curl_req_hard_reset()
162 req->no_body = data->set.opt_no_body; in Curl_req_hard_reset()
163 req->authneg = FALSE; in Curl_req_hard_reset()
164 req->shutdown = FALSE; in Curl_req_hard_reset()
166 req->bodywritten = FALSE; in Curl_req_hard_reset()
170 void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data) in Curl_req_free() argument
174 Curl_safefree(req->p.ftp); in Curl_req_free()
175 Curl_safefree(req->newurl); in Curl_req_free()
176 if(req->sendbuf_init) in Curl_req_free()
177 Curl_bufq_free(&req->sendbuf); in Curl_req_free()
215 if(data->req.eos_read && in xfer_send()
216 (Curl_bufq_is_empty(&data->req.sendbuf) || in xfer_send()
217 Curl_bufq_len(&data->req.sendbuf) == blen)) { in xfer_send()
224 data->req.eos_sent = TRUE; in xfer_send()
232 data->req.writebytecount += body_len; in xfer_send()
233 Curl_pgrsSetUploadCounter(data, data->req.writebytecount); in xfer_send()
246 while(Curl_bufq_peek(&data->req.sendbuf, &buf, &blen)) { in req_send_buffer_flush()
247 size_t nwritten, hds_len = CURLMIN(data->req.sendbuf_hds_len, blen); in req_send_buffer_flush()
252 Curl_bufq_skip(&data->req.sendbuf, nwritten); in req_send_buffer_flush()
254 data->req.sendbuf_hds_len -= CURLMIN(hds_len, nwritten); in req_send_buffer_flush()
266 DEBUGASSERT(!data->req.upload_done); in Curl_req_set_upload_done()
267 data->req.upload_done = TRUE; in Curl_req_set_upload_done()
268 data->req.keepon &= ~(KEEP_SEND|KEEP_SEND_TIMED); /* we are done sending */ in Curl_req_set_upload_done()
271 Curl_creader_done(data, data->req.upload_aborted); in Curl_req_set_upload_done()
273 if(data->req.upload_aborted) { in Curl_req_set_upload_done()
274 Curl_bufq_reset(&data->req.sendbuf); in Curl_req_set_upload_done()
275 if(data->req.writebytecount) in Curl_req_set_upload_done()
277 data->req.writebytecount); in Curl_req_set_upload_done()
281 else if(data->req.writebytecount) in Curl_req_set_upload_done()
283 data->req.writebytecount); in Curl_req_set_upload_done()
284 else if(!data->req.download_done) { in Curl_req_set_upload_done()
285 DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf)); in Curl_req_set_upload_done()
301 if(!Curl_bufq_is_empty(&data->req.sendbuf)) { in req_flush()
305 if(!Curl_bufq_is_empty(&data->req.sendbuf)) { in req_flush()
307 Curl_bufq_len(&data->req.sendbuf))); in req_flush()
316 if(data->req.eos_read && !data->req.eos_sent) { in req_flush()
322 DEBUGASSERT(data->req.eos_sent); in req_flush()
325 if(!data->req.upload_done && data->req.eos_read && data->req.eos_sent) { in req_flush()
326 DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf)); in req_flush()
327 if(data->req.shutdown) { in req_flush()
330 if(result && data->req.shutdown_err_ignore) { in req_flush()
359 data->req.eos_read = TRUE; in add_from_client()
371 n = Curl_bufq_write(&data->req.sendbuf, in req_send_buffer_add()
377 data->req.sendbuf_hds_len += hds_len; in req_send_buffer_add()
381 CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *req) in Curl_req_send() argument
390 buf = Curl_dyn_ptr(req); in Curl_req_send()
391 blen = Curl_dyn_len(req); in Curl_req_send()
394 data->req.eos_read = TRUE; in Curl_req_send()
418 return !data->req.sendbuf_init || Curl_bufq_is_empty(&data->req.sendbuf); in Curl_req_sendbuf_empty()
427 return !data->req.done && in Curl_req_want_send()
428 (((data->req.keepon & KEEP_SENDBITS) == KEEP_SEND) || in Curl_req_want_send()
435 return data->req.upload_done && !Curl_req_want_send(data); in Curl_req_done_sending()
443 if(!data->req.upload_aborted && in Curl_req_send_more()
444 !data->req.eos_read && in Curl_req_send_more()
445 !(data->req.keepon & KEEP_SEND_PAUSE) && in Curl_req_send_more()
446 !Curl_bufq_is_full(&data->req.sendbuf)) { in Curl_req_send_more()
447 ssize_t nread = Curl_bufq_sipn(&data->req.sendbuf, 0, in Curl_req_send_more()
462 if(!data->req.upload_done) { in Curl_req_abort_sending()
463 Curl_bufq_reset(&data->req.sendbuf); in Curl_req_abort_sending()
464 data->req.upload_aborted = TRUE; in Curl_req_abort_sending()
466 data->req.keepon &= ~KEEP_SENDBITS; in Curl_req_abort_sending()
477 data->req.keepon &= ~(KEEP_RECV|KEEP_SENDBITS); in Curl_req_stop_send_recv()