From: Stephen D. <sd...@gm...> - 2006-07-10 19:25:23
|
On 7/10/06, Vlad Seryakov <vl...@cr...> wrote: > NS_FATAL in context of these functions means unrecoverable error, but if > name is not very good it can be changed Here's some code checking for NS_FATAL and recovering... if (status == NS_FATAL || sockPtr->reqPtr == NULL || !SetServer(sockPtr)) { SockRelease(sockPtr, SOCK_SERVERREJECT, 0); return NS_ERROR; } It's not just the name though, the distinction seems meaningless, and indeed different parts of the code are confused about what it means. We need to switch back to a socket driver interface with multiple functions, as in the 3.x days. Pushing everything through: typedef int (Ns_DriverProc)(Ns_DriverCmd cmd, Ns_Sock *sock, struct iovec *bufs, int nbufs); just isn't working. Check out the comments for the new NsDriver* wrappers, even the long existing DriverKeep and DriverClose don't make a lot of sense. > Stephen Deasey wrote: > > NS_FATAL doesn't make any sense. Fatal means unrecoverable error, as > > in Ns_Fatal(...): and the server exits. > > > > Anyway, the following two disagree. Whether they intend "request > > cannot be parsed" or "driver function not supported", NS_FATAL isn't > > the way to say it. > > > > > > /* > > *---------------------------------------------------------------------- > > * > > * Ns_DriverSetRequest -- > > * > > * Parses request line and sets as current Request struct, should be > > * in the form: METHOD URL ?PROTO? > > * > > * Results: > > * NS_ERROR in case of empty line > > * NS_FATAL if request cannot be parsed. > > * NS_OK if parsed sucessfully > > * > > * Side effects: > > * This is supposed to be called from drivers before the > > * socket is queued, usually from DriverQueue command. > > * Primary purpose is to allow non-HTTP drivers to setup > > * request line so registered callback proc will be called > > * during connection processing > > * > > *---------------------------------------------------------------------- > > */ > > > > /* > > *---------------------------------------------------------------------- > > * > > * SockQueue -- > > * > > * Puts socket into connection queue > > * > > * Call driver's queue handler for the last checks before actual > > * connection enqueue. NS_ERROR is valid here because that means > > * driver does not implement this call, we care about NS_FATAL status > > * only which means we cannot queue this socket. It is driver's > > responsibility > > * to allocate Request structure via Ns_DriverSetRequest call, otherwise > > * for all non-HTTP or not-parsed sockets this call will fail > > * > > * Results: > > * NS_OK if queued, > > * NS_ERROR if socket closed because of error > > * NS_TIMEOUT if queue is full > > * > > * Side effects: > > * None > > * > > *---------------------------------------------------------------------- > > */ > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > 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/ > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |