Home | History | Annotate | Download | only in isc

Lines Matching refs:str

42 static int	copyvec(evStream *str, const struct iovec *iov, int iocnt);
43 static void consume(evStream *str, size_t bytes);
44 static void done(evContext opaqueCtx, evStream *str);
130 evStream *str = id.opaque;
134 str->timer = timer;
135 str->flags |= EV_STR_TIMEROK;
141 evStream *str = id.opaque;
145 str->flags &= ~EV_STR_TIMEROK;
205 copyvec(evStream *str, const struct iovec *iov, int iocnt) {
208 str->iovOrig = (struct iovec *)memget(sizeof(struct iovec) * iocnt);
209 if (str->iovOrig == NULL) {
213 str->ioTotal = 0;
215 str->iovOrig[i] = iov[i];
216 str->ioTotal += iov[i].iov_len;
218 str->iovOrigCount = iocnt;
219 str->iovCur = str->iovOrig;
220 str->iovCurCount = str->iovOrigCount;
221 str->ioDone = 0;
227 consume(evStream *str, size_t bytes) {
229 if (bytes < (size_t)str->iovCur->iov_len) {
230 str->iovCur->iov_len -= bytes;
231 str->iovCur->iov_base = (void *)
232 ((u_char *)str->iovCur->iov_base + bytes);
233 str->ioDone += bytes;
236 bytes -= str->iovCur->iov_len;
237 str->ioDone += str->iovCur->iov_len;
238 str->iovCur++;
239 str->iovCurCount--;
246 done(evContext opaqueCtx, evStream *str) {
250 str->prevDone = ctx->strLast;
251 ctx->strLast->nextDone = str;
252 ctx->strLast = str;
255 ctx->strDone = ctx->strLast = str;
257 evDeselectFD(opaqueCtx, str->file);
258 str->file.opaque = NULL;
265 evStream *str = uap;
270 bytes = writev(fd, str->iovCur, str->iovCurCount);
272 if ((str->flags & EV_STR_TIMEROK) != 0)
273 evTouchIdleTimer(opaqueCtx, str->timer);
274 consume(str, bytes);
277 str->ioDone = -1;
278 str->ioErrno = errno;
281 if (str->ioDone == -1 || str->ioDone == str->ioTotal)
282 done(opaqueCtx, str);
288 evStream *str = uap;
293 bytes = readv(fd, str->iovCur, str->iovCurCount);
295 if ((str->flags & EV_STR_TIMEROK) != 0)
296 evTouchIdleTimer(opaqueCtx, str->timer);
297 consume(str, bytes);
300 str->ioDone = 0;
303 str->ioDone = -1;
304 str->ioErrno = errno;
308 if (str->ioDone <= 0 || str->ioDone == str->ioTotal)
309 done(opaqueCtx, str);