Giter Club home page Giter Club logo

Comments (5)

zhengshuxin avatar zhengshuxin commented on June 5, 2024 1

问题修复了,原因是这两个例子中的超时时间设成0导致的,改成10就OK了。超时值为0在之前旧版本acl里表示无限等待,后来的含义变成不等待,所以这两个例子中的超时值为0是不对的。

from acl.

zhengshuxin avatar zhengshuxin commented on June 5, 2024

应该是你没有设置响应的数据长度导致的,可以在调用 res.write(body) 前调用: res.setContentLength(body.size()) ,有两种方式:
方式一:

res.setChunkedTransferEncoding(true);
return res.write(body) && res.write(NULL, 0);

方式二:

res.setContentLength(body.size());
return res.write(body);

from acl.

okman334 avatar okman334 commented on June 5, 2024

额。还真是这样。眼拙了,我还在write那个地方调了很久,也没发现有什么问题😂,谢谢作者大神。

from acl.

okman334 avatar okman334 commented on June 5, 2024

现在访问http是ok了。还有一个问题想问问大神。
我使用/acl/lib_fiber/samples/https_client这个例子访问https,出现这个报错,就是读消息头报错了。
openssl_conf.cpp(366), openssl_dll_load: /usr/local/lib/libcrypto.so, /usr/local/lib/libssl.so loaded!
OpenSSL loaded, crypto=/usr/local/lib/libcrypto.so, ssl=/usr/local/lib/libssl.socall fiber_schedule
http_request.cpp(410), request: read response header error

我又跟踪了好一会,最后发现。如果我在读消息头(http_request.cpp的第405行之前)之前,断点1-2秒,就会正常读出https返回的消息。如果直接跑过去,就会报上面的错误。断点位置在bool http_request::request(const void* data, size_t len)里面,如图。
image

linux和macOS下都有这个问题。麻烦有空帮忙看看😂🌹

from acl.

okman334 avatar okman334 commented on June 5, 2024

好的,谢谢帅气的大神。

from acl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.