X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=www%2Fwirtcl.c;h=e85af445eb6219482ee737deca71fbd0ca909fea;hb=150d836eb46d0dde8fedeb77fc7fd4ef6eafba4f;hp=fcb49ff579ae6642f7c62190732923e9f0ca7bfc;hpb=4a4288c5b72d694c1ca2c1c08926d1e10f01cc48;p=egate.git diff --git a/www/wirtcl.c b/www/wirtcl.c index fcb49ff..e85af44 100644 --- a/www/wirtcl.c +++ b/www/wirtcl.c @@ -41,7 +41,16 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * * $Log: wirtcl.c,v $ - * Revision 1.4 1995/10/31 10:03:53 adam + * Revision 1.7 1995/11/02 16:35:37 adam + * Bug fixes and select on FIFOs in wcgi - doesn't really work! + * + * Revision 1.6 1995/11/01 16:15:47 adam + * Better presentation of records. Query/set number persistent. + * + * Revision 1.5 1995/10/31 16:56:24 adam + * Record presentation. + * + * Revision 1.4 1995/10/31 10:03:53 adam * Work on queries. * New command implemented - aborts script. * @@ -71,6 +80,7 @@ #include #include +#include #include "wtcl.h" #include "wirtcl.h" @@ -144,6 +154,7 @@ static void *do_create (WCLIENT wcl, void *args) gw_log (GW_LOG_FATAL, mod, "Cannot make Irtcl_Interp"); exit (1); } + log_init(LOG_ALL, "irtcl", "/usr/local/etc/httpd/logs/irtcl_log"); /* initialize irtcl */ Tcl_CreateCommand (p->interp, "zwait", proc_zwait_invoke, p, NULL); for (i=0; iinterp, msg, NULL); return TCL_ERROR; } - gw_log (GW_LOG_DEBUG, mod, "Waiting for variable %s=%s", - waitVar, waitVarVal); + gw_log (GW_LOG_DEBUG, mod, "Waiting %s=%s", waitVar, waitVarVal); while (1) { if (!(cp = Tcl_GetVar (p->interp, waitVar, 0)) || strcmp (cp, waitVarVal)) { + gw_log (GW_LOG_DEBUG, mod, "Changed to %s", cp); Tcl_AppendResult (p->interp, cp, NULL); free (waitVarVal); return TCL_OK; @@ -228,17 +239,26 @@ static int events (struct tcl_info *p, char *waitVar) } if (!r) break; +#if 1 + gw_log (GW_LOG_DEBUG, mod, "fifo select %d", fifo_in); FD_SET (fifo_in, &fdset_tcl_r); +#endif if ((r = select(max_fd+1, &fdset_tcl_r, &fdset_tcl_w, - &fdset_tcl_x, 0)) < 0) + &fdset_tcl_x, NULL)) < 0) { - perror("select"); + gw_log (GW_LOG_ERRNO|GW_LOG_FATAL, mod, "select"); exit(1); } if (!r) + { + gw_log (GW_LOG_DEBUG, mod, "timeout"); break; + } if (FD_ISSET (fifo_in, &fdset_tcl_r)) + { + gw_log (GW_LOG_DEBUG, mod, "FIFO closed"); break; + } for (i=0; i<=max_fd; i++) { if (FD_ISSET (i, &fdset_tcl_r))