【发布时间】:2017-06-20 02:15:50
【问题描述】:
router.route('...')
.get(function(req, res, next) {
// This job() function doing some *long* async task and end of the task calling 3th param as callback
job(param1, param2, function(response) {
// printing response to console perfectly
console.log("callback fired", response);
res.send("response");
});
});
我正在向curl 提出我的请求。
$ curl ... -m 300
curl: (52) Empty reply from server
cURL 等待响应几分钟,然后我收到 empty reply 错误。 cURL 在 before nodejs 打印 回调触发 消息时给出此错误。
如果我使用浏览器或 Postman 发出此请求,也会出现同样的错误。
我确定 job() 异步函数中没有 res.send()、res.end() 函数。我卡住了,如何跟踪并找到错误?
【问题讨论】: