Userspace module return value?
Marek Habersack <[email protected]> Tue, 20 Jul 2004 14:29:47 +0200
| Newsgroups | gmane.network.tux |
|---|---|
| Organization | I just... |
| Message-ID | <[email protected]> |
Hello list, I have a problem with a userspace module I have written for Tux. Tux is configured to forward all the connections to that module which, in turn, decides whether the visitor is authorized to access the server and, if yes, how to handle the connection - whether to have tux send a static file or the backend handle a dynamic resource. Everything works fine except for one "detail" - once every few requests, the following happens: Jul 20 06:28:47 localhost kernel: Possibly unexpected TUX-thread exit(0) at c0117da3? Jul 20 06:28:47 localhost kernel: TUX: thread 0 stopping ... Jul 20 06:28:47 localhost kernel: TUX: thread 0 stopped. I have determined that this happens when I return a wrong value from the handle_events function. The problem is, I have no idea what is "wrong" or "good" value to return from the function? The first version of the module was returning whatever it got from the tux() syscall, but the above problem was appearing even then. It seems to happen only after the _last_ resource pertaining to a single request is sent (e.g. I am serving a static HTML page with several images, when the last image request is satisfied, the module exits in the way shown in the log excerpt above). It's definitely a case of an incorrect return value from the handle_events function - but I can't find any documentation on what the return value means in this case. I have found a solution which takes care of the problem, but feels like a hack - I'm returning TUX_RETURN_USERSPACE_REQUEST every time except when closing the connection, when I return the value returned from tux(TUX_ACTION_FINISH_CLOSE_REQ, req). That seems to work so far, but is it the right solution? Could anybody, please, shed some light on the handle_events return value? thanks, marek _______________________________________________ tux-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/tux-list
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFA/RA7q3909GIf5uoRAi5kAKCCxnjjW1I9RHXYE4KPiAYLSEQAZACZAd3+ YTmOgFIfw5WxFFE6f5yHaO8= =dBDz -----END PGP SIGNATURE-----