cmoth150415

Results 8 comments of cmoth150415

logs目录下没有日志,而且其他使用同步的接口也全都不能响应了,chrome请求返回ERR_EMPTY_RESPONSE错误 ```c //以下接口也不能响应 router.GET("/mvt/dataset/tilejson/{id}", [](HttpRequest* req, HttpResponse* resp) { //... } ```

不好意思,我对比了下httpd的代码,发现我没加log,加上后log里输出以下错误 ``` 2022-09-21 16:34:37.402 INFO worker_thread pid=20444 tid=20444 [hmain.c:567:worker_thread] 2022-09-21 16:34:37.402 INFO worker_thread pid=20444 tid=20467 [hmain.c:567:worker_thread] 2022-09-21 16:34:37.554 INFO pid=18334 recv signo=17 [hmain.c:372:signal_handler] 2022-09-21 16:34:37.554 WARN proc stop/waiting, pid=20395 status=11...

以下是我主函数部分的代码,实在看不出和httpd流程上有什么区别 ```c using namespace std; hv::HttpServer g_http_server; hv::HttpService g_http_service; void print_version() { printf("%s version %s\n", g_main_ctx.program_name, "6.0"); } void print_help() { //printf("Usage: %s [%s]\n", g_main_ctx.program_name, options); //printf("Options:\n%s\n", detail_options); } bool...

如果请求频繁,程序就coredump,输出 ``` 2022-09-21 17:00:27.094 ERROR proc crash, pid=2800 spawn_cnt=3 run_time=1s [hmain.c:402:signal_handler] ``` 否则只会输出 ``` 2022-09-21 17:00:26.926 WARN proc stop/waiting, pid=1799 status=11 [hmain.c:391:signal_handler] ```

似乎是和sogou的[workflow](https://github.com/sogou/workflow)库有冲突,一模一样的流程请求,只要编译代码target_link_libraries中引入 libworkflow.a,ssl,crypto后,请求就会崩溃,去掉后编译生成,就能正常响应。这是啥原因? ``` Stack trace (most recent call last) in thread 16607: #13 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in #12 Object "/lib64/libc.so.6", at 0x7f1d89328b0c, in clone #11 Object "/lib64/libpthread.so.0", at 0x7f1d89f1dea4,...

改连接动态库libworkflow.so.0.10.3,还是会崩,堆栈 ``` test_http_async_client response thread tid=8141 request failed! Stack trace (most recent call last) in thread 8141: #12 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in #11 Object "/lib64/libc.so.6", at 0x7f0cc44f0b0c, in clone...

但如果直接返回一个响应是可以的 ```c std::shared_ptr RequestPbf1(HttpContextPtr ctx) { //ctx->send("test"); url = "http://192.168.1.104:30000/sevs/api/vec/pbf"; req->headers["Connection"] = "keep-alive"; req->body = R"({"extent":4096,"layer_list":[{"avoidance":true,"bbox":{"max_x":-77.003173828125,"max_y":38.91668153637507,"min_x":-77.01416015625,"min_y":38.908132995967044},"dataset_id":"6962309382061297664","dataset_ver":0,"field_list":["name"],"filter":"","layer_name":"","size":1}],"level":15,"x":9374,"y":12533})"; req->timeout = 10; http_client_send_async(req, [ctx](const HttpResponsePtr& resp) { printf("test_http_async_client response thread tid=%ld\n", hv_gettid()); if...

感谢回复,那个后端服务不知什么时候被停了。 现在我用libhv的http异步处理可以了,但用workflow的http_task还是会崩,不知道哪里还有冲突 ```c //这个可以 void RequestPbf(const std::string& path, const std::string& body, HttpContextPtr ctx) { auto& se = Singleton::Instance().seserver_; auto url = se::FormatStr("http://%s:%d%s", se.host_.c_str(), se.port_, path.c_str()); HttpRequestPtr req(new HttpRequest); req->method =...