I suggest the following change to event_cb in asiohiper.cpp. This is
somewhat similar to what we do in our client.


static void event_cb(GlobalInfo *g, boost::asio::ip::tcp::socket
*tcp_socket,
                     int action)
{
  fprintf(MSG_OUT, "\nevent_cb: action=%d", action);

  CURLMcode rc;
  rc = curl_multi_socket_action(g->multi, tcp_socket->native_handle(),
action,
                                &g->still_running);

  mcode_or_die("event_cb: curl_multi_socket_action", rc);

  check_multi_info(g);

  if (g->still_running > 0)
  {
      tcp_socket->async_read_some(boost::asio::null_buffers(),
          boost::bind(&event_cb, g, tcp_socket, action));
  }
  else
  {
    fprintf(MSG_OUT, "\nlast transfer done, kill timeout");
    timer.cancel();
  }
}


On Fri, Apr 24, 2015 at 12:23 PM, Daniel Stenberg <[email protected]> wrote:

> On Fri, 24 Apr 2015, Daniel Hardman wrote:
>
>  I figured out the root cause of the misbehavior I was observing.
>>
>> In short, neither curl nor asio has a bug, but the sample integration code
>> that I worked from did.
>>
>
> Great, that sounds like a pretty good leap forward!
>
>  Until I post a patch for the sample, I recommend that we put a disclaimer
>> on asiohiper.cpp.
>>
>
> I think I would rather just wait a while and see if you (or anyone else)
> can come up with a suitable fix and then apply that. And if weeks pass
> without a fix, we simply remove the example instead. It seems
> contraproductive to offer an example that doesn't work - I don't think a
> disclaimer helps much.
>
> --
>
>  / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html




-- 
Brian Chrisman
Gobbler - Software Architect
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to