buffer_iocp.c revision 1.1.1.1.10.2 1 1.1.1.1.10.2 yamt /* $NetBSD: buffer_iocp.c,v 1.1.1.1.10.2 2014/05/22 15:48:09 yamt Exp $ */
2 1.1.1.1.10.2 yamt /*
3 1.1.1.1.10.2 yamt * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
4 1.1.1.1.10.2 yamt *
5 1.1.1.1.10.2 yamt * Redistribution and use in source and binary forms, with or without
6 1.1.1.1.10.2 yamt * modification, are permitted provided that the following conditions
7 1.1.1.1.10.2 yamt * are met:
8 1.1.1.1.10.2 yamt * 1. Redistributions of source code must retain the above copyright
9 1.1.1.1.10.2 yamt * notice, this list of conditions and the following disclaimer.
10 1.1.1.1.10.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
11 1.1.1.1.10.2 yamt * notice, this list of conditions and the following disclaimer in the
12 1.1.1.1.10.2 yamt * documentation and/or other materials provided with the distribution.
13 1.1.1.1.10.2 yamt * 3. The name of the author may not be used to endorse or promote products
14 1.1.1.1.10.2 yamt * derived from this software without specific prior written permission.
15 1.1.1.1.10.2 yamt *
16 1.1.1.1.10.2 yamt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1.1.1.10.2 yamt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1.1.1.10.2 yamt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1.1.1.10.2 yamt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1.1.1.10.2 yamt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.1.1.1.10.2 yamt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.1.1.1.10.2 yamt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.1.1.1.10.2 yamt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.1.1.1.10.2 yamt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.1.1.1.10.2 yamt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1.1.1.10.2 yamt */
27 1.1.1.1.10.2 yamt
28 1.1.1.1.10.2 yamt /**
29 1.1.1.1.10.2 yamt @file buffer_iocp.c
30 1.1.1.1.10.2 yamt
31 1.1.1.1.10.2 yamt This module implements overlapped read and write functions for evbuffer
32 1.1.1.1.10.2 yamt objects on Windows.
33 1.1.1.1.10.2 yamt */
34 1.1.1.1.10.2 yamt
35 1.1.1.1.10.2 yamt #include "event2/buffer.h"
36 1.1.1.1.10.2 yamt #include "event2/buffer_compat.h"
37 1.1.1.1.10.2 yamt #include "event2/util.h"
38 1.1.1.1.10.2 yamt #include "event2/thread.h"
39 1.1.1.1.10.2 yamt #include "event2/event-config.h"
40 1.1.1.1.10.2 yamt #include <sys/cdefs.h>
41 1.1.1.1.10.2 yamt __RCSID("$NetBSD: buffer_iocp.c,v 1.1.1.1.10.2 2014/05/22 15:48:09 yamt Exp $");
42 1.1.1.1.10.2 yamt #include "util-internal.h"
43 1.1.1.1.10.2 yamt #include "evthread-internal.h"
44 1.1.1.1.10.2 yamt #include "evbuffer-internal.h"
45 1.1.1.1.10.2 yamt #include "iocp-internal.h"
46 1.1.1.1.10.2 yamt #include "mm-internal.h"
47 1.1.1.1.10.2 yamt
48 1.1.1.1.10.2 yamt #include <winsock2.h>
49 1.1.1.1.10.2 yamt #include <windows.h>
50 1.1.1.1.10.2 yamt #include <stdio.h>
51 1.1.1.1.10.2 yamt
52 1.1.1.1.10.2 yamt #define MAX_WSABUFS 16
53 1.1.1.1.10.2 yamt
54 1.1.1.1.10.2 yamt /** An evbuffer that can handle overlapped IO. */
55 1.1.1.1.10.2 yamt struct evbuffer_overlapped {
56 1.1.1.1.10.2 yamt struct evbuffer buffer;
57 1.1.1.1.10.2 yamt /** The socket that we're doing overlapped IO on. */
58 1.1.1.1.10.2 yamt evutil_socket_t fd;
59 1.1.1.1.10.2 yamt
60 1.1.1.1.10.2 yamt /** pending I/O type */
61 1.1.1.1.10.2 yamt unsigned read_in_progress : 1;
62 1.1.1.1.10.2 yamt unsigned write_in_progress : 1;
63 1.1.1.1.10.2 yamt
64 1.1.1.1.10.2 yamt /** The first pinned chain in the buffer. */
65 1.1.1.1.10.2 yamt struct evbuffer_chain *first_pinned;
66 1.1.1.1.10.2 yamt
67 1.1.1.1.10.2 yamt /** How many chains are pinned; how many of the fields in buffers
68 1.1.1.1.10.2 yamt * are we using. */
69 1.1.1.1.10.2 yamt int n_buffers;
70 1.1.1.1.10.2 yamt WSABUF buffers[MAX_WSABUFS];
71 1.1.1.1.10.2 yamt };
72 1.1.1.1.10.2 yamt
73 1.1.1.1.10.2 yamt /** Given an evbuffer, return the correponding evbuffer structure, or NULL if
74 1.1.1.1.10.2 yamt * the evbuffer isn't overlapped. */
75 1.1.1.1.10.2 yamt static inline struct evbuffer_overlapped *
76 1.1.1.1.10.2 yamt upcast_evbuffer(struct evbuffer *buf)
77 1.1.1.1.10.2 yamt {
78 1.1.1.1.10.2 yamt if (!buf || !buf->is_overlapped)
79 1.1.1.1.10.2 yamt return NULL;
80 1.1.1.1.10.2 yamt return EVUTIL_UPCAST(buf, struct evbuffer_overlapped, buffer);
81 1.1.1.1.10.2 yamt }
82 1.1.1.1.10.2 yamt
83 1.1.1.1.10.2 yamt /** Unpin all the chains noted as pinned in 'eo'. */
84 1.1.1.1.10.2 yamt static void
85 1.1.1.1.10.2 yamt pin_release(struct evbuffer_overlapped *eo, unsigned flag)
86 1.1.1.1.10.2 yamt {
87 1.1.1.1.10.2 yamt int i;
88 1.1.1.1.10.2 yamt struct evbuffer_chain *next, *chain = eo->first_pinned;
89 1.1.1.1.10.2 yamt
90 1.1.1.1.10.2 yamt for (i = 0; i < eo->n_buffers; ++i) {
91 1.1.1.1.10.2 yamt EVUTIL_ASSERT(chain);
92 1.1.1.1.10.2 yamt next = chain->next;
93 1.1.1.1.10.2 yamt _evbuffer_chain_unpin(chain, flag);
94 1.1.1.1.10.2 yamt chain = next;
95 1.1.1.1.10.2 yamt }
96 1.1.1.1.10.2 yamt }
97 1.1.1.1.10.2 yamt
98 1.1.1.1.10.2 yamt void
99 1.1.1.1.10.2 yamt evbuffer_commit_read(struct evbuffer *evbuf, ev_ssize_t nBytes)
100 1.1.1.1.10.2 yamt {
101 1.1.1.1.10.2 yamt struct evbuffer_overlapped *buf = upcast_evbuffer(evbuf);
102 1.1.1.1.10.2 yamt struct evbuffer_chain **chainp;
103 1.1.1.1.10.2 yamt size_t remaining, len;
104 1.1.1.1.10.2 yamt unsigned i;
105 1.1.1.1.10.2 yamt
106 1.1.1.1.10.2 yamt EVBUFFER_LOCK(evbuf);
107 1.1.1.1.10.2 yamt EVUTIL_ASSERT(buf->read_in_progress && !buf->write_in_progress);
108 1.1.1.1.10.2 yamt EVUTIL_ASSERT(nBytes >= 0); /* XXXX Can this be false? */
109 1.1.1.1.10.2 yamt
110 1.1.1.1.10.2 yamt evbuffer_unfreeze(evbuf, 0);
111 1.1.1.1.10.2 yamt
112 1.1.1.1.10.2 yamt chainp = evbuf->last_with_datap;
113 1.1.1.1.10.2 yamt if (!((*chainp)->flags & EVBUFFER_MEM_PINNED_R))
114 1.1.1.1.10.2 yamt chainp = &(*chainp)->next;
115 1.1.1.1.10.2 yamt remaining = nBytes;
116 1.1.1.1.10.2 yamt for (i = 0; remaining > 0 && i < (unsigned)buf->n_buffers; ++i) {
117 1.1.1.1.10.2 yamt EVUTIL_ASSERT(*chainp);
118 1.1.1.1.10.2 yamt len = buf->buffers[i].len;
119 1.1.1.1.10.2 yamt if (remaining < len)
120 1.1.1.1.10.2 yamt len = remaining;
121 1.1.1.1.10.2 yamt (*chainp)->off += len;
122 1.1.1.1.10.2 yamt evbuf->last_with_datap = chainp;
123 1.1.1.1.10.2 yamt remaining -= len;
124 1.1.1.1.10.2 yamt chainp = &(*chainp)->next;
125 1.1.1.1.10.2 yamt }
126 1.1.1.1.10.2 yamt
127 1.1.1.1.10.2 yamt pin_release(buf, EVBUFFER_MEM_PINNED_R);
128 1.1.1.1.10.2 yamt
129 1.1.1.1.10.2 yamt buf->read_in_progress = 0;
130 1.1.1.1.10.2 yamt
131 1.1.1.1.10.2 yamt evbuf->total_len += nBytes;
132 1.1.1.1.10.2 yamt evbuf->n_add_for_cb += nBytes;
133 1.1.1.1.10.2 yamt
134 1.1.1.1.10.2 yamt evbuffer_invoke_callbacks(evbuf);
135 1.1.1.1.10.2 yamt
136 1.1.1.1.10.2 yamt _evbuffer_decref_and_unlock(evbuf);
137 1.1.1.1.10.2 yamt }
138 1.1.1.1.10.2 yamt
139 1.1.1.1.10.2 yamt void
140 1.1.1.1.10.2 yamt evbuffer_commit_write(struct evbuffer *evbuf, ev_ssize_t nBytes)
141 1.1.1.1.10.2 yamt {
142 1.1.1.1.10.2 yamt struct evbuffer_overlapped *buf = upcast_evbuffer(evbuf);
143 1.1.1.1.10.2 yamt
144 1.1.1.1.10.2 yamt EVBUFFER_LOCK(evbuf);
145 1.1.1.1.10.2 yamt EVUTIL_ASSERT(buf->write_in_progress && !buf->read_in_progress);
146 1.1.1.1.10.2 yamt evbuffer_unfreeze(evbuf, 1);
147 1.1.1.1.10.2 yamt evbuffer_drain(evbuf, nBytes);
148 1.1.1.1.10.2 yamt pin_release(buf,EVBUFFER_MEM_PINNED_W);
149 1.1.1.1.10.2 yamt buf->write_in_progress = 0;
150 1.1.1.1.10.2 yamt _evbuffer_decref_and_unlock(evbuf);
151 1.1.1.1.10.2 yamt }
152 1.1.1.1.10.2 yamt
153 1.1.1.1.10.2 yamt struct evbuffer *
154 1.1.1.1.10.2 yamt evbuffer_overlapped_new(evutil_socket_t fd)
155 1.1.1.1.10.2 yamt {
156 1.1.1.1.10.2 yamt struct evbuffer_overlapped *evo;
157 1.1.1.1.10.2 yamt
158 1.1.1.1.10.2 yamt evo = mm_calloc(1, sizeof(struct evbuffer_overlapped));
159 1.1.1.1.10.2 yamt if (!evo)
160 1.1.1.1.10.2 yamt return NULL;
161 1.1.1.1.10.2 yamt
162 1.1.1.1.10.2 yamt TAILQ_INIT(&evo->buffer.callbacks);
163 1.1.1.1.10.2 yamt evo->buffer.refcnt = 1;
164 1.1.1.1.10.2 yamt evo->buffer.last_with_datap = &evo->buffer.first;
165 1.1.1.1.10.2 yamt
166 1.1.1.1.10.2 yamt evo->buffer.is_overlapped = 1;
167 1.1.1.1.10.2 yamt evo->fd = fd;
168 1.1.1.1.10.2 yamt
169 1.1.1.1.10.2 yamt return &evo->buffer;
170 1.1.1.1.10.2 yamt }
171 1.1.1.1.10.2 yamt
172 1.1.1.1.10.2 yamt int
173 1.1.1.1.10.2 yamt evbuffer_launch_write(struct evbuffer *buf, ev_ssize_t at_most,
174 1.1.1.1.10.2 yamt struct event_overlapped *ol)
175 1.1.1.1.10.2 yamt {
176 1.1.1.1.10.2 yamt struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
177 1.1.1.1.10.2 yamt int r = -1;
178 1.1.1.1.10.2 yamt int i;
179 1.1.1.1.10.2 yamt struct evbuffer_chain *chain;
180 1.1.1.1.10.2 yamt DWORD bytesSent;
181 1.1.1.1.10.2 yamt
182 1.1.1.1.10.2 yamt if (!buf) {
183 1.1.1.1.10.2 yamt /* No buffer, or it isn't overlapped */
184 1.1.1.1.10.2 yamt return -1;
185 1.1.1.1.10.2 yamt }
186 1.1.1.1.10.2 yamt
187 1.1.1.1.10.2 yamt EVBUFFER_LOCK(buf);
188 1.1.1.1.10.2 yamt EVUTIL_ASSERT(!buf_o->read_in_progress);
189 1.1.1.1.10.2 yamt if (buf->freeze_start || buf_o->write_in_progress)
190 1.1.1.1.10.2 yamt goto done;
191 1.1.1.1.10.2 yamt if (!buf->total_len) {
192 1.1.1.1.10.2 yamt /* Nothing to write */
193 1.1.1.1.10.2 yamt r = 0;
194 1.1.1.1.10.2 yamt goto done;
195 1.1.1.1.10.2 yamt } else if (at_most < 0 || (size_t)at_most > buf->total_len) {
196 1.1.1.1.10.2 yamt at_most = buf->total_len;
197 1.1.1.1.10.2 yamt }
198 1.1.1.1.10.2 yamt evbuffer_freeze(buf, 1);
199 1.1.1.1.10.2 yamt
200 1.1.1.1.10.2 yamt buf_o->first_pinned = NULL;
201 1.1.1.1.10.2 yamt buf_o->n_buffers = 0;
202 1.1.1.1.10.2 yamt memset(buf_o->buffers, 0, sizeof(buf_o->buffers));
203 1.1.1.1.10.2 yamt
204 1.1.1.1.10.2 yamt chain = buf_o->first_pinned = buf->first;
205 1.1.1.1.10.2 yamt
206 1.1.1.1.10.2 yamt for (i=0; i < MAX_WSABUFS && chain; ++i, chain=chain->next) {
207 1.1.1.1.10.2 yamt WSABUF *b = &buf_o->buffers[i];
208 1.1.1.1.10.2 yamt b->buf = (char*)( chain->buffer + chain->misalign );
209 1.1.1.1.10.2 yamt _evbuffer_chain_pin(chain, EVBUFFER_MEM_PINNED_W);
210 1.1.1.1.10.2 yamt
211 1.1.1.1.10.2 yamt if ((size_t)at_most > chain->off) {
212 1.1.1.1.10.2 yamt /* XXXX Cast is safe for now, since win32 has no
213 1.1.1.1.10.2 yamt mmaped chains. But later, we need to have this
214 1.1.1.1.10.2 yamt add more WSAbufs if chain->off is greater than
215 1.1.1.1.10.2 yamt ULONG_MAX */
216 1.1.1.1.10.2 yamt b->len = (unsigned long)chain->off;
217 1.1.1.1.10.2 yamt at_most -= chain->off;
218 1.1.1.1.10.2 yamt } else {
219 1.1.1.1.10.2 yamt b->len = (unsigned long)at_most;
220 1.1.1.1.10.2 yamt ++i;
221 1.1.1.1.10.2 yamt break;
222 1.1.1.1.10.2 yamt }
223 1.1.1.1.10.2 yamt }
224 1.1.1.1.10.2 yamt
225 1.1.1.1.10.2 yamt buf_o->n_buffers = i;
226 1.1.1.1.10.2 yamt _evbuffer_incref(buf);
227 1.1.1.1.10.2 yamt if (WSASend(buf_o->fd, buf_o->buffers, i, &bytesSent, 0,
228 1.1.1.1.10.2 yamt &ol->overlapped, NULL)) {
229 1.1.1.1.10.2 yamt int error = WSAGetLastError();
230 1.1.1.1.10.2 yamt if (error != WSA_IO_PENDING) {
231 1.1.1.1.10.2 yamt /* An actual error. */
232 1.1.1.1.10.2 yamt pin_release(buf_o, EVBUFFER_MEM_PINNED_W);
233 1.1.1.1.10.2 yamt evbuffer_unfreeze(buf, 1);
234 1.1.1.1.10.2 yamt evbuffer_free(buf); /* decref */
235 1.1.1.1.10.2 yamt goto done;
236 1.1.1.1.10.2 yamt }
237 1.1.1.1.10.2 yamt }
238 1.1.1.1.10.2 yamt
239 1.1.1.1.10.2 yamt buf_o->write_in_progress = 1;
240 1.1.1.1.10.2 yamt r = 0;
241 1.1.1.1.10.2 yamt done:
242 1.1.1.1.10.2 yamt EVBUFFER_UNLOCK(buf);
243 1.1.1.1.10.2 yamt return r;
244 1.1.1.1.10.2 yamt }
245 1.1.1.1.10.2 yamt
246 1.1.1.1.10.2 yamt int
247 1.1.1.1.10.2 yamt evbuffer_launch_read(struct evbuffer *buf, size_t at_most,
248 1.1.1.1.10.2 yamt struct event_overlapped *ol)
249 1.1.1.1.10.2 yamt {
250 1.1.1.1.10.2 yamt struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
251 1.1.1.1.10.2 yamt int r = -1, i;
252 1.1.1.1.10.2 yamt int nvecs;
253 1.1.1.1.10.2 yamt int npin=0;
254 1.1.1.1.10.2 yamt struct evbuffer_chain *chain=NULL, **chainp;
255 1.1.1.1.10.2 yamt DWORD bytesRead;
256 1.1.1.1.10.2 yamt DWORD flags = 0;
257 1.1.1.1.10.2 yamt struct evbuffer_iovec vecs[MAX_WSABUFS];
258 1.1.1.1.10.2 yamt
259 1.1.1.1.10.2 yamt if (!buf_o)
260 1.1.1.1.10.2 yamt return -1;
261 1.1.1.1.10.2 yamt EVBUFFER_LOCK(buf);
262 1.1.1.1.10.2 yamt EVUTIL_ASSERT(!buf_o->write_in_progress);
263 1.1.1.1.10.2 yamt if (buf->freeze_end || buf_o->read_in_progress)
264 1.1.1.1.10.2 yamt goto done;
265 1.1.1.1.10.2 yamt
266 1.1.1.1.10.2 yamt buf_o->first_pinned = NULL;
267 1.1.1.1.10.2 yamt buf_o->n_buffers = 0;
268 1.1.1.1.10.2 yamt memset(buf_o->buffers, 0, sizeof(buf_o->buffers));
269 1.1.1.1.10.2 yamt
270 1.1.1.1.10.2 yamt if (_evbuffer_expand_fast(buf, at_most, MAX_WSABUFS) == -1)
271 1.1.1.1.10.2 yamt goto done;
272 1.1.1.1.10.2 yamt evbuffer_freeze(buf, 0);
273 1.1.1.1.10.2 yamt
274 1.1.1.1.10.2 yamt nvecs = _evbuffer_read_setup_vecs(buf, at_most,
275 1.1.1.1.10.2 yamt vecs, MAX_WSABUFS, &chainp, 1);
276 1.1.1.1.10.2 yamt for (i=0;i<nvecs;++i) {
277 1.1.1.1.10.2 yamt WSABUF_FROM_EVBUFFER_IOV(
278 1.1.1.1.10.2 yamt &buf_o->buffers[i],
279 1.1.1.1.10.2 yamt &vecs[i]);
280 1.1.1.1.10.2 yamt }
281 1.1.1.1.10.2 yamt
282 1.1.1.1.10.2 yamt buf_o->n_buffers = nvecs;
283 1.1.1.1.10.2 yamt buf_o->first_pinned = chain = *chainp;
284 1.1.1.1.10.2 yamt
285 1.1.1.1.10.2 yamt npin=0;
286 1.1.1.1.10.2 yamt for ( ; chain; chain = chain->next) {
287 1.1.1.1.10.2 yamt _evbuffer_chain_pin(chain, EVBUFFER_MEM_PINNED_R);
288 1.1.1.1.10.2 yamt ++npin;
289 1.1.1.1.10.2 yamt }
290 1.1.1.1.10.2 yamt EVUTIL_ASSERT(npin == nvecs);
291 1.1.1.1.10.2 yamt
292 1.1.1.1.10.2 yamt _evbuffer_incref(buf);
293 1.1.1.1.10.2 yamt if (WSARecv(buf_o->fd, buf_o->buffers, nvecs, &bytesRead, &flags,
294 1.1.1.1.10.2 yamt &ol->overlapped, NULL)) {
295 1.1.1.1.10.2 yamt int error = WSAGetLastError();
296 1.1.1.1.10.2 yamt if (error != WSA_IO_PENDING) {
297 1.1.1.1.10.2 yamt /* An actual error. */
298 1.1.1.1.10.2 yamt pin_release(buf_o, EVBUFFER_MEM_PINNED_R);
299 1.1.1.1.10.2 yamt evbuffer_unfreeze(buf, 0);
300 1.1.1.1.10.2 yamt evbuffer_free(buf); /* decref */
301 1.1.1.1.10.2 yamt goto done;
302 1.1.1.1.10.2 yamt }
303 1.1.1.1.10.2 yamt }
304 1.1.1.1.10.2 yamt
305 1.1.1.1.10.2 yamt buf_o->read_in_progress = 1;
306 1.1.1.1.10.2 yamt r = 0;
307 1.1.1.1.10.2 yamt done:
308 1.1.1.1.10.2 yamt EVBUFFER_UNLOCK(buf);
309 1.1.1.1.10.2 yamt return r;
310 1.1.1.1.10.2 yamt }
311 1.1.1.1.10.2 yamt
312 1.1.1.1.10.2 yamt evutil_socket_t
313 1.1.1.1.10.2 yamt _evbuffer_overlapped_get_fd(struct evbuffer *buf)
314 1.1.1.1.10.2 yamt {
315 1.1.1.1.10.2 yamt struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
316 1.1.1.1.10.2 yamt return buf_o ? buf_o->fd : -1;
317 1.1.1.1.10.2 yamt }
318 1.1.1.1.10.2 yamt
319 1.1.1.1.10.2 yamt void
320 1.1.1.1.10.2 yamt _evbuffer_overlapped_set_fd(struct evbuffer *buf, evutil_socket_t fd)
321 1.1.1.1.10.2 yamt {
322 1.1.1.1.10.2 yamt struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
323 1.1.1.1.10.2 yamt EVBUFFER_LOCK(buf);
324 1.1.1.1.10.2 yamt /* XXX is this right?, should it cancel current I/O operations? */
325 1.1.1.1.10.2 yamt if (buf_o)
326 1.1.1.1.10.2 yamt buf_o->fd = fd;
327 1.1.1.1.10.2 yamt EVBUFFER_UNLOCK(buf);
328 1.1.1.1.10.2 yamt }
329