}
*pwant_read = *pwant_write = FALSE;
}
+
+bool Curl_pollset_want_read(struct Curl_easy *data,
+ struct easy_pollset *ps,
+ curl_socket_t sock)
+{
+ unsigned int i;
+ (void)data;
+ for(i = 0; i < ps->num; ++i) {
+ if((ps->sockets[i] == sock) && (ps->actions[i] & CURL_POLL_IN))
+ return TRUE;
+ }
+ return FALSE;
+}
struct easy_pollset *ps, curl_socket_t sock,
bool *pwant_read, bool *pwant_write);
+/**
+ * Return TRUE if the pollset contains socket with CURL_POLL_IN.
+ */
+bool Curl_pollset_want_read(struct Curl_easy *data,
+ struct easy_pollset *ps,
+ curl_socket_t sock);
+
/**
* Types and macros used to keep the current easy handle in filter calls,
* allowing for nested invocations. See #10336.
break;
}
+
+ /* Waiting to receive with buffered input.
+ * Make transfer run again at next opportunity. */
+ if((Curl_pollset_want_read(data, ps, data->conn->sock[FIRSTSOCKET]) &&
+ Curl_conn_data_pending(data, FIRSTSOCKET)) ||
+ (Curl_pollset_want_read(data, ps, data->conn->sock[SECONDARYSOCKET]) &&
+ Curl_conn_data_pending(data, SECONDARYSOCKET))) {
+ CURL_TRC_M(data, "%s pollset[] has POLLIN, but there is still "
+ "buffered input to consume -> EXPIRE_RUN_NOW", caller);
+ Curl_expire(data, 0, EXPIRE_RUN_NOW);
+ }
+
switch(ps->num) {
case 0:
CURL_TRC_M(data, "%s pollset[], timeouts=%zu, paused %d/%d (r/w)",