From: Stephen D. <sd...@gm...> - 2005-06-10 06:52:28
|
I think it's fine to also alow ns_return to handle binary data, I'm just wondering if it should be with the extra command ns_returnbinary? It looks like you can simple check the type of the Tcl object passed to ns_return for "bytearray". That's the only case it makes sense to write the bytes directly. The advantage over ns_returnbinary is that in many cases the uses doesn't have to know what's going on. e.g. a command which creates a png graph would be returned as a byte array, and if passed to ns_return everything should just work. On 6/9/05, Vlad Seryakov <vl...@cr...> wrote: > ns_respond now supports binary so ns_returnbinary is redundant, but i > think Tcl_GetByteArray works with string and byte array, just > Tcl_GetByteArray does not do eny encoding/converting to/From utf. >=20 > 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? |