One of your functions may block. Callbacks must not block.
On Fri, Jun 6, 2008 at 10:00 AM, Cui Jindong <[EMAIL PROTECTED]> wrote:
> In standalong server, It seems works well. In my program I register many
> SSI, to user my program data.
>
>
>
> I'm not sure where the problem happened . Maybe in SSI , Maybe my program.
>
>
>
> Some code in my program:
>
>
>
> static struct shttpd_ctx *ctx;
>
>
>
> httpserver* httpserver::_this = NULL;
>
>
>
> httpserver::httpserver (int port)
>
> {
>
>
>
> Init (port);
>
> }
>
>
>
> httpserver::~httpserver ()
>
> {
>
> if (m_httpthd != NULL)
>
> CloseHandle (m_httpthd);
>
> }
>
>
>
> void httpserver::Init (int port)
>
> {
>
> //static char *argv = {"", "-ports", 80, NULL};
>
> //int argc = sizeof(argv) / sizeof(argv[0]) -
> 1;
>
>
>
> ctx = shttpd_init (0, NULL);
>
> m_httpthd = NULL;
>
> // root document
>
> shttpd_set_option (ctx, "root", ".\\www\\");
>
> shttpd_set_option (ctx, "index_files", "index.shtml");
>
>
>
> // config url, must in other front.
>
> shttpd_set_option(ctx, "cfg_uri", "/cfg");
>
>
>
> // AJAX url register
>
> shttpd_register_uri(ctx, "/ajax/*/", &uri_func_ajax, NULL);
>
> shttpd_register_uri(ctx, "/logout", &show_logout, NULL);
>
>
>
> shttpd_set_option(ctx, "auth_realm", DOMAIN_NAME);
>
> shttpd_set_option(ctx, "auth_gpass", PASSFILE);
>
>
>
> //set_cfg_uri (ctx, "/cfg");
>
>
>
>
>
> // SSI function register
>
> shttpd_register_ssi_func(ctx, "ssi_func_navmenu",
> ssi_func_navmenu, NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_serverlic",
> ssi_func_serverlic, NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_serverstate",
> ssi_func_serverstate, NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_serverversion",
> ssi_func_serverversion, NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_systemlog",
> ssi_func_systemlog, NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_decryptlog",
> ssi_func_decryptlog, NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_clientlist",
> ssi_func_clientlist, NULL);
>
> shttpd_register_ssi_func(ctx,
> "ssi_func_Departmentlist",ssi_func_Departmentlist,NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_Managerlist",
> ssi_func_Managerlist, NULL);
>
> shttpd_register_ssi_func(ctx, "ssi_func_PageNav",
> ssi_func_PageNav, NULL);
>
>
>
> shttpd_set_option(ctx, "access_log", "c:\\a.log");
>
> //shttpd_set_option(ctx, "error_log", "c:\\e.log");
>
> shttpd_set_option(ctx, "ports", "80");
>
> }
>
>
>
> BOOL httpserver::startHttpServer (int port)
>
> {
>
> if (_this == NULL)
>
> _this = new httpserver (port);
>
>
>
> _this->m_httpthd = CreateThread (0, 0,
> (LPTHREAD_START_ROUTINE)httpserver::ThreadProc, NULL, 0, NULL);
>
>
>
> return TRUE;
>
> }
>
>
>
> LRESULT CALLBACK httpserver::ThreadProc()
>
> {
>
> // edit_passwords (PASSFILE, DOMAIN_NAME, "admin", "123456");
>
>
>
> for (;;)
>
> shttpd_poll(ctx, 10000);
>
> }
>
>
>
> And http server run in a single thread.
>
>
>
>
>
> *发件人:* Sergey Lyubka [mailto:[EMAIL PROTECTED]
> *发送时间:* 2008年6月6日 16:38
> *收件人:* Cui Jindong
> *抄送:* shttpd-general
> *主题:* Re: [shttpd-general] File Download
>
>
>
> Does it manifest itself in standalone server?
>
> On Fri, Jun 6, 2008 at 7:38 AM, Cui Jindong <[EMAIL PROTECTED]> wrote:
>
> Hi guys:
>
>
>
> I found a problem, and I don't know if it is a bug.
>
>
>
> I embed SHTTPD in my program, It seems that while mutiusers download a file
> such as a .gif picture. SHTTPD while block.
>
>
>
> Is anyone found? My HTTP files maybe download the same file twice.
>
>
>
> thanks the great program, nice project. But my English is pool, sorry.
>
>
>
>
>
> Snox Abbey (China)
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> shttpd-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/shttpd-general
>
>
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
shttpd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shttpd-general