Patch is attached, if everybody is Okay with it i will commit it
Zoran Vasiljevic wrote:
On Saturday 05 March 2005 01:33, Stephen Deasey wrote:
I added the function Ns_ConnSetResponseStatus() for the protocols
stuff, but I didn't add the Tcl equivalent to ns_conn. I aggree with
Vlad that ns_conn status ?newStatus? would be a good addition (which
requires that we drop connid :-)
Drop the connid.
ns_conn status ?newStatus?
is perfectly OK.
Zoran
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&opÌk
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/
*** conn.c 2005-03-05 12:34:30.000000000 -0500
--- ../new/conn.c 2005-03-05 12:35:45.000000000 -0500
***************
*** 233,238 ****
--- 233,263 ----
}
+ /*
+ *----------------------------------------------------------------------
+ *
+ * Ns_ConnSetResponseStatus --
+ *
+ * Set the HTTP reponse code that will be sent
+ *
+ * Results:
+ * Previous response status as an integer response code (e.g., 200 for OK)
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ int
+ Ns_ConnSetResponseStatus(Ns_Conn *conn, int new_status)
+ {
+ Conn *connPtr = (Conn *) conn;
+
+ connPtr->responseStatus = new_status;
+ return new_status;
+ }
+
/*
*----------------------------------------------------------------------
***************
*** 808,814 ****
Tcl_HashSearch search;
FormFile *filePtr;
int idx, off, len;
- int write_encoded_flag;
static CONST char *opts[] = {
"authpassword", "authuser", "close", "content", "contentlength",
--- 833,838 ----
***************
*** 1039,1045 ****
case CWriteEncodedIdx:
if (objc > 2) {
! if (Tcl_GetIntFromObj(interp, objv[2], &write_encoded_flag)
!= TCL_OK) {
Tcl_AppendResult(interp, "Invalid write-encoded flag",
NULL );
return TCL_ERROR;
--- 1063,1070 ----
case CWriteEncodedIdx:
if (objc > 2) {
! int write_encoded_flag;
! if (Tcl_GetIntFromObj(interp, objv[2], &write_encoded_flag)
!= TCL_OK) {
Tcl_AppendResult(interp, "Invalid write-encoded flag",
NULL );
return TCL_ERROR;
***************
*** 1102,1107 ****
--- 1127,1140 ----
break;
case CStatusIdx:
+ if (objc > 2) {
+ int new_status;
+ if (Tcl_GetIntFromObj(interp, objv[2], &new_status) !=
TCL_OK) {
+ Tcl_AppendResult(interp, "Invalid response status code",
NULL );
+ return TCL_ERROR;
+ }
+ Ns_ConnSetResponseStatus(conn, new_status);
+ }
Tcl_SetIntObj(result, Ns_ConnResponseStatus(conn));
break;