From 542318b11361210e84d25e653bee3442fccf6766 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Nov 2010 11:37:23 +0100 Subject: multi use: call multi_perform even on select() timeouts --- docs/examples/fopen.c | 9 +++------ docs/examples/multi-app.c | 8 ++------ docs/examples/multi-post.c | 1 - docs/examples/smtp-multi.c | 8 ++------ 4 files changed, 7 insertions(+), 19 deletions(-) (limited to 'docs') diff --git a/docs/examples/fopen.c b/docs/examples/fopen.c index 1310993bd..874d380d7 100644 --- a/docs/examples/fopen.c +++ b/docs/examples/fopen.c @@ -180,12 +180,9 @@ fill_buffer(URL_FILE *file,int want,int waittime) break; case 0: - break; - - default: - /* timeout or readable/writable sockets */ - curl_multi_perform(multi_handle, &file->still_running); - break; + /* timeout or readable/writable sockets */ + curl_multi_perform(multi_handle, &file->still_running); + break; } } while(file->still_running && (file->buffer_pos < want)); return 1; diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index 09b91b720..6ba131830 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -101,12 +101,8 @@ int main(int argc, char **argv) case -1: /* select error */ break; - case 0: - /* timeout, do something else */ - break; - default: - /* one or more of curl's file descriptors say there's data to read - or write */ + case 0: /* timeout */ + default: /* action */ curl_multi_perform(multi_handle, &still_running); break; } diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c index d2daf70a6..8b4f03e9e 100644 --- a/docs/examples/multi-post.c +++ b/docs/examples/multi-post.c @@ -112,7 +112,6 @@ int main(int argc, char *argv[]) /* select error */ break; case 0: - printf("timeout!\n"); default: /* timeout or readable/writable sockets */ printf("perform!\n"); diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c index 0a7aeebf9..239172ba9 100644 --- a/docs/examples/smtp-multi.c +++ b/docs/examples/smtp-multi.c @@ -174,12 +174,8 @@ int main(void) case -1: /* select error */ break; - case 0: - /* timeout, do something else */ - break; - default: - /* one or more of curl's file descriptors say there's data to read - or write */ + case 0: /* timeout */ + default: /* action */ curl_multi_perform(mcurl, &still_running); break; } -- cgit v1.2.3