Lines Matching refs:data
136 struct SessionHandle *data = conn->data; in Curl_pgrsDone() local
137 data->progress.lastshow=0; in Curl_pgrsDone()
142 if(!(data->progress.flags & PGRS_HIDE) && in Curl_pgrsDone()
143 !data->progress.callback) in Curl_pgrsDone()
146 fprintf(data->set.err, "\n"); in Curl_pgrsDone()
148 data->progress.speeder_c = 0; /* reset the progress meter display */ in Curl_pgrsDone()
153 void Curl_pgrsResetTimesSizes(struct SessionHandle *data) in Curl_pgrsResetTimesSizes() argument
155 data->progress.t_nslookup = 0.0; in Curl_pgrsResetTimesSizes()
156 data->progress.t_connect = 0.0; in Curl_pgrsResetTimesSizes()
157 data->progress.t_pretransfer = 0.0; in Curl_pgrsResetTimesSizes()
158 data->progress.t_starttransfer = 0.0; in Curl_pgrsResetTimesSizes()
160 Curl_pgrsSetDownloadSize(data, -1); in Curl_pgrsResetTimesSizes()
161 Curl_pgrsSetUploadSize(data, -1); in Curl_pgrsResetTimesSizes()
164 void Curl_pgrsTime(struct SessionHandle *data, timerid timer) in Curl_pgrsTime() argument
175 data->progress.t_startop = now; in Curl_pgrsTime()
179 data->progress.t_startsingle = now; in Curl_pgrsTime()
183 data->progress.t_acceptdata = Curl_tvnow(); in Curl_pgrsTime()
187 data->progress.t_nslookup = in Curl_pgrsTime()
188 Curl_tvdiff_secs(now, data->progress.t_startsingle); in Curl_pgrsTime()
191 data->progress.t_connect = in Curl_pgrsTime()
192 Curl_tvdiff_secs(now, data->progress.t_startsingle); in Curl_pgrsTime()
195 data->progress.t_appconnect = in Curl_pgrsTime()
196 Curl_tvdiff_secs(now, data->progress.t_startsingle); in Curl_pgrsTime()
199 data->progress.t_pretransfer = in Curl_pgrsTime()
200 Curl_tvdiff_secs(now, data->progress.t_startsingle); in Curl_pgrsTime()
203 data->progress.t_starttransfer = in Curl_pgrsTime()
204 Curl_tvdiff_secs(now, data->progress.t_startsingle); in Curl_pgrsTime()
210 data->progress.t_redirect = Curl_tvdiff_secs(now, data->progress.start); in Curl_pgrsTime()
215 void Curl_pgrsStartNow(struct SessionHandle *data) in Curl_pgrsStartNow() argument
217 data->progress.speeder_c = 0; /* reset the progress meter display */ in Curl_pgrsStartNow()
218 data->progress.start = Curl_tvnow(); in Curl_pgrsStartNow()
220 data->progress.flags &= PGRS_HIDE|PGRS_HEADERS_OUT; in Curl_pgrsStartNow()
223 void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size) in Curl_pgrsSetDownloadCounter() argument
225 data->progress.downloaded = size; in Curl_pgrsSetDownloadCounter()
228 void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size) in Curl_pgrsSetUploadCounter() argument
230 data->progress.uploaded = size; in Curl_pgrsSetUploadCounter()
233 void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size) in Curl_pgrsSetDownloadSize() argument
236 data->progress.size_dl = size; in Curl_pgrsSetDownloadSize()
237 data->progress.flags |= PGRS_DL_SIZE_KNOWN; in Curl_pgrsSetDownloadSize()
240 data->progress.size_dl = 0; in Curl_pgrsSetDownloadSize()
241 data->progress.flags &= ~PGRS_DL_SIZE_KNOWN; in Curl_pgrsSetDownloadSize()
245 void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size) in Curl_pgrsSetUploadSize() argument
248 data->progress.size_ul = size; in Curl_pgrsSetUploadSize()
249 data->progress.flags |= PGRS_UL_SIZE_KNOWN; in Curl_pgrsSetUploadSize()
252 data->progress.size_ul = 0; in Curl_pgrsSetUploadSize()
253 data->progress.flags &= ~PGRS_UL_SIZE_KNOWN; in Curl_pgrsSetUploadSize()
272 struct SessionHandle *data = conn->data; in Curl_pgrsUpdate() local
273 int nowindex = data->progress.speeder_c% CURR_TIME; in Curl_pgrsUpdate()
287 data->progress.timespent = in Curl_pgrsUpdate()
288 (double)(now.tv_sec - data->progress.start.tv_sec) + in Curl_pgrsUpdate()
289 (double)(now.tv_usec - data->progress.start.tv_usec)/1000000.0; in Curl_pgrsUpdate()
290 timespent = (curl_off_t)data->progress.timespent; in Curl_pgrsUpdate()
293 data->progress.dlspeed = (curl_off_t) in Curl_pgrsUpdate()
294 ((double)data->progress.downloaded/ in Curl_pgrsUpdate()
295 (data->progress.timespent>0?data->progress.timespent:1)); in Curl_pgrsUpdate()
298 data->progress.ulspeed = (curl_off_t) in Curl_pgrsUpdate()
299 ((double)data->progress.uploaded/ in Curl_pgrsUpdate()
300 (data->progress.timespent>0?data->progress.timespent:1)); in Curl_pgrsUpdate()
303 if(data->progress.lastshow != (long)now.tv_sec) { in Curl_pgrsUpdate()
306 data->progress.lastshow = now.tv_sec; in Curl_pgrsUpdate()
310 data->progress.speeder[ nowindex ] = in Curl_pgrsUpdate()
311 data->progress.downloaded>data->progress.uploaded? in Curl_pgrsUpdate()
312 data->progress.downloaded:data->progress.uploaded; in Curl_pgrsUpdate()
315 data->progress.speeder_time [ nowindex ] = now; in Curl_pgrsUpdate()
319 data->progress.speeder_c++; in Curl_pgrsUpdate()
325 countindex = ((data->progress.speeder_c>=CURR_TIME)? in Curl_pgrsUpdate()
326 CURR_TIME:data->progress.speeder_c) - 1; in Curl_pgrsUpdate()
335 checkindex = (data->progress.speeder_c>=CURR_TIME)? in Curl_pgrsUpdate()
336 data->progress.speeder_c%CURR_TIME:0; in Curl_pgrsUpdate()
340 data->progress.speeder_time[checkindex]); in Curl_pgrsUpdate()
346 curl_off_t amount = data->progress.speeder[nowindex]- in Curl_pgrsUpdate()
347 data->progress.speeder[checkindex]; in Curl_pgrsUpdate()
352 data->progress.current_speed = (curl_off_t) in Curl_pgrsUpdate()
357 data->progress.current_speed = amount*CURL_OFF_T_C(1000)/span_ms; in Curl_pgrsUpdate()
362 data->progress.current_speed = in Curl_pgrsUpdate()
363 (data->progress.ulspeed>data->progress.dlspeed)? in Curl_pgrsUpdate()
364 data->progress.ulspeed:data->progress.dlspeed; in Curl_pgrsUpdate()
368 if(!(data->progress.flags & PGRS_HIDE)) { in Curl_pgrsUpdate()
371 if(data->set.fxferinfo) { in Curl_pgrsUpdate()
373 result= data->set.fxferinfo(data->set.progress_client, in Curl_pgrsUpdate()
374 data->progress.size_dl, in Curl_pgrsUpdate()
375 data->progress.downloaded, in Curl_pgrsUpdate()
376 data->progress.size_ul, in Curl_pgrsUpdate()
377 data->progress.uploaded); in Curl_pgrsUpdate()
379 failf(data, "Callback aborted"); in Curl_pgrsUpdate()
382 else if(data->set.fprogress) { in Curl_pgrsUpdate()
384 result= data->set.fprogress(data->set.progress_client, in Curl_pgrsUpdate()
385 (double)data->progress.size_dl, in Curl_pgrsUpdate()
386 (double)data->progress.downloaded, in Curl_pgrsUpdate()
387 (double)data->progress.size_ul, in Curl_pgrsUpdate()
388 (double)data->progress.uploaded); in Curl_pgrsUpdate()
390 failf(data, "Callback aborted"); in Curl_pgrsUpdate()
401 if(!(data->progress.flags & PGRS_HEADERS_OUT)) { in Curl_pgrsUpdate()
402 if(data->state.resume_from) { in Curl_pgrsUpdate()
403 fprintf(data->set.err, in Curl_pgrsUpdate()
405 CURL_FORMAT_CURL_OFF_T "\n", data->state.resume_from); in Curl_pgrsUpdate()
407 fprintf(data->set.err, in Curl_pgrsUpdate()
412 data->progress.flags |= PGRS_HEADERS_OUT; /* headers are shown */ in Curl_pgrsUpdate()
416 if((data->progress.flags & PGRS_UL_SIZE_KNOWN) && in Curl_pgrsUpdate()
417 (data->progress.ulspeed > CURL_OFF_T_C(0))) { in Curl_pgrsUpdate()
418 ulestimate = data->progress.size_ul / data->progress.ulspeed; in Curl_pgrsUpdate()
420 if(data->progress.size_ul > CURL_OFF_T_C(10000)) in Curl_pgrsUpdate()
421 ulpercen = data->progress.uploaded / in Curl_pgrsUpdate()
422 (data->progress.size_ul/CURL_OFF_T_C(100)); in Curl_pgrsUpdate()
423 else if(data->progress.size_ul > CURL_OFF_T_C(0)) in Curl_pgrsUpdate()
424 ulpercen = (data->progress.uploaded*100) / in Curl_pgrsUpdate()
425 data->progress.size_ul; in Curl_pgrsUpdate()
429 if((data->progress.flags & PGRS_DL_SIZE_KNOWN) && in Curl_pgrsUpdate()
430 (data->progress.dlspeed > CURL_OFF_T_C(0))) { in Curl_pgrsUpdate()
431 dlestimate = data->progress.size_dl / data->progress.dlspeed; in Curl_pgrsUpdate()
433 if(data->progress.size_dl > CURL_OFF_T_C(10000)) in Curl_pgrsUpdate()
434 dlpercen = data->progress.downloaded / in Curl_pgrsUpdate()
435 (data->progress.size_dl/CURL_OFF_T_C(100)); in Curl_pgrsUpdate()
436 else if(data->progress.size_dl > CURL_OFF_T_C(0)) in Curl_pgrsUpdate()
437 dlpercen = (data->progress.downloaded*100) / in Curl_pgrsUpdate()
438 data->progress.size_dl; in Curl_pgrsUpdate()
452 (data->progress.flags & PGRS_UL_SIZE_KNOWN? in Curl_pgrsUpdate()
453 data->progress.size_ul:data->progress.uploaded)+ in Curl_pgrsUpdate()
454 (data->progress.flags & PGRS_DL_SIZE_KNOWN? in Curl_pgrsUpdate()
455 data->progress.size_dl:data->progress.downloaded); in Curl_pgrsUpdate()
458 total_transfer = data->progress.downloaded + data->progress.uploaded; in Curl_pgrsUpdate()
467 fprintf(data->set.err, in Curl_pgrsUpdate()
475 max5data(data->progress.downloaded, max5[0]), /* rcvd size */ in Curl_pgrsUpdate()
477 max5data(data->progress.uploaded, max5[1]), /* xfer size */ in Curl_pgrsUpdate()
478 max5data(data->progress.dlspeed, max5[3]), /* avrg dl speed */ in Curl_pgrsUpdate()
479 max5data(data->progress.ulspeed, max5[4]), /* avrg ul speed */ in Curl_pgrsUpdate()
483 max5data(data->progress.current_speed, max5[5]) /* current speed */ in Curl_pgrsUpdate()
487 fflush(data->set.err); in Curl_pgrsUpdate()