From: Stephen D. <sd...@us...> - 2005-06-13 01:56:22
|
Update of /cvsroot/naviserver/naviserver/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27051/include Modified Files: ns.h Log Message: * nsd/str.c: Add new function Ns_StrIsHost. * include/ns.h: * nsd/nsd.h: * nsd/driver.c: Save the protocol seperate from the location in the driver structure and ensure the location always begins with a "protocol://" string. * nsd/server.c: * nsd/conn.c: * nsd/pathname.c: Simplify code by using protocol direct from driver structure and checking Host header with Ns_StrIsHost. Index: ns.h =================================================================== RCS file: /cvsroot/naviserver/naviserver/include/ns.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ns.h 11 Jun 2005 20:00:48 -0000 1.25 --- ns.h 13 Jun 2005 01:56:13 -0000 1.26 *************** *** 405,419 **** typedef struct Ns_Driver { ! void *arg; /* Driver callback data. */ ! char *server; /* Virtual server name. */ ! char *module; /* Driver module. */ ! char *name; /* Driver name. */ ! char *location; /* Location, e.g, "http://foo:9090" */ ! char *address; /* Address in location. */ ! int sendwait; /* send() I/O timeout. */ ! int recvwait; /* recv() I/O timeout. */ ! int bufsize; /* Conn bufsize (0 for SSL) */ ! int sndbuf; /* setsockopt() SNDBUF option. */ ! int rcvbuf; /* setsockopt() RCVBUF option. */ } Ns_Driver; --- 405,420 ---- typedef struct Ns_Driver { ! void *arg; /* Driver callback data. */ ! char *server; /* Virtual server name. */ ! char *module; /* Driver module. */ ! char *name; /* Driver name. */ ! char *location; /* Location, e.g, "http://foo:9090" */ ! char *address; /* Address in location, e.g. "foo" */ ! char *protocol; /* Protocol in location, e.g, "http" */ ! int sendwait; /* send() I/O timeout. */ ! int recvwait; /* recv() I/O timeout. */ ! int bufsize; /* Conn bufsize (0 for SSL) */ ! int sndbuf; /* setsockopt() SNDBUF option. */ ! int rcvbuf; /* setsockopt() RCVBUF option. */ } Ns_Driver; *************** *** 472,476 **** typedef int (Ns_FilterProc) (void *arg, Ns_Conn *conn, int why); typedef int (Ns_UrlToFileProc) (Ns_DString *dsPtr, char *server, char *url); ! typedef char *(Ns_ServerRootProc) (Ns_DString *dest, char *host, void *arg); typedef char *(Ns_ConnLocationProc) (Ns_Conn *conn, Ns_DString *dest, void *arg); typedef char *(Ns_LocationProc) (Ns_Conn *conn); /* depreciated */ --- 473,477 ---- typedef int (Ns_FilterProc) (void *arg, Ns_Conn *conn, int why); typedef int (Ns_UrlToFileProc) (Ns_DString *dsPtr, char *server, char *url); ! typedef char *(Ns_ServerRootProc) (Ns_DString *dest, CONST char *host, void *arg); typedef char *(Ns_ConnLocationProc) (Ns_Conn *conn, Ns_DString *dest, void *arg); typedef char *(Ns_LocationProc) (Ns_Conn *conn); /* depreciated */ *************** *** 1179,1182 **** --- 1180,1184 ---- NS_EXTERN char *Ns_NextWord(char *line); NS_EXTERN char *Ns_StrNStr(char *pattern, char *expression); + NS_EXTERN int Ns_StrIsHost(CONST char *string); /* |