~ubuntu-branches/ubuntu/natty/curl/natty-proposed

« back to all changes in this revision

Viewing changes to tests/libtest/lib575.c

  • Committer: Bazaar Package Importer
  • Author(s): Ramakrishnan Muthukrishnan
  • Date: 2010-08-12 08:20:48 UTC
  • mto: (3.4.8 sid)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20100812082048-7g7fewx1ai2ozgsf
Tags: upstream-7.21.1
ImportĀ upstreamĀ versionĀ 7.21.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
        curl_multi_perform(mhandle, &still_running));
72
72
 
73
73
  while(still_running) {
74
 
    struct timeval timeout;
 
74
    static struct timeval timeout = /* 100 ms */ { 0, 100000L };
75
75
    int rc;
76
76
    fd_set fdread;
77
77
    fd_set fdwrite;
80
80
    FD_ZERO(&fdread);
81
81
    FD_ZERO(&fdwrite);
82
82
    FD_ZERO(&fdexcep);
83
 
    timeout.tv_sec = 3;
84
 
    timeout.tv_usec = 0;
85
83
 
86
84
    m = curl_multi_fdset(mhandle, &fdread, &fdwrite, &fdexcep, &max_fdset);
87
85
    if(m != CURLM_OK) {
88
86
      fprintf(stderr, "curl_multi_fdset() error\n");
89
87
      goto test_cleanup;
90
88
    }
 
89
    /* We call select(max_fdset + 1, ...), specially in case of (maxfd == -1),
 
90
     * we call select(0, ...), which is basically equal to sleep. */
91
91
    rc = select(max_fdset + 1, &fdread, &fdwrite, &fdexcep, &timeout);
92
92
    if(rc == -1) {
93
93
      fprintf(stderr, "select() error\n");
94
94
      goto test_cleanup;
95
95
    }
96
 
    else if(rc == 0) {
97
 
      fprintf(stderr, "select() timeout!\n");
98
 
      goto test_cleanup;
99
 
    }
100
96
    else {
101
97
      while(CURLM_CALL_MULTI_PERFORM ==
102
98
          curl_multi_perform(mhandle, &still_running));