Skip to content

Commit a2f5e4a

Browse files
committed
debug
1 parent 86925f9 commit a2f5e4a

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/curl-utils.c

+14-10
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,15 @@ static void uv__poll_cb(uv_poll_t *handle, int status, int events) {
166166
CHECK_NOT_NULL(qrt);
167167

168168
int flags = 0;
169-
if (events & UV_READABLE) {
170-
flags |= CURL_CSELECT_IN;
171-
}
172-
if (events & UV_WRITABLE) {
173-
flags |= CURL_CSELECT_OUT;
169+
if (status != 0) {
170+
flags |= CURL_CSELECT_ERR;
171+
} else {
172+
if (events & UV_READABLE) {
173+
flags |= CURL_CSELECT_IN;
174+
}
175+
if (events & UV_WRITABLE) {
176+
flags |= CURL_CSELECT_OUT;
177+
}
174178
}
175179

176180
int running_handles;
@@ -198,17 +202,17 @@ static int curl__handle_socket(CURL *easy, curl_socket_t s, int action, void *us
198202
if (r != 0) {
199203
fprintf(stderr, "uv_poll_init_socket error: %d socket: %d\n", r, s);
200204
fflush(stderr);
201-
CHECK_EQ(r, 0);
205+
//CHECK_EQ(r, 0);
206+
return -1;
202207
}
203208
poll_ctx->qrt = qrt;
204209
poll_ctx->sockfd = s;
205210
poll_ctx->poll.data = poll_ctx;
211+
curl_multi_assign(qrt->curl_ctx.curlm_h, s, (void *) poll_ctx);
206212
} else {
207213
poll_ctx = socketp;
208214
}
209215

210-
curl_multi_assign(qrt->curl_ctx.curlm_h, s, (void *) poll_ctx);
211-
212216
int events = 0;
213217
if (action != CURL_POLL_IN) {
214218
events |= UV_WRITABLE;
@@ -228,8 +232,8 @@ static int curl__handle_socket(CURL *easy, curl_socket_t s, int action, void *us
228232
uv_close((uv_handle_t *) &poll_ctx->poll, uv__poll_close_cb);
229233
}
230234
break;
231-
default:
232-
abort();
235+
case CURL_POLL_NONE:
236+
break;
233237
}
234238

235239
return 0;

0 commit comments

Comments
 (0)