On Wed, Nov 2, 2011 at 21:32, Jeff King <peff@xxxxxxxx> wrote: > Do we still need to care about data_received? > > My understanding was that the code was originally trying to do: > > 1. Call curl, maybe get some data. > > 2. If we got data, then ask curl against immediately for some data. > > 3. Otherwise, sleep 50ms and then ask curl again. Yes, that's exactly what it did. > But now that we are actually selecting on the proper descriptors, it > should now be safe to just do: > > 1. Call curl, maybe get some data. > > 2. Call select, which will wake immediately if curl is going to get > data. The only problem I can see is that curl_multi_fdset is not guaranteed to return any fds. So in theory it could be possible that we don't get fds, but we're actually reading stuff. In this case things would get slow, because we would sleep for 50ms after every read... However, I don't know if this is a case that actually comes up in the real world. Maybe Daniel has some advice on this. Best, Mika -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html