提交 3aa13025 编写于 作者: S shenglian zhou

fix: udfd without copy buf again and udfd read eof not log with error

上级 190fbe84
...@@ -764,10 +764,8 @@ bool isUdfdUvMsgComplete(SUdfdUvConn *pipe) { ...@@ -764,10 +764,8 @@ bool isUdfdUvMsgComplete(SUdfdUvConn *pipe) {
} }
void udfdHandleRequest(SUdfdUvConn *conn) { void udfdHandleRequest(SUdfdUvConn *conn) {
char *inputBuf = taosMemoryMalloc(conn->inputLen); char *inputBuf = conn->inputBuf;
memcpy(inputBuf, conn->inputBuf, conn->inputLen);
int32_t inputLen = conn->inputLen; int32_t inputLen = conn->inputLen;
taosMemoryFree(conn->inputBuf);
uv_work_t *work = taosMemoryMalloc(sizeof(uv_work_t)); uv_work_t *work = taosMemoryMalloc(sizeof(uv_work_t));
SUvUdfWork *udfWork = taosMemoryMalloc(sizeof(SUvUdfWork)); SUvUdfWork *udfWork = taosMemoryMalloc(sizeof(SUvUdfWork));
...@@ -797,7 +795,7 @@ void udfdPipeCloseCb(uv_handle_t *pipe) { ...@@ -797,7 +795,7 @@ void udfdPipeCloseCb(uv_handle_t *pipe) {
} }
void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) {
fnDebug("udf read %zd bytes from client", nread); fnDebug("udfd read %zd bytes from client", nread);
if (nread == 0) return; if (nread == 0) return;
SUdfdUvConn *conn = client->data; SUdfdUvConn *conn = client->data;
...@@ -813,10 +811,10 @@ void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { ...@@ -813,10 +811,10 @@ void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) {
} }
if (nread < 0) { if (nread < 0) {
fnError("Receive error %s", uv_err_name(nread));
if (nread == UV_EOF) { if (nread == UV_EOF) {
// TODO check more when close fnError("udfd read EOF");
} else { } else {
fnError("Receive error %s", uv_err_name(nread));
} }
udfdUvHandleError(conn); udfdUvHandleError(conn);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册