serving: codex
This commit is contained in:
xuyongfei 2020-09-19 09:56:13 +08:00
parent df4468dfd2
commit ffe03c3d06
2 changed files with 10 additions and 2 deletions

View File

@ -116,7 +116,7 @@ if (ENABLE_ACL)
${ACL_LIB_DIR}/lib64/libacl_retr.so ${ACL_LIB_DIR}/lib64/libacl_cblas.so
${ACL_LIB_DIR}/lib64/libacl_dvpp.so)
target_link_libraries(ms_serving ${ALC_LIB_SO})
target_link_libraries(ms_serving jpeg_turbo::jpeg)
target_link_libraries(ms_serving jpeg_turbo::jpeg securec)
else ()
target_link_libraries(ms_serving inference mindspore_gvar)
endif ()

View File

@ -52,7 +52,15 @@ Status GetPostMessage(struct evhttp_request *const req, std::string *const buf)
return status;
} else {
buf->resize(post_size);
memcpy_s(buf->data(), post_size, evbuffer_pullup(req->input_buffer, -1), post_size);
auto src_data = evbuffer_pullup(req->input_buffer, -1);
if (src_data == nullptr) {
ERROR_INFER_STATUS(status, FAILED, "get http message failed.");
return status;
}
if (memcpy_s(buf->data(), post_size, src_data, post_size) != EOK) {
ERROR_INFER_STATUS(status, FAILED, "copy http message failed.");
return status;
}
return status;
}
}