cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: multi_runsingle referencing freed connection

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Sat, 17 Feb 2007 08:40:06 -0600

> With this patch below applied, I managed to run your proxy
> for quite some time without crashing

Great!

> Let me know if you find any flaws with this.

Yes, it looks like it's working now, I just wasn't sure if there might
be some side-effect with this change that I hadn't considered.

I saw something else that looks a little odd, but I'm not sure if it is
a potential problem or maybe I'm just not understanding it...

On line 1161 of multi.c :
====
      if(easy->result) {
        /* The transfer phase returned error, we mark the connection to get
         * closed to prevent being re-used. This is becasue we can't
         * possibly know if the connection is in a good shape or not now. */
        easy->easy_conn->bits.close = TRUE;
====

And then on line 2059 of url.c
====
    if (data->state.is_in_pipeline && check->bits.close) {
        /* Don't pick a connection that is going to be closed */
        infof(data, "Connection #%ld has been marked for close, can't reuse\n",
              check->connectindex);
        continue;
    }
====

I don't don't understand the "is_in_pipeline" check here, if
multi.c flagged the connection as bad, then it shouldn't get
re-used, regardless if it is pipelined or not?

(off topic)
I also hit a small snag building the latest CVS, "ares/setup_once.h"
now uses errno, so I needed to add #include <errno.h>
inside the #ifdef on line 184.

 - Jeff
Received on 2007-02-17