Lines Matching defs:buf
142 free(wr->buf.base);
153 void NetServer::TakeDiffactionsByStatus(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf, NetServer* that)
158 free(buf->base);
171 if (buf->base[i] != 'Q') {
174 if (i + 1 < nread && buf->base[i + 1] == 'S') {
175 free(buf->base);
190 free(buf->base);
194 wr->buf = uv_buf_init(buf->base, nread);
196 if (uv_write(&wr->req, handle, &wr->buf, 1, AfterWrite) != 0) {
201 void NetServer::AfterRead(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf)
208 if (buf == nullptr) {
209 HILOG_ERROR("buf is null");
215 free(buf->base);
219 TakeDiffactionsByStatus(handle, nread, buf, that);
233 void NetServer::EchoAlloc(uv_handle_t* handle, size_t suggestedSize, uv_buf_t* buf)
240 if (buf == nullptr) {
241 HILOG_ERROR("buf is null");
250 buf->base = (char*)malloc(suggestedSize);
251 if (buf->base != nullptr) {
252 HILOG_ERROR("buf->base is null");
256 buf->len = suggestedSize;