Lines Matching refs:data
140 struct Curl_easy *data = conn->data; in Curl_pgrsDone() local
141 data->progress.lastshow = 0; in Curl_pgrsDone()
146 if(!(data->progress.flags & PGRS_HIDE) && in Curl_pgrsDone()
147 !data->progress.callback) in Curl_pgrsDone()
150 fprintf(data->set.err, "\n"); in Curl_pgrsDone()
152 data->progress.speeder_c = 0; /* reset the progress meter display */ in Curl_pgrsDone()
157 void Curl_pgrsResetTransferSizes(struct Curl_easy *data) in Curl_pgrsResetTransferSizes() argument
159 Curl_pgrsSetDownloadSize(data, -1); in Curl_pgrsResetTransferSizes()
160 Curl_pgrsSetUploadSize(data, -1); in Curl_pgrsResetTransferSizes()
166 void Curl_pgrsTime(struct Curl_easy *data, timerid timer) in Curl_pgrsTime() argument
178 data->progress.t_startop = now; in Curl_pgrsTime()
182 data->progress.t_startsingle = now; in Curl_pgrsTime()
183 data->progress.is_t_startransfer_set = false; in Curl_pgrsTime()
186 data->progress.t_acceptdata = now; in Curl_pgrsTime()
189 delta = &data->progress.t_nslookup; in Curl_pgrsTime()
192 delta = &data->progress.t_connect; in Curl_pgrsTime()
195 delta = &data->progress.t_appconnect; in Curl_pgrsTime()
198 delta = &data->progress.t_pretransfer; in Curl_pgrsTime()
201 delta = &data->progress.t_starttransfer; in Curl_pgrsTime()
208 if(data->progress.is_t_startransfer_set) { in Curl_pgrsTime()
212 data->progress.is_t_startransfer_set = true; in Curl_pgrsTime()
219 data->progress.t_redirect = Curl_timediff_us(now, data->progress.start); in Curl_pgrsTime()
223 timediff_t us = Curl_timediff_us(now, data->progress.t_startsingle); in Curl_pgrsTime()
230 void Curl_pgrsStartNow(struct Curl_easy *data) in Curl_pgrsStartNow() argument
232 data->progress.speeder_c = 0; /* reset the progress meter display */ in Curl_pgrsStartNow()
233 data->progress.start = Curl_now(); in Curl_pgrsStartNow()
234 data->progress.is_t_startransfer_set = false; in Curl_pgrsStartNow()
235 data->progress.ul_limit_start.tv_sec = 0; in Curl_pgrsStartNow()
236 data->progress.ul_limit_start.tv_usec = 0; in Curl_pgrsStartNow()
237 data->progress.dl_limit_start.tv_sec = 0; in Curl_pgrsStartNow()
238 data->progress.dl_limit_start.tv_usec = 0; in Curl_pgrsStartNow()
240 data->progress.flags &= PGRS_HIDE|PGRS_HEADERS_OUT; in Curl_pgrsStartNow()
241 Curl_ratelimit(data, data->progress.start); in Curl_pgrsStartNow()
306 void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size) in Curl_pgrsSetDownloadCounter() argument
308 data->progress.downloaded = size; in Curl_pgrsSetDownloadCounter()
314 void Curl_ratelimit(struct Curl_easy *data, struct curltime now) in Curl_ratelimit() argument
317 if(data->set.max_recv_speed > 0) { in Curl_ratelimit()
318 if(Curl_timediff(now, data->progress.dl_limit_start) >= in Curl_ratelimit()
320 data->progress.dl_limit_start = now; in Curl_ratelimit()
321 data->progress.dl_limit_size = data->progress.downloaded; in Curl_ratelimit()
324 if(data->set.max_send_speed > 0) { in Curl_ratelimit()
325 if(Curl_timediff(now, data->progress.ul_limit_start) >= in Curl_ratelimit()
327 data->progress.ul_limit_start = now; in Curl_ratelimit()
328 data->progress.ul_limit_size = data->progress.uploaded; in Curl_ratelimit()
336 void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size) in Curl_pgrsSetUploadCounter() argument
338 data->progress.uploaded = size; in Curl_pgrsSetUploadCounter()
341 void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size) in Curl_pgrsSetDownloadSize() argument
344 data->progress.size_dl = size; in Curl_pgrsSetDownloadSize()
345 data->progress.flags |= PGRS_DL_SIZE_KNOWN; in Curl_pgrsSetDownloadSize()
348 data->progress.size_dl = 0; in Curl_pgrsSetDownloadSize()
349 data->progress.flags &= ~PGRS_DL_SIZE_KNOWN; in Curl_pgrsSetDownloadSize()
353 void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size) in Curl_pgrsSetUploadSize() argument
356 data->progress.size_ul = size; in Curl_pgrsSetUploadSize()
357 data->progress.flags |= PGRS_UL_SIZE_KNOWN; in Curl_pgrsSetUploadSize()
360 data->progress.size_ul = 0; in Curl_pgrsSetUploadSize()
361 data->progress.flags &= ~PGRS_UL_SIZE_KNOWN; in Curl_pgrsSetUploadSize()
374 struct Curl_easy *data = conn->data; in Curl_pgrsUpdate() local
375 int nowindex = data->progress.speeder_c% CURR_TIME; in Curl_pgrsUpdate()
377 curl_off_t dl = data->progress.downloaded; in Curl_pgrsUpdate()
378 curl_off_t ul = data->progress.uploaded; in Curl_pgrsUpdate()
383 data->progress.timespent = Curl_timediff_us(now, data->progress.start); in Curl_pgrsUpdate()
384 timespent = (curl_off_t)data->progress.timespent/1000000; /* seconds */ in Curl_pgrsUpdate()
385 timespent_ms = (curl_off_t)data->progress.timespent/1000; /* ms */ in Curl_pgrsUpdate()
389 data->progress.dlspeed = (dl * 1000 / (timespent_ms>0?timespent_ms:1)); in Curl_pgrsUpdate()
391 data->progress.dlspeed = (dl / (timespent>0?timespent:1)); in Curl_pgrsUpdate()
395 data->progress.ulspeed = (ul * 1000 / (timespent_ms>0?timespent_ms:1)); in Curl_pgrsUpdate()
397 data->progress.ulspeed = (ul / (timespent>0?timespent:1)); in Curl_pgrsUpdate()
400 if(data->progress.lastshow != now.tv_sec) { in Curl_pgrsUpdate()
404 data->progress.lastshow = now.tv_sec; in Curl_pgrsUpdate()
408 data->progress.speeder[ nowindex ] = in Curl_pgrsUpdate()
409 data->progress.downloaded + data->progress.uploaded; in Curl_pgrsUpdate()
412 data->progress.speeder_time [ nowindex ] = now; in Curl_pgrsUpdate()
416 data->progress.speeder_c++; in Curl_pgrsUpdate()
422 countindex = ((data->progress.speeder_c >= CURR_TIME)? in Curl_pgrsUpdate()
423 CURR_TIME:data->progress.speeder_c) - 1; in Curl_pgrsUpdate()
433 checkindex = (data->progress.speeder_c >= CURR_TIME)? in Curl_pgrsUpdate()
434 data->progress.speeder_c%CURR_TIME:0; in Curl_pgrsUpdate()
438 data->progress.speeder_time[checkindex]); in Curl_pgrsUpdate()
444 curl_off_t amount = data->progress.speeder[nowindex]- in Curl_pgrsUpdate()
445 data->progress.speeder[checkindex]; in Curl_pgrsUpdate()
450 data->progress.current_speed = (curl_off_t) in Curl_pgrsUpdate()
455 data->progress.current_speed = amount*CURL_OFF_T_C(1000)/span_ms; in Curl_pgrsUpdate()
460 data->progress.current_speed = in Curl_pgrsUpdate()
461 data->progress.ulspeed + data->progress.dlspeed; in Curl_pgrsUpdate()
465 if(!(data->progress.flags & PGRS_HIDE)) { in Curl_pgrsUpdate()
480 if(data->set.fxferinfo) { in Curl_pgrsUpdate()
483 Curl_set_in_callback(data, true); in Curl_pgrsUpdate()
484 result = data->set.fxferinfo(data->set.progress_client, in Curl_pgrsUpdate()
485 data->progress.size_dl, in Curl_pgrsUpdate()
486 data->progress.downloaded, in Curl_pgrsUpdate()
487 data->progress.size_ul, in Curl_pgrsUpdate()
488 data->progress.uploaded); in Curl_pgrsUpdate()
489 Curl_set_in_callback(data, false); in Curl_pgrsUpdate()
491 failf(data, "Callback aborted"); in Curl_pgrsUpdate()
494 if(data->set.fprogress) { in Curl_pgrsUpdate()
497 Curl_set_in_callback(data, true); in Curl_pgrsUpdate()
498 result = data->set.fprogress(data->set.progress_client, in Curl_pgrsUpdate()
499 (double)data->progress.size_dl, in Curl_pgrsUpdate()
500 (double)data->progress.downloaded, in Curl_pgrsUpdate()
501 (double)data->progress.size_ul, in Curl_pgrsUpdate()
502 (double)data->progress.uploaded); in Curl_pgrsUpdate()
503 Curl_set_in_callback(data, false); in Curl_pgrsUpdate()
505 failf(data, "Callback aborted"); in Curl_pgrsUpdate()
516 if(!(data->progress.flags & PGRS_HEADERS_OUT)) { in Curl_pgrsUpdate()
517 if(data->state.resume_from) { in Curl_pgrsUpdate()
518 fprintf(data->set.err, in Curl_pgrsUpdate()
520 CURL_FORMAT_CURL_OFF_T "\n", data->state.resume_from); in Curl_pgrsUpdate()
522 fprintf(data->set.err, in Curl_pgrsUpdate()
527 data->progress.flags |= PGRS_HEADERS_OUT; /* headers are shown */ in Curl_pgrsUpdate()
531 if((data->progress.flags & PGRS_UL_SIZE_KNOWN) && in Curl_pgrsUpdate()
532 (data->progress.ulspeed > CURL_OFF_T_C(0))) { in Curl_pgrsUpdate()
533 ulestimate = data->progress.size_ul / data->progress.ulspeed; in Curl_pgrsUpdate()
535 if(data->progress.size_ul > CURL_OFF_T_C(10000)) in Curl_pgrsUpdate()
536 ulpercen = data->progress.uploaded / in Curl_pgrsUpdate()
537 (data->progress.size_ul/CURL_OFF_T_C(100)); in Curl_pgrsUpdate()
538 else if(data->progress.size_ul > CURL_OFF_T_C(0)) in Curl_pgrsUpdate()
539 ulpercen = (data->progress.uploaded*100) / in Curl_pgrsUpdate()
540 data->progress.size_ul; in Curl_pgrsUpdate()
544 if((data->progress.flags & PGRS_DL_SIZE_KNOWN) && in Curl_pgrsUpdate()
545 (data->progress.dlspeed > CURL_OFF_T_C(0))) { in Curl_pgrsUpdate()
546 dlestimate = data->progress.size_dl / data->progress.dlspeed; in Curl_pgrsUpdate()
548 if(data->progress.size_dl > CURL_OFF_T_C(10000)) in Curl_pgrsUpdate()
549 dlpercen = data->progress.downloaded / in Curl_pgrsUpdate()
550 (data->progress.size_dl/CURL_OFF_T_C(100)); in Curl_pgrsUpdate()
551 else if(data->progress.size_dl > CURL_OFF_T_C(0)) in Curl_pgrsUpdate()
552 dlpercen = (data->progress.downloaded*100) / in Curl_pgrsUpdate()
553 data->progress.size_dl; in Curl_pgrsUpdate()
567 (data->progress.flags & PGRS_UL_SIZE_KNOWN? in Curl_pgrsUpdate()
568 data->progress.size_ul:data->progress.uploaded)+ in Curl_pgrsUpdate()
569 (data->progress.flags & PGRS_DL_SIZE_KNOWN? in Curl_pgrsUpdate()
570 data->progress.size_dl:data->progress.downloaded); in Curl_pgrsUpdate()
573 total_transfer = data->progress.downloaded + data->progress.uploaded; in Curl_pgrsUpdate()
582 fprintf(data->set.err, in Curl_pgrsUpdate()
590 max5data(data->progress.downloaded, max5[0]), /* rcvd size */ in Curl_pgrsUpdate()
592 max5data(data->progress.uploaded, max5[1]), /* xfer size */ in Curl_pgrsUpdate()
593 max5data(data->progress.dlspeed, max5[3]), /* avrg dl speed */ in Curl_pgrsUpdate()
594 max5data(data->progress.ulspeed, max5[4]), /* avrg ul speed */ in Curl_pgrsUpdate()
598 max5data(data->progress.current_speed, max5[5]) /* current speed */ in Curl_pgrsUpdate()
602 fflush(data->set.err); in Curl_pgrsUpdate()