From: Vlad S. <vl...@cr...> - 2005-06-10 00:31:45
|
I have no failed tests Tests running in interp: /home/vlad/src/naviserver/nsd/nsd Tests located in: /home/vlad/src/naviserver/tests Tests running in: /home/vlad/src/naviserver/tests Temporary files stored in /home/vlad/src/naviserver/tests Test files sourced into current interpreter Running tests that match: * Skipping test files that match: l.*.test Only running test files that match: *.test Tests began at Thu Jun 09 08:30:29 PM EDT 2005 http.test ns_addrbyhost.test ns_adp_compress.test [09/Jun/2005:20:30:29][5516.3073625008][-conn:test::0] Notice: encoding: loaded: iso8859-1 ns_conn_host.test ns_hashpath.test ns_hostbyaddr.test ns_hrefs.test ns_nsv.test ns_pagepath.test ns_parseargs.test ns_serverpath.test ns_urlencode.test tclresp.test Tests ended at Thu Jun 09 08:30:30 PM EDT 2005 all.tcl: Total 193 Passed 193 Skipped 0 Failed 0 Sourced 13 Test Files. Stephen Deasey wrote: > Before you cvs commit, you must make test. Two tests are broken... > We're strugeling for tests, but tclresp.c is one file that does have a > reasonably complete set. Can you add some for the new commands? > Also, the cut 'n paste comment for Ns_ObjvByteArray is no longer > correct. > > I was wondering, is ns_returnbinary necessary? What if ns_return was > modified to check the type of it's data arg, and if it's byterray, > send using Ns_ConnReturnData. Would this work? > > > > > On 6/8/05, Vlad Seryakov <ser...@us...> wrote: > >>Update of /cvsroot/naviserver/naviserver/nsd >>In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15813/nsd >> >>Modified Files: >> tclobjv.c tclresp.c >>Log Message: >>Added -binary flag to ns_respond to return binary data without encoding conversion >> >> >>Index: tclobjv.c >>=================================================================== >>RCS file: /cvsroot/naviserver/naviserver/nsd/tclobjv.c,v >>retrieving revision 1.7 >>retrieving revision 1.8 >>diff -C2 -d -r1.7 -r1.8 >>*** tclobjv.c 15 May 2005 07:47:21 -0000 1.7 >>--- tclobjv.c 8 Jun 2005 20:27:12 -0000 1.8 >>*************** >>*** 310,313 **** >>--- 310,352 ---- >> *---------------------------------------------------------------------- >> * >>+ * Ns_ObjvByteArray -- >>+ * >>+ * Consume exactly one argument, returning a pointer to it's >>+ * cstring into *spec->dest. >>+ * >>+ * If spec->arg is != NULL it is assumed to be a pointer to an >>+ * int and the returned string length will be left in it. >>+ * >>+ * Results: >>+ * TCL_OK or TCL_ERROR. >>+ * >>+ * Side effects: >>+ * None. >>+ * >>+ *---------------------------------------------------------------------- >>+ */ >>+ >>+ int >>+ Ns_ObjvByteArray(Ns_ObjvSpec *spec, Tcl_Interp *interp, int *objcPtr, >>+ Tcl_Obj *CONST objv[]) >>+ { >>+ unsigned char **dest = spec->dest; >>+ >>+ if (*objcPtr > 0) { >>+ if (spec->arg == NULL) { >>+ *dest = Tcl_GetByteArrayFromObj(objv[0],0); >>+ } else { >>+ *dest = Tcl_GetByteArrayFromObj(objv[0], (int *) spec->arg); >>+ } >>+ *objcPtr -= 1; >>+ return TCL_OK; >>+ } >>+ return TCL_ERROR; >>+ } >>+ >>+ >>+ /* >>+ *---------------------------------------------------------------------- >>+ * >> * Ns_ObjvObj -- >> * >> >>Index: tclresp.c >>=================================================================== >>RCS file: /cvsroot/naviserver/naviserver/nsd/tclresp.c,v >>retrieving revision 1.4 >>retrieving revision 1.5 >>diff -C2 -d -r1.4 -r1.5 >>*** tclresp.c 8 Jun 2005 20:13:12 -0000 1.4 >>--- tclresp.c 8 Jun 2005 20:27:12 -0000 1.5 >>*************** >>*** 252,256 **** >> Ns_Conn *conn; >> int status = 200, length = -1; >>! char *type = "*/*", *setid = NULL; >> char *string = NULL, *filename = NULL, *chanid = NULL; >> Ns_Set *set = NULL; >>--- 252,256 ---- >> Ns_Conn *conn; >> int status = 200, length = -1; >>! char *type = "*/*", *setid = NULL, *binary = NULL; >> char *string = NULL, *filename = NULL, *chanid = NULL; >> Ns_Set *set = NULL; >>*************** >>*** 259,269 **** >> >> Ns_ObjvSpec opts[] = { >>! {"-status", Ns_ObjvInt, &status, NULL}, >>! {"-type", Ns_ObjvString, &type, NULL}, >>! {"-length", Ns_ObjvInt, &length, NULL}, >>! {"-headers", Ns_ObjvString, &setid, NULL}, >>! {"-string", Ns_ObjvString, &string, NULL}, >>! {"-file", Ns_ObjvString, &filename, NULL}, >>! {"-fileid", Ns_ObjvString, &chanid, NULL}, >> {NULL, NULL, NULL, NULL} >> }; >>--- 259,270 ---- >> >> Ns_ObjvSpec opts[] = { >>! {"-status", Ns_ObjvInt, &status, NULL}, >>! {"-type", Ns_ObjvString, &type, NULL}, >>! {"-length", Ns_ObjvInt, &length, NULL}, >>! {"-headers", Ns_ObjvString, &setid, NULL}, >>! {"-string", Ns_ObjvString, &string, NULL}, >>! {"-file", Ns_ObjvString, &filename, NULL}, >>! {"-fileid", Ns_ObjvString, &chanid, NULL}, >>! {"-binary", Ns_ObjvByteArray, &binary, &length}, >> {NULL, NULL, NULL, NULL} >> }; >>*************** >>*** 277,282 **** >> return TCL_ERROR; >> } >>! if ((string != NULL) + (filename != NULL) + (chanid != NULL) != 1) { >>! Tcl_SetResult(interp, "must specify only one of -string, -file " >> "or -fileid", TCL_STATIC); >> return TCL_ERROR; >>--- 278,283 ---- >> return TCL_ERROR; >> } >>! if ((binary != NULL) + (string != NULL) + (filename != NULL) + (chanid != NULL) != 1) { >>! Tcl_SetResult(interp, "must specify only one of -string, -file, -binary " >> "or -fileid", TCL_STATIC); >> return TCL_ERROR; >>*************** >>*** 313,316 **** >>--- 314,324 ---- >> retval = Ns_ConnReturnFile(conn, status, type, filename); >> >>+ } else if (binary != NULL) { >>+ /* >>+ * We'll be returning a binary data >>+ */ >>+ >>+ retval = Ns_ConnReturnData(conn, status, binary, length, type); >>+ >> } else { >> /* > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput > a projector? How fast can you ride your desk chair down the office luge track? > If you want to score the big prize, get to know the little guy. > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel -- Vlad Seryakov 571 262-8608 office vl...@cr... http://www.crystalballinc.com/vlad/ |