Lines Matching refs:pollcb
312 /* Poll method pollcb.
315 static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb,
323 pollcb->fd = -1;
330 pollcb->pollset.ps = apr_palloc(p, size * sizeof(struct pollfd));
331 pollcb->copyset = apr_palloc(p, size * sizeof(apr_pollfd_t *));
337 static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb,
340 if (pollcb->nelts == pollcb->nalloc) {
345 pollcb->pollset.ps[pollcb->nelts].fd = descriptor->desc.s->socketdes;
349 pollcb->pollset.ps[pollcb->nelts].fd = descriptor->desc.f->filedes;
355 pollcb->pollset.ps[pollcb->nelts].events =
357 pollcb->copyset[pollcb->nelts] = descriptor;
358 pollcb->nelts++;
363 static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb,
368 for (i = 0; i < pollcb->nelts; i++) {
369 if (descriptor->desc.s == pollcb->copyset[i]->desc.s) {
372 apr_uint32_t old_nelts = pollcb->nelts;
373 pollcb->nelts--;
375 if (descriptor->desc.s == pollcb->copyset[i]->desc.s) {
376 pollcb->nelts--;
379 pollcb->pollset.ps[dst] = pollcb->pollset.ps[i];
380 pollcb->copyset[dst] = pollcb->copyset[i];
391 static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb,
402 if (pollcb->nelts == 0) {
412 ret = WSAPoll(pollcb->pollset.ps, pollcb->nelts, (int)timeout);
417 ret = poll(pollcb->pollset.ps, pollcb->nelts, timeout);
426 for (i = 0; i < pollcb->nelts; i++) {
427 if (pollcb->pollset.ps[i].revents != 0) {
428 apr_pollfd_t *pollfd = pollcb->copyset[i];
429 pollfd->rtnevents = get_revent(pollcb->pollset.ps[i].revents);