Lines Matching defs:buf
141 free(wr->buf.base);
152 void NetServer::TakeDiffactionsByStatus(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf, NetServer* that)
157 free(buf->base);
170 if (buf->base[i] != 'Q') {
173 if (i + 1 < nread && buf->base[i + 1] == 'S') {
174 free(buf->base);
189 free(buf->base);
193 wr->buf = uv_buf_init(buf->base, nread);
195 if (uv_write(&wr->req, handle, &wr->buf, 1, AfterWrite) != 0) {
200 void NetServer::AfterRead(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf)
207 if (buf == nullptr) {
208 HILOG_ERROR("buf is null");
214 free(buf->base);
218 TakeDiffactionsByStatus(handle, nread, buf, that);
232 void NetServer::EchoAlloc(uv_handle_t* handle, size_t suggestedSize, uv_buf_t* buf)
239 if (buf == nullptr) {
240 HILOG_ERROR("buf is null");
244 buf->base = (char*)malloc(suggestedSize);
245 if (buf->base != nullptr) {
246 HILOG_ERROR("buf->base is null");
250 buf->len = suggestedSize;