View Issue Details

IDProjectCategoryView StatusLast Update
0002093libmicrohttpdotherpublic2012-01-21 16:15
Reporteraigoshin Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Platformx86OSsuseOS Version11.3
Product Version0.9.17 
Summary0002093: MHD_OPTION_SOCK_ADDR problem
Descriptionwhen i use "MHD_OPTION_SOCK_ADDR, srv" as parameter of MHD_start_daemon() binding to the specified address is successful.

when i use "MHD_OPTION_SOCK_ADDR, srv, NULL" as part of MHD_OPTION_ARRAY binding to the specified address is unsuccessful (it actually binds to INADDR_ANY).
Steps To Reproducestruct sockaddr_in srv_in;


working
-------

    struct MHD_OptionItem ops[] = { { MHD_OPTION_THREAD_POOL_SIZE, max_threads, NULL },
        { MHD_OPTION_THREAD_STACK_SIZE, THR_STACK_SIZE, NULL },
        { MHD_OPTION_CONNECTION_TIMEOUT, 30, NULL },
        { MHD_OPTION_NOTIFY_COMPLETED, (int) &RequestCompleted, NULL },
        { MHD_OPTION_END, 0, NULL }
};
                                                                              
HttpDaemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY|MHD_USE_POLL, port, &AcceptPolicy, NULL, &AccessHandler, &cred, MHD_OPTION_SOCK_ADDR, &srv_in, MHD_OPTION_ARRAY, ops, MHD_OPTION_END);
============================================================================

not working
-----------

    struct MHD_OptionItem ops[] = {
        { MHD_OPTION_SOCK_ADDR, (int) &srv_in, NULL },
        { MHD_OPTION_THREAD_POOL_SIZE, max_threads, NULL },
        { MHD_OPTION_THREAD_STACK_SIZE, THR_STACK_SIZE, NULL },
        { MHD_OPTION_CONNECTION_TIMEOUT, 30, NULL },
        { MHD_OPTION_NOTIFY_COMPLETED, (int) &RequestCompleted, NULL },
        { MHD_OPTION_END, 0, NULL }
    };

HttpDaemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY|MHD_USE_POLL, port, &AcceptPolicy, NULL, &AccessHandler, &cred, MHD_OPTION_ARRAY, ops, MHD_OPTION_END);
TagsNo tags attached.

Activities

aigoshin

2012-01-21 15:43

reporter   ~0005323

must be

 { MHD_OPTION_SOCK_ADDR, 0, &srv_in },

aigoshin

2012-01-21 15:43

reporter   ~0005324

closed

aigoshin

2012-01-21 15:45

reporter   ~0005325

closed

Christian Grothoff

2012-01-21 16:15

manager   ~0005327

reporter resolved, I guess he figured it out.

Issue History

Date Modified Username Field Change
2012-01-21 15:02 aigoshin New Issue
2012-01-21 15:43 aigoshin Note Added: 0005323
2012-01-21 15:43 aigoshin Note Added: 0005324
2012-01-21 15:45 aigoshin Note Added: 0005325
2012-01-21 15:45 aigoshin Status new => resolved
2012-01-21 15:45 aigoshin Resolution open => won't fix
2012-01-21 15:45 aigoshin Assigned To => aigoshin
2012-01-21 16:15 Christian Grothoff Note Added: 0005327
2012-01-21 16:15 Christian Grothoff Status resolved => closed
2012-01-21 16:15 Christian Grothoff Assigned To aigoshin =>