- ev_init(&IO->recv_event, &gotio);
- curl_multi_assign(mhnd, fd, IO);
- }
- if (action == CURL_POLL_REMOVE) {
+ if (IO->SendBuf.fd != 0)
+ {
+ ev_io_stop(event_base, &IO->recv_event);
+ ev_io_stop(event_base, &IO->send_event);
+ }
+ IO->SendBuf.fd = fd;
+ ev_io_init(&IO->recv_event, &got_in, fd, EV_READ);
+ ev_io_init(&IO->send_event, &got_out, fd, EV_WRITE);
+ curl_multi_assign(mhnd, fd, IO);
+
+ }
+
+ switch (action)
+ {
+ case CURL_POLL_NONE:
+ syslog(LOG_ERR,"EVCURL: called first time to register this sockwatcker\n");
+ break;
+ case CURL_POLL_REMOVE: