View Issue Details

IDProjectCategoryView StatusLast Update
0001670libmicrohttpdexternal APIpublic2011-04-27 14:15
ReporterHawk Assigned ToChristian Grothoff Due Date
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 11: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 11:10

reporter   ~0004295

Yes this patch fixes this issue

Many thanks

Issue History

Date ModifiedUsernameFieldChange
2011-03-29 14:01HawkNew Issue
2011-03-30 10:54Christian GrothoffStatusnew => assigned
2011-03-30 10:54Christian GrothoffAssigned To => Christian Grothoff
2011-03-30 11:02Christian GrothoffNote Added: 0004294
2011-03-30 11:10HawkNote Added: 0004295
2011-03-31 08:57Christian GrothoffStatusassigned => resolved
2011-03-31 08:57Christian GrothoffResolutionopen => fixed
2011-04-27 14:15Christian GrothoffStatusresolved => closed
2013-05-06 10:52Christian GrothoffCategoryAPI => libmicrohttpd API
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API