卷积错误18 - 传输关闭,剩余未读数据 [英] curl error 18 - transfer closed with outstanding read data remaining

查看:203
本文介绍了卷积错误18 - 传输关闭,剩余未读数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用curl从网址检索数据时,有时(在80%的情况下)get

when retrieving data from a URL using curl, I sometimes (in 80% of the cases) get

错误18:剩余

然后缺少部分返回的数据。奇怪的是,当CURLOPT_RETURNTRANSFER设置为false时,这不会发生,也就是说curl_exec函数不返回数据,而是直接显示内容。

Part of the returned data is then missing. The weird thing is that this does never occur when the CURLOPT_RETURNTRANSFER is set to false, that is the curl_exec function doesn't return the data but displays the content directly.

可能是问题?我可以设置一些选项以避免此类行为吗?

What could be the problem? Can I set some of the options to avoid such behaviour?

非常感谢您的建议!

推荐答案

我猜这是与对等体发送的错误Content-Length头相关。
我的建议是让curl自己设置长度。

I bet this is related to a wrong Content-Length header sent by the peer. My advice is to let curl set the length by itself.

这篇关于卷积错误18 - 传输关闭,剩余未读数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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