CURLOPT_PROGRESSFUNCTION这些参数是什么意思? [英] CURLOPT_PROGRESSFUNCTION what these parameters mean?

查看:128
本文介绍了CURLOPT_PROGRESSFUNCTION这些参数是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

libcurl中,通过设置CURLOPT_PROGRESSFUNCTION调用的函数中的参数是什么?

In libcurl, what the parameters mean in the function called by setting CURLOPT_PROGRESSFUNCTION?

int function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);

我知道这是一个la脚的问题,但该网站似乎无法描述,或者我找不到:(

Its a lame question I know but the website doesn't seem to describe, or I wasn't able to find :(

推荐答案

示例可能会有所帮助.总结一下:

This example might help. To summarize:

int function(
  void *clientp,  // this is an unchanged pointer as set with CURLOPT_PROGRESSDATA
  double dltotal, // the total bytes to be downloaded (or 0 if not downloading)
  double dlnow,   // the current download bytecount (or 0 if not downloading)
  double ultotal, // the total bytes to be uploaded (or 0 if not uploading)
  double ulnow);  // the current upload bytecount (or 0 if not uploading)

有关clientp,请参见 CURLOPT_PROGRESSDATA . 如果您从回调函数中返回0以外的任何值,则传输将被取消.

See CURLOPT_PROGRESSDATA for clientp. If you return any value other than 0 from the callback, the transfer will be cancelled.

这篇关于CURLOPT_PROGRESSFUNCTION这些参数是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆