681 |
681 |
682 PRNetAddr *pr_client_addr; |
682 PRNetAddr *pr_client_addr; |
683 PRNetAddr *pr_local_addr; |
683 PRNetAddr *pr_local_addr; |
684 }; |
684 }; |
685 |
685 |
|
686 |
|
687 typedef struct FuncStruct FuncStruct; |
|
688 |
686 /* |
689 /* |
687 * FuncPtr is a pointer to an NSAPI SAF function |
690 * FuncPtr is a pointer to an NSAPI SAF function |
688 */ |
691 */ |
689 |
692 |
690 #ifdef XP_UNIX |
693 #ifdef XP_UNIX |
691 typedef int Func(pblock *, Session *, Request *); |
694 typedef int Func(pblock *, Session *, Request *); |
|
695 // new func executor |
|
696 typedef int FuncExec(FuncStruct *, pblock *, Session *, Request *); |
692 #else /* XP_WIN32 */ |
697 #else /* XP_WIN32 */ |
693 typedef int _cdecl Func(pblock *, Session *, Request *); |
698 typedef int _cdecl Func(pblock *, Session *, Request *); |
|
699 typedef int _cdecl uncExec(FuncStruct *, pblock *, Session *, Request *); |
694 #endif /* XP_WIN32 */ |
700 #endif /* XP_WIN32 */ |
695 |
701 |
696 typedef Func *FuncPtr; |
702 typedef Func *FuncPtr; |
|
703 typedef FuncExec *FuncExecPtr; |
697 |
704 |
698 /* |
705 /* |
699 * FuncStruct is a structure used in the static declaration of the |
706 * FuncStruct is a structure used in the static declaration of the |
700 * functions. This static declaration is parsed into a hash table at |
707 * functions. This static declaration is parsed into a hash table at |
701 * startup. |
708 * startup. |
702 */ |
709 */ |
703 |
710 |
704 typedef struct FuncStruct FuncStruct; |
|
705 |
|
706 struct FuncStruct { |
711 struct FuncStruct { |
707 const char * name; |
712 const char *name; |
708 FuncPtr func; |
713 FuncPtr func; |
709 struct FuncStruct *next; |
714 //struct FuncStruct *next; |
|
715 FuncExecPtr func_exec; |
|
716 void *exec_data; |
710 unsigned flags; |
717 unsigned flags; |
711 unsigned poolID; |
718 unsigned poolID; |
712 unsigned pool_resolved; |
719 unsigned pool_resolved; |
713 }; |
720 }; |
714 |
721 |
1350 #define REALLOC realloc |
1357 #define REALLOC realloc |
1351 #define FREE free |
1358 #define FREE free |
1352 |
1359 |
1353 // func util functions |
1360 // func util functions |
1354 FuncStruct* func_resolve(pblock *pb, Session *sn, Request *rq); |
1361 FuncStruct* func_resolve(pblock *pb, Session *sn, Request *rq); |
1355 int func_exec (pblock *pb, Session *sn, Request *rq); |
1362 int func_exec(pblock *pb, Session *sn, Request *rq); |
1356 |
1363 struct FuncStruct func_insert(char *name, FuncPtr fn); |
|
1364 #define func_insert func_insert |
1357 |
1365 |
1358 |
1366 |
1359 void protocol_status(Session *sn, Request *rq, int n, const char *m); |
1367 void protocol_status(Session *sn, Request *rq, int n, const char *m); |
1360 |
1368 |
1361 int http_start_response(Session *sn, Request *rq); |
1369 int http_start_response(Session *sn, Request *rq); |