View Issue Details

IDProjectCategoryView StatusLast Update
0001670libmicrohttpdexternal APIpublic2011-04-27 16:15
ReporterHawk Assigned ToChristian Grothoff  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.8 
Summary0001670: Error during select (4): `Invalid argument' in digest_auth_example
DescriptionHello,

I have patched digest_auth_example.c with :


--- digest_auth_example.c.ori 2011-03-29 15:46:23.000000000 +0200
+++ digest_auth_example.c 2011-03-29 15:47:29.000000000 +0200
@@ -126,6 +126,7 @@
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, PAGE,
+ MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
                        MHD_OPTION_DIGEST_AUTH_RANDOM, sizeof(rnd), rnd,
                        MHD_OPTION_NONCE_NC_SIZE, 300,
                        MHD_OPTION_END);


1) I start my new digest_auth_example
2) I start my browser and enter the url
3) I enter the password "testpass" and I have "Access granted"
4) I press "f5" to refresh the page and I have "Access granted"
5) I press "f5" to refresh the page and I have nothing. digest_auth_example display "Error during select (4): `Invalid argument'"

Regards
TagsNo tags attached.

Activities

Christian Grothoff

2011-03-30 13:02

manager   ~0004294

Looks like there was the possibility of tv_usec not begin initialized. I cannot exactly reproduce your bug (I at best get a valgrind warning, typically nothing, but I suspect that if tv_usec > 1000000 some OS may give this error), so could you see if this patch fixes the issue for you?

$ svn diff
Index: daemon.c
===================================================================
--- daemon.c (revision 14780)
+++ daemon.c (working copy)
@@ -581,6 +581,7 @@
            tv.tv_sec = 0;
          else
            tv.tv_sec = timeout - (now - con->last_activity);
+ tv.tv_usec = 0;
          tvp = &tv;
        }
       if ((con->state == MHD_CONNECTION_NORMAL_BODY_UNREADY) ||

Hawk

2011-03-30 13:10

reporter   ~0004295

Yes this patch fixes this issue

Many thanks

Issue History

Date Modified Username Field Change
2011-03-29 16:01 Hawk New Issue
2011-03-30 12:54 Christian Grothoff Status new => assigned
2011-03-30 12:54 Christian Grothoff Assigned To => Christian Grothoff
2011-03-30 13:02 Christian Grothoff Note Added: 0004294
2011-03-30 13:10 Hawk Note Added: 0004295
2011-03-31 10:57 Christian Grothoff Status assigned => resolved
2011-03-31 10:57 Christian Grothoff Resolution open => fixed
2011-04-27 16:15 Christian Grothoff Status resolved => closed
2013-05-06 12:52 Christian Grothoff Category API => libmicrohttpd API
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API