cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3392945 ] curl_easy_perform hanged

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 17 Aug 2011 15:13:18 +0200

Bugs item #3392945, was opened at 2011-08-17 12:27
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3392945&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: hang
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: qzy (awlike)
Assigned to: Daniel Stenberg (bagder)
Summary: curl_easy_perform hanged

Initial Comment:
I'm using libcurl 7.21.7 under Symbian S60 V5 with emulator. After building the library, i test the code from example 'httpcustomheader.c' and it hanged at curl_easy_perform.

I debugged it and found the problem is function Curl_socket_ready in file 'select.c'. The app executed the following code:

do {
    if(timeout_ms > 0) {
      pending_tv.tv_sec = pending_ms / 1000;
      pending_tv.tv_usec = (pending_ms % 1000) * 1000;
    }
    else if(!timeout_ms) {
      pending_tv.tv_sec = 0;
      pending_tv.tv_usec = 0;
    }
    r = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, ptimeout);
    if(r != -1)
      break;
    error = SOCKERRNO;
    if(error && error_not_EINTR)
      break;
    if(timeout_ms > 0) {
      pending_ms = timeout_ms - elapsed_ms;
      if(pending_ms <= 0)
        break;
    }
  } while(r == -1);

Unfortunately, the app run into a dead loop. Variable timeout_ms is 0 and function select() returnd -1.
Later i tested example 'htmltitle.c', it has the same problem.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2011-08-17 15:13

Message:
So, select() returned -1 and 'errno' was zero? Is that even supposed to
happen? Is there anything that needs to be done to allow us to get the
actual error?

----------------------------------------------------------------------

Comment By: qzy (awlike)
Date: 2011-08-17 14:51

Message:
Hi. error was zero. And

function connect_host() gave message:
* timeout on name lookup is notsupported
* About to connect() to localhost port 80 (#0)
* Trying 127.0.0.1.. * connected
* Connected to localhost (127.0.0.1) port 80 (#0)

function Curl_do() gave message:
> GET / HTTP/1.1
Host: localhost
Accept: */*

Sorry, i'm not familiar with socket operation.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2011-08-17 13:45

Message:
Have you figured out why select() returns an error in the first place?

For this to loop, 'error' would have to be zero or EINTR after SOCKERRNO
is called. Can you check which it is and why?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3392945&group_id=976
Received on 2011-08-17

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET