epinit.c

filter: Statementstmt 0.0% 0 / 959 Branchbran 0.0% 0 / 960 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 1919 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« epeval.c ↑ Summary epio.c »
1 /*###################################################################################
2 #
3 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
4 # Embperl - Copyright (c) 2008-2015 Gerald Richter
5 # Embperl - Copyright (c) 2015-2023 actevy.io
6 #
7 # You may distribute under the terms of either the GNU General Public
8 # License or the Artistic License, as specified in the Perl README file.
9 # For use with Apache httpd and mod_perl, see also Apache copyright.
10 #
11 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
12 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 #
15 ###################################################################################*/
16  
17  
18 #include "ep.h"
19 #include "epmacro.h"
20 #include "xs/ep_xs_typedefs.h"
21 #include "xs/ep_xs_sv_convert.h"
22  
23 #include "epdefault.c"
24  
25 SV ep_sv_undef ; /* we need our own undef value, because when
26 storing a PL_sv_undef with Perl 5.8.0 in a hash
27 Perl takes it as a placeholder and pretents it isn't there :-( */
28  
29 #ifndef PERL_IMPLICIT_CONTEXT
30  
31 SV * embperl_ThreadDataRV ;
32  
33 #define SINGLETHREAD
34  
35 #endif
36  
37  
38  
39 #define OPTPREFIX EMBPERL_PACKAGE_STR
40  
41 #define EMBPERL_APP_PACKAGE EMBPERL_PACKAGE_STR"::Application"
42 #define EMBPERL_REQ_PACKAGE EMBPERL_PACKAGE_STR"::Req"
43 #define EMBPERL_THREAD_PACKAGE EMBPERL_PACKAGE_STR"::Thread"
44  
45 #define FDAT_NAME "fdat"
46 #define EMBPERL_FDAT_NAME EMBPERL_PACKAGE_STR"::"FDAT_NAME
47 #define EMBPERL_SPLIFDAT_NAME EMBPERL_PACKAGE_STR"::splitfdat"
48 #define FFLD_NAME "ffld"
49 #define EMBPERL_FFLD_NAME EMBPERL_PACKAGE_STR"::"FFLD_NAME
50 #define EMBPERL_HDR_NAME EMBPERL_PACKAGE_STR"::http_headers_out"
51 #define EMBPERL_IDAT_NAME EMBPERL_PACKAGE_STR"::idat"
52 #define PARAM_NAME "param"
53 #define EMBPERL_PARAM_NAME EMBPERL_PACKAGE_STR"::"PARAM_NAME
54 #define EMBPERL_REQ_NAME EMBPERL_PACKAGE_STR"::req"
55 #define EMBPERL_APP_NAME EMBPERL_PACKAGE_STR"::app"
56 #define EMBPERL_ENV_NAME "ENV"
57  
58 #define EMBPERL_EscMode_NAME EMBPERL_PACKAGE_STR"::escmode"
59 #define EMBPERL_CurrNode_NAME EMBPERL_PACKAGE_STR"::_ep_node"
60  
61 #define MAX_FORMDATA_SIZE 67108864 /* 64 MB */
62 #define MAX_FORMDATA_SIZE_XXSTR(A) MAX_FORMDATA_SIZE_XSTR(A)
63 #define MAX_FORMDATA_SIZE_XSTR(A) #A
64 #define MAX_FORMDATA_SIZE_STR MAX_FORMDATA_SIZE_XXSTR(MAX_FORMDATA_SIZE)
65  
66 static int bInitDone = 0 ; /* c part is already initialized */
67 static int nRequestCount = 1 ;
68 static perl_mutex RequestCountMutex ;
69  
70 static tMemPool * pMainPool ;
71  
72 static tReq NullRequest ; /* a request object with all zero, to point for deleted objects */
73  
74 /* -------------------------------------------------------------------------
75 *
76 * Options lists for configuration
77 *
78 */
79  
80 #define OPTION(a,b) { #a, a}, { #b, a},
81  
82 tOptionEntry OptionsDEBUG[] =
83 {
84 OPTION(dbgStd, std)
85 OPTION(dbgMem,Mem)
86 OPTION(dbgEval,Eval)
87 OPTION(dbgCmd,Cmd)
88 OPTION(dbgEnv,Env)
89 OPTION(dbgForm,Form)
90 OPTION(dbgTab,Tab)
91 OPTION(dbgInput,Input)
92 OPTION(dbgFlushOutput,FlushOutput)
93 OPTION(dbgFlushLog,FlushLog)
94 OPTION(dbgAllCmds,AllCmds)
95 OPTION(dbgSource,Source)
96 OPTION(dbgFunc,Func)
97 OPTION(dbgLogLink,LogLink)
98 OPTION(dbgDefEval,DefEval)
99 OPTION(dbgOutput,Output)
100 OPTION(dbgDOM,DOM)
101 OPTION(dbgRun,Run)
102 OPTION(dbgHeadersIn,HeadersIn)
103 OPTION(dbgShowCleanup,ShowCleanup)
104 OPTION(dbgProfile,Profile)
105 OPTION(dbgSession,Session)
106 OPTION(dbgImport,Import)
107 OPTION(dbgBuildToken,BuildToken)
108 OPTION(dbgParse,Parse)
109 OPTION(dbgObjectSearch,ObjectSearch)
110 OPTION(dbgCache,Cache)
111 OPTION(dbgCompile,Compile)
112 OPTION(dbgXML,XML)
113 OPTION(dbgXSLT,XSLT)
114 OPTION(dbgCheckpoint,Checkpoint)
115 OPTION(dbgAll,All)
116 } ;
117  
118 #define OPTION_OPT(a) OPTION(opt##a, a)
119  
120 tOptionEntry OptionsOPTIONS[] =
121 {
122 OPTION_OPT(DisableVarCleanup)
123 OPTION_OPT(DisableEmbperlErrorPage)
124 OPTION_OPT(SafeNamespace)
125 OPTION_OPT(OpcodeMask)
126 OPTION_OPT(RawInput)
127 OPTION_OPT(SendHttpHeader)
128 OPTION_OPT(EarlyHttpHeader)
129 OPTION_OPT(DisableChdir)
130 OPTION_OPT(DisableFormData)
131 OPTION_OPT(DisableHtmlScan)
132 OPTION_OPT(DisableInputScan)
133 OPTION_OPT(DisableTableScan)
134 OPTION_OPT(DisableMetaScan)
135 OPTION_OPT(AllFormData)
136 OPTION_OPT(RedirectStdout)
137 OPTION_OPT(UndefToEmptyValue)
138 OPTION_OPT(NoHiddenEmptyValue)
139 OPTION_OPT(AllowZeroFilesize)
140 OPTION_OPT(ReturnError)
141 OPTION_OPT(KeepSrcInMemory)
142 OPTION_OPT(KeepSpaces)
143 OPTION_OPT(OpenLogEarly)
144 OPTION_OPT(NoUncloseWarn)
145 OPTION_OPT(DisableSelectScan)
146 OPTION_OPT(ShowBacktrace)
147 OPTION_OPT(EnableChdir)
148 OPTION_OPT(FormDataNoUtf8)
149 } ;
150  
151  
152 #define OPTION_ESC(a) OPTION(esc##a, a)
153  
154 tOptionEntry OptionsESCMODE[] =
155 {
156 OPTION_ESC(None)
157 OPTION_ESC(Html)
158 OPTION_ESC(Url)
159 OPTION_ESC(Escape)
160 OPTION_ESC(XML)
161 OPTION_ESC(Std)
162 } ;
163  
164  
165 #define OPTION_IESC(a) OPTION(iesc##a, a)
166  
167 tOptionEntry OptionsINPUT_ESCMODE[] =
168 {
169 OPTION_IESC(None)
170 OPTION_IESC(Html)
171 OPTION_IESC(Url)
172 OPTION_IESC(RemoveTags)
173 } ;
174  
175 #define OPTION_OMODE(a) OPTION(omode##a, a)
176  
177 tOptionEntry OptionsOUTPUT_MODE[] =
178 {
179 OPTION_OMODE(Html)
180 OPTION_OMODE(Xml)
181 } ;
182  
183 #define OPTION_OCHARSET(a) OPTION(ocharset##a, a)
184  
185 tOptionEntry OptionsOUTPUT_ESC_CHARSET[] =
186 {
187 OPTION_OCHARSET(Utf8)
188 OPTION_OCHARSET(Latin1)
189 OPTION_OCHARSET(Latin2)
190 } ;
191  
192 #define OPTION_SMODE(a) OPTION(smode##a, a)
193  
194 tOptionEntry OptionsSESSION_MODE[] =
195 {
196 OPTION_SMODE(None)
197 OPTION_SMODE(UDatCookie)
198 OPTION_SMODE(UDatParam)
199 OPTION_SMODE(UDatUrl)
200 OPTION_SMODE(SDatParam)
201 } ;
202  
203  
204 /*---------------------------------------------------------------------------
205 * embperl_SetupThread
206 */
207 /*!
208 *
209 * \_en
210 * Setup an thread object. Either take an existing one, if this thread
211 * already has a azocitaed object or create a new one.
212 *
213 * \endif
214 *
215 * \_de
216 * Initialisiert ein Threadobjekt. Ist dem Thread schon ein Objekt zugeorndet
217 * wird das bestehende genutzt, ansonsten ein neues zur?ck geliefert.
218 * \endif
219 *
220 * ------------------------------------------------------------------------ */
221  
222  
223  
224 0 int embperl_SetupThread (/*in*/ pTHX_
225 /*out*/tThreadData * * ppThread)
226  
227  
228 {
229 tThreadData * pThread ;
230 SV * * ppSV ;
231  
232 #ifdef SINGLETHREAD
233 0 ppSV = &embperl_ThreadDataRV ;
234 #else
235 ppSV = hv_fetch (PL_modglobal, "Embperl::Thread", 15, 1) ;
236 #endif
237 0 ▶ if (!ppSV)
Branch: 1 branch
BranchTrueFalseTotal
if (!ppSV) 0 0 0
238 {
239 0 LogErrorParam (NULL, rcHashError, "PL_modglobal (key=Embperl::Thread)", "") ;
240 0 return rcHashError ;
241 }
242
243 0 ▶ if (!*ppSV || !SvOK(*ppSV))
Branch: 2 branches
BranchTrueFalseTotal
if (!*ppSV || !SvOK(*ppSV)) 0 0 0
if (!*ppSV || !SvOK(*ppSV)) 0 0 0
244 0 {
245 SV * pThreadRV ;
246 SV * pThreadSV ;
247 0 HV * pStash = gv_stashpv (EMBPERL_PACKAGE_STR, 1) ;
248 0 tMemPool * pPool = ep_make_sub_pool (pMainPool) ;
249  
250 0 epxs_Embperl__Thread_create_obj(pThread,pThreadSV,pThreadRV,ep_palloc(pPool,sizeof(*pThread))) ;
251 #ifdef PERL_IMPLICIT_CONTEXT
252 pThread -> pPerlTHX = aTHX ;
253 #endif
254 0 pThread -> pPool = pPool ;
255 0 pThread -> pMainPool = pMainPool ;
256 0 pThread -> nPid = getpid () ;
257 0 pThread -> pApplications = newHV () ;
258 0 pThread -> pFormHash = perl_get_hv (EMBPERL_FDAT_NAME, GV_ADD | GV_ADDMULTI) ;
259 0 SvREFCNT_inc(pThread -> pFormHash) ;
260 0 pThread -> pFormHashGV = *((GV **)hv_fetch (pStash, FDAT_NAME, sizeof (FDAT_NAME) - 1, 0)) ;
261 0 pThread -> pFormSplitHash = perl_get_hv (EMBPERL_SPLIFDAT_NAME, GV_ADD | GV_ADDMULTI) ;
262 0 SvREFCNT_inc(pThread -> pFormSplitHash) ;
263 0 pThread -> pFormArray = perl_get_av (EMBPERL_FFLD_NAME, GV_ADD | GV_ADDMULTI) ;
264 0 SvREFCNT_inc(pThread -> pFormArray) ;
265 0 pThread -> pFormArrayGV = *((GV **)hv_fetch (pStash, FFLD_NAME, sizeof (FFLD_NAME) - 1, 0)) ;
266 0 pThread -> pHeaderHash = perl_get_hv (EMBPERL_HDR_NAME, GV_ADD | GV_ADDMULTI) ;
267 0 SvREFCNT_inc(pThread -> pHeaderHash) ;
268 0 pThread -> pInputHash = perl_get_hv (EMBPERL_IDAT_NAME, GV_ADD | GV_ADDMULTI) ;
269 0 SvREFCNT_inc(pThread -> pInputHash) ;
270 #ifdef DMALLOC
271 pThread -> pEnvHash = Perl_get_hv(aTHX_ EMBPERL_ENV_NAME, GV_ADD | GV_ADDMULTI) ;
272 #else
273 0 pThread -> pEnvHash = perl_get_hv (EMBPERL_ENV_NAME, GV_ADD | GV_ADDMULTI) ;
274 #endif
275 0 SvREFCNT_inc(pThread -> pEnvHash) ;
276 0 pThread -> pParamArray = perl_get_av (EMBPERL_PARAM_NAME, GV_ADD | GV_ADDMULTI) ;
277 0 SvREFCNT_inc(pThread -> pParamArray) ;
278 0 pThread -> pParamArrayGV = *((GV **)hv_fetch (pStash, PARAM_NAME, sizeof (PARAM_NAME) - 1, 0)) ;
279 0 pThread -> pReqRV = perl_get_sv (EMBPERL_REQ_NAME, GV_ADD | GV_ADDMULTI) ;
280 0 SvREFCNT_inc(pThread -> pReqRV) ;
281 0 pThread -> pAppRV = perl_get_sv (EMBPERL_APP_NAME, GV_ADD | GV_ADDMULTI) ;
282 0 SvREFCNT_inc(pThread -> pAppRV) ;
283 0 *ppSV = pThreadRV ;
284 }
285 else
286 {
287 0 ▶ pThread = epxs_sv2_Embperl__Thread(*ppSV) ;
Branch: 3 branches
BranchTrueFalseTotal
pThread = epxs_sv2_Embperl__Thread(*ppSV) ; 0 0 0
pThread = epxs_sv2_Embperl__Thread(*ppSV) ; 0 0 0
pThread = epxs_sv2_Embperl__Thread(*ppSV) ; 0 0 0
288 }
289  
290 0 *ppThread = pThread ;
291 0 return ok ;
292 }
293  
294  
295  
296 /*---------------------------------------------------------------------------
297 * embperl_GetThread
298 */
299 /*!
300 *
301 * \_en
302 * Returns already has a azocitaed object thread object. The thread object
303 * must be setup before via embperl_SetupThread
304 * \endif
305 *
306 * \_de
307 * Liefert das diesem Thread zugeordnete Thread-Objekt zur?ck. Das Objekt mu?
308 * vorher mittels embperl_SetupThread initialisiert worden sein.
309 * \endif
310 *
311 * ------------------------------------------------------------------------ */
312  
313  
314  
315 0 tThreadData * embperl_GetThread (/*in*/ pTHX)
316  
317 {
318 tThreadData * pThread ;
319 int rc ;
320  
321 0 ▶ if ((rc = embperl_SetupThread (aTHX_ &pThread)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_SetupThread (aTHX_ &pThread)) != ok) 0 0 0
322 {
323 0 LogError (NULL, rc) ;
324 0 return NULL ;
325 }
326  
327 0 return pThread ;
328 }
329  
330 /*---------------------------------------------------------------------------
331 * embperl_EndPass1
332 */
333 /*!
334 *
335 * \_en
336 * Call when configuration pass 1 of apache is done.
337 * \endif
338 *
339 * \_de
340 * Wird aufgerufen wenn Pass 1 des Einlesens der Konfiguration beendet ist.
341 * \endif
342 *
343 * ------------------------------------------------------------------------ */
344  
345  
346  
347 0 int embperl_EndPass1 (void)
348  
349  
350 {
351 tThreadData * pThread ;
352 dTHX ;
353 0 pThread = embperl_GetThread (aTHX) ;
354
355 0 hv_clear (pThread -> pApplications) ;
356  
357 0 return ok ;
358 }
359  
360  
361 /*---------------------------------------------------------------------------
362 * embperl_CreateSessionObject
363 */
364 /*!
365 *
366 * \_en
367 * Creates a new session object.
368 *
369 * \endif
370 *
371 * \_de
372 * Erzeugt eine neues Sessionobjekt.
373 *
374 * \endif
375 *
376 * ------------------------------------------------------------------------ */
377  
378  
379  
380 0 static int embperl_CreateSessionObject(/*in*/ tApp * a,
381 /*in*/ HV * pArgs,
382 /*out*/ HV * * ppHash,
383 /*out*/ SV * * ppObj)
384  
385  
386 {
387 epaTHX_
388 0 dSP ;
389 0 tAppConfig * pCfg = &a -> Config ;
390 0 char * sPackage = pCfg -> sSessionHandlerClass ;
391 0 HV * pHash = newHV () ;
392 0 SV * pTie = NULL ;
393 int n ;
394 SV * pSVCode ;
395  
396 0 pSVCode = newSVpvf ("require %s", sPackage) ;
397 newSVpvf2(pSVCode) ;
398 /* there is no c api to the require function, eval it... */
399 0 perl_eval_sv(pSVCode, G_EVAL | G_DISCARD) ;
400 0 SvREFCNT_dec(pSVCode);
401 0 tainted = 0 ;
402  
403 0 ▶ if (SvTRUE (ERRSV))
Branch: 2 branches
BranchTrueFalseTotal
if (SvTRUE (ERRSV)) 0 0 0
if (SvTRUE (ERRSV)) 0 0 0
404 {
405 STRLEN l ;
406 0 if (strcmp (sPackage, "Apache::SessionX") != 0 ||
407 0 GetHashValueStr (aTHX_ a -> pThread -> pEnvHash, "GATEWAY_INTERFACE", NULL))
408 0 ▶ LogErrorParam (a, rcSetupSessionErr, SvPV (ERRSV, l), NULL) ;
Branch: 1 branch
BranchTrueFalseTotal
LogErrorParam (a, rcSetupSessionErr, SvPV (ERRSV, l), NULL) ; 0 0 0
409 0 ▶ sv_setpv(ERRSV,"");
Branch: 1 branch
BranchTrueFalseTotal
sv_setpv(ERRSV,""); 0 0 0
410 0 return rcEvalErr ;
411 }
412  
413 0 SPAGAIN;
414 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
415 0 ▶ XPUSHs(sv_2mortal(newSVpv(sPackage, 0)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSVpv(sPackage, 0))); 0 0 0
416 0 ▶ XPUSHs(&sv_undef); /* id */
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(&sv_undef); /* id */ 0 0 0
417 0 ▶ XPUSHs(sv_2mortal (newRV((SV *)pArgs)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal (newRV((SV *)pArgs))); 0 0 0
418 0 PUTBACK;
419 0 n = perl_call_method ("TIEHASH", G_EVAL | G_SCALAR) ;
420 0 SPAGAIN;
421 0 ▶ if (n > 0)
Branch: 1 branch
BranchTrueFalseTotal
if (n > 0) 0 0 0
422 0 pTie = POPs ;
423 0 PUTBACK;
424 0 ▶ if (SvTRUE (ERRSV))
Branch: 2 branches
BranchTrueFalseTotal
if (SvTRUE (ERRSV)) 0 0 0
if (SvTRUE (ERRSV)) 0 0 0
425 {
426 STRLEN l ;
427 0 ▶ LogErrorParam (a, rcSetupSessionErr, SvPV (ERRSV, l), NULL) ;
Branch: 1 branch
BranchTrueFalseTotal
LogErrorParam (a, rcSetupSessionErr, SvPV (ERRSV, l), NULL) ; 0 0 0
428 0 ▶ sv_setpv(ERRSV,"");
Branch: 1 branch
BranchTrueFalseTotal
sv_setpv(ERRSV,""); 0 0 0
429 0 return rcEvalErr ;
430 }
431 0 ▶ if (n == 0 || !SvROK(pTie))
Branch: 2 branches
BranchTrueFalseTotal
if (n == 0 || !SvROK(pTie)) 0 0 0
if (n == 0 || !SvROK(pTie)) 0 0 0
432 {
433 0 LogErrorParam (a, rcSetupSessionErr, "TIEHASH didn't returns a hashref", sPackage) ;
434 0 return rcNotHashRef ;
435 }
436 0 hv_magic(pHash, (GV *)pTie, 'P') ;
437  
438 0 *ppHash = pHash ;
439 0 *ppObj = SvREFCNT_inc(pTie) ;
440  
441 0 return ok ;
442 }
443  
444 /*---------------------------------------------------------------------------
445 * embperl_SetupSessionObjects
446 */
447 /*!
448 *
449 * \_en
450 * Setup the session onbjects.
451 *
452 * \endif
453 *
454 * \_de
455 * Initialisiert neue Sessionobjekte.
456 *
457 * \endif
458 *
459 * ------------------------------------------------------------------------ */
460  
461  
462  
463 0 int embperl_SetupSessionObjects (/*in*/ tApp * a)
464  
465  
466 {
467 epaTHX_
468 int rc ;
469 SV * pStore ;
470 SV ** ppStore ;
471 SV * pLocker ;
472 SV ** ppLocker ;
473 SV * pSerializer ;
474 SV ** ppSerializer ;
475 SV * pGenerator ;
476 SV ** ppGenerator ;
477 0 tAppConfig * pCfg = &a -> Config ;
478 0 HV * pArgs = pCfg -> pSessionArgs ;
479 HV * pArgs1 ;
480 HV * pArgs2 ;
481 HV * pArgs3 ;
482 0 dSP ;
483  
484
485 0 ▶ if (strcmp (pCfg -> sSessionHandlerClass, "no") == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (strcmp (pCfg -> sSessionHandlerClass, "no") == 0) 0 0 0
486 0 return ok ;
487  
488 0 ▶ if (!pArgs)
Branch: 1 branch
BranchTrueFalseTotal
if (!pArgs) 0 0 0
489 0 pCfg -> pSessionArgs = pArgs = newHV() ;
490
491 0 ▶ if (pCfg -> pSessionClasses)
Branch: 1 branch
BranchTrueFalseTotal
if (pCfg -> pSessionClasses) 0 0 0
492 {
493 0 ▶ if ((ppStore = av_fetch (pCfg -> pSessionClasses, 0, 0)))
Branch: 1 branch
BranchTrueFalseTotal
if ((ppStore = av_fetch (pCfg -> pSessionClasses, 0, 0))) 0 0 0
494 0 pStore = SvREFCNT_inc(*ppStore) ;
495 else
496 0 pStore = newSVpv("File", 4) ;
497 0 hv_store (pArgs, "Store", 5, pStore, 0) ;
498  
499 0 ▶ if ((ppLocker = av_fetch (pCfg -> pSessionClasses, 1, 0)))
Branch: 1 branch
BranchTrueFalseTotal
if ((ppLocker = av_fetch (pCfg -> pSessionClasses, 1, 0))) 0 0 0
500 0 pLocker = SvREFCNT_inc(*ppLocker) ;
501 else
502 0 pLocker = newSVpv("Null", 4) ;
503 0 hv_store (pArgs, "Lock", 4, pLocker, 0) ;
504  
505 0 ▶ if ((ppSerializer = av_fetch (pCfg -> pSessionClasses, 2, 0)))
Branch: 1 branch
BranchTrueFalseTotal
if ((ppSerializer = av_fetch (pCfg -> pSessionClasses, 2, 0))) 0 0 0
506 0 pSerializer = SvREFCNT_inc(*ppSerializer) ;
507 else
508 0 pSerializer = newSVpv("Storable", 8) ;
509 0 hv_store (pArgs, "Serialize", 9, pSerializer, 0) ;
510  
511 0 ▶ if ((ppGenerator = av_fetch (pCfg -> pSessionClasses, 3, 0)))
Branch: 1 branch
BranchTrueFalseTotal
if ((ppGenerator = av_fetch (pCfg -> pSessionClasses, 3, 0))) 0 0 0
512 0 pGenerator = SvREFCNT_inc(*ppGenerator) ;
513 else
514 0 pGenerator = newSVpv("MD5", 3) ;
515 0 hv_store (pArgs, "Generate", 8, pGenerator, 0) ;
516 }
517 else
518 {
519 /* workaround for perl bug in newHVhv when to less hash entries */
520 0 hv_store (pArgs, "__dummy1__", 10, newSViv (1), 0) ;
521 0 hv_store (pArgs, "__dummy2__", 10, newSViv (1), 0) ;
522 0 hv_store (pArgs, "__dummy3__", 10, newSViv (1), 0) ;
523 0 hv_store (pArgs, "__dummy4__", 10, newSViv (1), 0) ;
524 }
525  
526 0 ▶ if (pCfg -> sSessionConfig)
Branch: 1 branch
BranchTrueFalseTotal
if (pCfg -> sSessionConfig) 0 0 0
527 0 hv_store (pArgs, "config", 5, newSVpv (pCfg -> sSessionConfig, 0), 0) ;
528  
529 0 hv_store (pArgs, "lazy", 4, newSViv (1), 0) ;
530 0 hv_store (pArgs, "create_unknown", 14, newSViv (1), 0) ;
531  
532 0 pArgs1 = newHVhv(pArgs) ;
533 0 hv_store (pArgs1, "Transaction", 11, newSViv (1), 0) ;
534 0 pArgs2 = newHVhv(pArgs) ;
535 0 hv_store (pArgs2, "recreate_id", 11, newSViv (1), 0) ;
536 0 pArgs3 = newHVhv(pArgs2) ;
537  
538 0 ▶ if ((rc = embperl_CreateSessionObject (a, pArgs1, &a -> pAppHash, &a -> pAppObj)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_CreateSessionObject (a, pArgs1, &a -> pAppHash, &a -> pAppObj)) != ok) 0 0 0
539 0 return rc ;
540  
541 0 SPAGAIN ;
542 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
543 0 ▶ XPUSHs(a -> pAppObj);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(a -> pAppObj); 0 0 0
544 0 ▶ XPUSHs(sv_2mortal (newSVpv(a -> Config.sAppName, 0)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal (newSVpv(a -> Config.sAppName, 0))); 0 0 0
545 0 PUTBACK;
546 0 perl_call_method ("setidfrom", G_DISCARD) ;
547  
548 0 ▶ if ((rc = embperl_CreateSessionObject (a, pArgs2, &a -> pUserHash, &a -> pUserObj)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_CreateSessionObject (a, pArgs2, &a -> pUserHash, &a -> pUserObj)) != ok) 0 0 0
549 0 return rc ;
550  
551 0 hv_store (pArgs3, "newid", 5, newSViv (1), 0) ;
552  
553 0 ▶ if ((rc = embperl_CreateSessionObject (a, pArgs3, &a -> pStateHash, &a -> pStateObj)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_CreateSessionObject (a, pArgs3, &a -> pStateHash, &a -> pStateObj)) != ok) 0 0 0
554 0 return rc ;
555  
556  
557 0 return ok ;
558 }
559  
560  
561 /*---------------------------------------------------------------------------
562 * embperl_SetupApp
563 */
564 /*!
565 *
566 * \_en
567 * Setup an application object. Either take an existing one, if the
568 * application is already created for that thread or create a new
569 * one.
570 *
571 * @param pThread per thread data
572 * @param pApacheCfg apache configuration vector
573 * @param pPerlParam parameters passed from Perl
574 * \endif
575 *
576 * \_de
577 * Initialisiert ein Applicationobjekt. Entweder wird ein bereits bestehendes
578 * benutzt, oder falls nicht vorhanden, ein neues erzeugt.
579 *
580 * @param pThread per thread daten
581 * @param pApacheCfg apache Konfigurations Vector
582 * @param pPerlParam Parameter die von Perl aus ?bergeben wurden
583 * \endif
584 *
585 * ------------------------------------------------------------------------ */
586  
587  
588  
589 0 int embperl_SetupApp (/*in*/ pTHX_
590 /*in*/ tThreadData * pThread,
591 /*in*/ tApacheDirConfig * pApacheCfg,
592 /*in*/ SV * pPerlParam,
593 /*out*/tApp * * ppApp)
594  
595  
596 {
597 0 char * sAppName = NULL ;
598 0 tApp * pApp = NULL ;
599 0 HV * pParam = NULL ;
600  
601  
602 0 ▶ if (pPerlParam && SvROK(pPerlParam))
Branch: 2 branches
BranchTrueFalseTotal
if (pPerlParam && SvROK(pPerlParam)) 0 0 0
if (pPerlParam && SvROK(pPerlParam)) 0 0 0
603 {
604 0 pParam = (HV *)SvRV(pPerlParam) ;
605 0 sAppName = GetHashValueStr (aTHX_ pParam, "app_name", NULL) ;
606 0 ▶ if (!sAppName) // backward compability to broken appname
Branch: 1 branch
BranchTrueFalseTotal
if (!sAppName) // backward compability to broken appname 0 0 0
607 0 sAppName = GetHashValueStr (aTHX_ pParam, "appname", NULL) ;
608 }
609  
610 0 ▶ if (!sAppName)
Branch: 1 branch
BranchTrueFalseTotal
if (!sAppName) 0 0 0
611 {
612 #ifdef APACHE
613 if (pApacheCfg)
614 sAppName = embperl_GetApacheAppName (pApacheCfg) ;
615 else
616 #endif
617 0 sAppName = embperl_GetCGIAppName (pThread) ;
618 }
619
620 0 ▶ if (sAppName)
Branch: 1 branch
BranchTrueFalseTotal
if (sAppName) 0 0 0
621 0 pApp = (tApp * )GetHashValuePtr (NULL, pThread -> pApplications, sAppName, NULL) ;
622  
623
624 0 ▶ if (!pApp)
Branch: 1 branch
BranchTrueFalseTotal
if (!pApp) 0 0 0
625 {
626 int rc ;
627 SV * pAppSV ;
628 SV * pAppRV ;
629 SV * pSV ;
630 SV * pRV ;
631 tAppConfig * pCfg ;
632
633 0 tMemPool * pPool = ep_make_sub_pool (pThread -> pPool) ;
634  
635
636 0 epxs_Embperl__App_create_obj(pApp,pAppSV,pAppRV,ep_palloc(pPool,sizeof(*pApp))) ;
637 0 epxs_Embperl__App__Config_create_obj(pCfg,pSV,pRV,&pApp -> Config) ;
638 #ifdef PERL_IMPLICIT_CONTEXT
639 pApp -> pPerlTHX = aTHX ;
640 #endif
641 0 pApp -> pPool = pPool ;
642 0 pCfg -> pPool = pPool ;
643  
644 #ifdef APACHE
645 if (pApacheCfg)
646 embperl_GetApacheAppConfig (pThread, pPool, pApacheCfg, &pApp -> Config) ;
647 else
648 #endif
649 {
650 0 bool bUseEnv = 0 ;
651 0 bool bUseRedirectEnv = 0 ;
652 0 ▶ if (pParam)
Branch: 1 branch
BranchTrueFalseTotal
if (pParam) 0 0 0
653 {
654 0 bUseEnv = (bool)GetHashValueInt (aTHX_ pParam, "use_env", 0) ;
655 0 bUseRedirectEnv = (bool)GetHashValueInt (aTHX_ pParam, "use_redirect_env", 0) ;
656 }
657  
658 0 embperl_GetCGIAppConfig (pThread, pPool, &pApp -> Config, bUseEnv, bUseRedirectEnv, 1) ;
659 }
660  
661 0 SetHashValueInt (NULL, pThread -> pApplications, sAppName, (IV)pApp) ;
662
663 0 pApp -> pThread = pThread ;
664  
665 0 ▶ if (pParam)
Branch: 1 branch
BranchTrueFalseTotal
if (pParam) 0 0 0
666 0 Embperl__App__Config_new_init(aTHX_ &pApp -> Config, (SV *)pParam, 0) ;
667  
668 0 tainted = 0 ;
669  
670 0 ▶ if (pApp -> Config.sLog && pApp -> Config.sLog[0])
Branch: 2 branches
BranchTrueFalseTotal
if (pApp -> Config.sLog && pApp -> Config.sLog[0]) 0 0 0
if (pApp -> Config.sLog && pApp -> Config.sLog[0]) 0 0 0
671 {
672 0 ▶ if ((rc = OpenLog (pApp)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = OpenLog (pApp)) != ok) 0 0 0
673 {
674 0 pApp -> Config.bDebug = 0 ; /* Turn debbuging off, only errors will go to stderr */
675 0 LogErrorParam (pApp, rc, pApp -> Config.sLog, Strerror(errno)) ;
676 }
677 }
678  
679 0 ▶ if (pApp -> Config.sAppHandlerClass)
Branch: 1 branch
BranchTrueFalseTotal
if (pApp -> Config.sAppHandlerClass) 0 0 0
680 {
681 0 HV * stash = gv_stashpv(pApp -> Config.sAppHandlerClass, TRUE) ;
682 0 sv_bless(pApp -> _perlsv, stash) ;
683 }
684
685  
686 0 embperl_SetupSessionObjects (pApp) ;
687 }
688  
689 0 sv_setsv(pThread -> pAppRV, pApp -> _perlsv) ;
690
691 0 *ppApp = pApp ;
692  
693 0 return ok ;
694 }
695  
696  
697  
698 static int notused ;
699  
700 #if 0
701 INTMG (TabCount, pCurrReq -> TableStack.State.nCount, pCurrReq -> TableStack.State.nCountUsed, ;)
702 INTMG (TabRow, pCurrReq -> TableStack.State.nRow, pCurrReq -> TableStack.State.nRowUsed, ;)
703 INTMG (TabCol, pCurrReq -> TableStack.State.nCol, pCurrReq -> TableStack.State.nColUsed, ;)
704 INTMG (TabMaxRow, pCurrReq -> nTabMaxRow, notused, ;)
705 INTMG (TabMaxCol, pCurrReq -> nTabMaxCol, notused, ;)
706 INTMG (TabMode, pCurrReq -> nTabMode, notused, ;)
707 #endif
708 0 ▶INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV))
Branch: 11 branches
BranchTrueFalseTotal
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
INTMG_COMP (EscMode, Config.nEscMode, notused, NewEscMode (CurrReq, pSV)) 0 0 0
709 #ifdef EP2
710 0 ▶INTMGshort_COMP (CurrNode, xCurrNode)
Branch: 4 branches
BranchTrueFalseTotal
INTMGshort_COMP (CurrNode, xCurrNode) 0 0 0
INTMGshort_COMP (CurrNode, xCurrNode) 0 0 0
INTMGshort_COMP (CurrNode, xCurrNode) 0 0 0
INTMGshort_COMP (CurrNode, xCurrNode) 0 0 0
711 #endif
712  
713 0 ▶OPTMGRD_COMP (optDisableVarCleanup , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optDisableVarCleanup , Config.bOptions) 0 0 0
OPTMGRD_COMP (optDisableVarCleanup , Config.bOptions) 0 0 0
714 0 ▶OPTMG_COMP (optDisableEmbperlErrorPage, Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optDisableEmbperlErrorPage, Config.bOptions) 0 0 0
OPTMG_COMP (optDisableEmbperlErrorPage, Config.bOptions) 0 0 0
OPTMG_COMP (optDisableEmbperlErrorPage, Config.bOptions) 0 0 0
OPTMG_COMP (optDisableEmbperlErrorPage, Config.bOptions) 0 0 0
OPTMG_COMP (optDisableEmbperlErrorPage, Config.bOptions) 0 0 0
715 0 ▶OPTMG_COMP (optReturnError , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optReturnError , Config.bOptions) 0 0 0
OPTMG_COMP (optReturnError , Config.bOptions) 0 0 0
OPTMG_COMP (optReturnError , Config.bOptions) 0 0 0
OPTMG_COMP (optReturnError , Config.bOptions) 0 0 0
OPTMG_COMP (optReturnError , Config.bOptions) 0 0 0
716 0 ▶OPTMGRD_COMP (optSafeNamespace , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optSafeNamespace , Config.bOptions) 0 0 0
OPTMGRD_COMP (optSafeNamespace , Config.bOptions) 0 0 0
717 0 ▶OPTMGRD_COMP (optOpcodeMask , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optOpcodeMask , Config.bOptions) 0 0 0
OPTMGRD_COMP (optOpcodeMask , Config.bOptions) 0 0 0
718 0 ▶OPTMG_COMP (optRawInput , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optRawInput , Config.bOptions) 0 0 0
OPTMG_COMP (optRawInput , Config.bOptions) 0 0 0
OPTMG_COMP (optRawInput , Config.bOptions) 0 0 0
OPTMG_COMP (optRawInput , Config.bOptions) 0 0 0
OPTMG_COMP (optRawInput , Config.bOptions) 0 0 0
719 0 ▶OPTMG_COMP (optSendHttpHeader , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optSendHttpHeader , Config.bOptions) 0 0 0
OPTMG_COMP (optSendHttpHeader , Config.bOptions) 0 0 0
OPTMG_COMP (optSendHttpHeader , Config.bOptions) 0 0 0
OPTMG_COMP (optSendHttpHeader , Config.bOptions) 0 0 0
OPTMG_COMP (optSendHttpHeader , Config.bOptions) 0 0 0
720 0 ▶OPTMGRD_COMP (optDisableChdir , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optDisableChdir , Config.bOptions) 0 0 0
OPTMGRD_COMP (optDisableChdir , Config.bOptions) 0 0 0
721 0 ▶OPTMG_COMP (optDisableHtmlScan , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optDisableHtmlScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableHtmlScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableHtmlScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableHtmlScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableHtmlScan , Config.bOptions) 0 0 0
722 0 ▶OPTMGRD_COMP (optEarlyHttpHeader , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optEarlyHttpHeader , Config.bOptions) 0 0 0
OPTMGRD_COMP (optEarlyHttpHeader , Config.bOptions) 0 0 0
723 0 ▶OPTMGRD_COMP (optDisableFormData , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optDisableFormData , Config.bOptions) 0 0 0
OPTMGRD_COMP (optDisableFormData , Config.bOptions) 0 0 0
724 0 ▶OPTMG_COMP (optDisableInputScan , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optDisableInputScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableInputScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableInputScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableInputScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableInputScan , Config.bOptions) 0 0 0
725 0 ▶OPTMG_COMP (optDisableTableScan , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optDisableTableScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableTableScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableTableScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableTableScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableTableScan , Config.bOptions) 0 0 0
726 0 ▶OPTMG_COMP (optDisableMetaScan , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optDisableMetaScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableMetaScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableMetaScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableMetaScan , Config.bOptions) 0 0 0
OPTMG_COMP (optDisableMetaScan , Config.bOptions) 0 0 0
727 0 ▶OPTMGRD_COMP (optAllFormData , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optAllFormData , Config.bOptions) 0 0 0
OPTMGRD_COMP (optAllFormData , Config.bOptions) 0 0 0
728 0 ▶OPTMGRD_COMP (optRedirectStdout , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optRedirectStdout , Config.bOptions) 0 0 0
OPTMGRD_COMP (optRedirectStdout , Config.bOptions) 0 0 0
729 0 ▶OPTMG_COMP (optUndefToEmptyValue , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optUndefToEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optUndefToEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optUndefToEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optUndefToEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optUndefToEmptyValue , Config.bOptions) 0 0 0
730 0 ▶OPTMG_COMP (optNoHiddenEmptyValue , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optNoHiddenEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optNoHiddenEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optNoHiddenEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optNoHiddenEmptyValue , Config.bOptions) 0 0 0
OPTMG_COMP (optNoHiddenEmptyValue , Config.bOptions) 0 0 0
731 0 ▶OPTMGRD_COMP (optAllowZeroFilesize , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optAllowZeroFilesize , Config.bOptions) 0 0 0
OPTMGRD_COMP (optAllowZeroFilesize , Config.bOptions) 0 0 0
732 0 ▶OPTMGRD_COMP (optKeepSrcInMemory , Config.bOptions)
Branch: 2 branches
BranchTrueFalseTotal
OPTMGRD_COMP (optKeepSrcInMemory , Config.bOptions) 0 0 0
OPTMGRD_COMP (optKeepSrcInMemory , Config.bOptions) 0 0 0
733 0 ▶OPTMG_COMP (optKeepSpaces , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optKeepSpaces , Config.bOptions) 0 0 0
OPTMG_COMP (optKeepSpaces , Config.bOptions) 0 0 0
OPTMG_COMP (optKeepSpaces , Config.bOptions) 0 0 0
OPTMG_COMP (optKeepSpaces , Config.bOptions) 0 0 0
OPTMG_COMP (optKeepSpaces , Config.bOptions) 0 0 0
734 0 ▶OPTMG_COMP (optOpenLogEarly , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optOpenLogEarly , Config.bOptions) 0 0 0
OPTMG_COMP (optOpenLogEarly , Config.bOptions) 0 0 0
OPTMG_COMP (optOpenLogEarly , Config.bOptions) 0 0 0
OPTMG_COMP (optOpenLogEarly , Config.bOptions) 0 0 0
OPTMG_COMP (optOpenLogEarly , Config.bOptions) 0 0 0
735 0 ▶OPTMG_COMP (optNoUncloseWarn , Config.bOptions)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (optNoUncloseWarn , Config.bOptions) 0 0 0
OPTMG_COMP (optNoUncloseWarn , Config.bOptions) 0 0 0
OPTMG_COMP (optNoUncloseWarn , Config.bOptions) 0 0 0
OPTMG_COMP (optNoUncloseWarn , Config.bOptions) 0 0 0
OPTMG_COMP (optNoUncloseWarn , Config.bOptions) 0 0 0
736  
737  
738 0 ▶OPTMG_COMP (dbgStd , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgStd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgStd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgStd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgStd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgStd , Config.bDebug) 0 0 0
739 0 ▶OPTMG_COMP (dbgMem , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgMem , Config.bDebug) 0 0 0
OPTMG_COMP (dbgMem , Config.bDebug) 0 0 0
OPTMG_COMP (dbgMem , Config.bDebug) 0 0 0
OPTMG_COMP (dbgMem , Config.bDebug) 0 0 0
OPTMG_COMP (dbgMem , Config.bDebug) 0 0 0
740 0 ▶OPTMG_COMP (dbgEval , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEval , Config.bDebug) 0 0 0
741 0 ▶OPTMG_COMP (dbgCmd , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgCmd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgCmd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgCmd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgCmd , Config.bDebug) 0 0 0
OPTMG_COMP (dbgCmd , Config.bDebug) 0 0 0
742 0 ▶OPTMG_COMP (dbgEnv , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgEnv , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEnv , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEnv , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEnv , Config.bDebug) 0 0 0
OPTMG_COMP (dbgEnv , Config.bDebug) 0 0 0
743 0 ▶OPTMG_COMP (dbgForm , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgForm , Config.bDebug) 0 0 0
OPTMG_COMP (dbgForm , Config.bDebug) 0 0 0
OPTMG_COMP (dbgForm , Config.bDebug) 0 0 0
OPTMG_COMP (dbgForm , Config.bDebug) 0 0 0
OPTMG_COMP (dbgForm , Config.bDebug) 0 0 0
744 0 ▶OPTMG_COMP (dbgTab , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgTab , Config.bDebug) 0 0 0
OPTMG_COMP (dbgTab , Config.bDebug) 0 0 0
OPTMG_COMP (dbgTab , Config.bDebug) 0 0 0
OPTMG_COMP (dbgTab , Config.bDebug) 0 0 0
OPTMG_COMP (dbgTab , Config.bDebug) 0 0 0
745 0 ▶OPTMG_COMP (dbgInput , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgInput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgInput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgInput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgInput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgInput , Config.bDebug) 0 0 0
746 0 ▶OPTMG_COMP (dbgFlushOutput , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgFlushOutput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushOutput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushOutput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushOutput , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushOutput , Config.bDebug) 0 0 0
747 0 ▶OPTMG_COMP (dbgFlushLog , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgFlushLog , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushLog , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushLog , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushLog , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFlushLog , Config.bDebug) 0 0 0
748 0 ▶OPTMG_COMP (dbgAllCmds , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgAllCmds , Config.bDebug) 0 0 0
OPTMG_COMP (dbgAllCmds , Config.bDebug) 0 0 0
OPTMG_COMP (dbgAllCmds , Config.bDebug) 0 0 0
OPTMG_COMP (dbgAllCmds , Config.bDebug) 0 0 0
OPTMG_COMP (dbgAllCmds , Config.bDebug) 0 0 0
749 0 ▶OPTMG_COMP (dbgSource , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgSource , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSource , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSource , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSource , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSource , Config.bDebug) 0 0 0
750 0 ▶OPTMG_COMP (dbgFunc , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgFunc , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFunc , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFunc , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFunc , Config.bDebug) 0 0 0
OPTMG_COMP (dbgFunc , Config.bDebug) 0 0 0
751 0 ▶OPTMG_COMP (dbgLogLink , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgLogLink , Config.bDebug) 0 0 0
OPTMG_COMP (dbgLogLink , Config.bDebug) 0 0 0
OPTMG_COMP (dbgLogLink , Config.bDebug) 0 0 0
OPTMG_COMP (dbgLogLink , Config.bDebug) 0 0 0
OPTMG_COMP (dbgLogLink , Config.bDebug) 0 0 0
752 0 ▶OPTMG_COMP (dbgDefEval , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgDefEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgDefEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgDefEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgDefEval , Config.bDebug) 0 0 0
OPTMG_COMP (dbgDefEval , Config.bDebug) 0 0 0
753 0 ▶OPTMG_COMP (dbgHeadersIn , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgHeadersIn , Config.bDebug) 0 0 0
OPTMG_COMP (dbgHeadersIn , Config.bDebug) 0 0 0
OPTMG_COMP (dbgHeadersIn , Config.bDebug) 0 0 0
OPTMG_COMP (dbgHeadersIn , Config.bDebug) 0 0 0
OPTMG_COMP (dbgHeadersIn , Config.bDebug) 0 0 0
754 0 ▶OPTMG_COMP (dbgShowCleanup , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgShowCleanup , Config.bDebug) 0 0 0
OPTMG_COMP (dbgShowCleanup , Config.bDebug) 0 0 0
OPTMG_COMP (dbgShowCleanup , Config.bDebug) 0 0 0
OPTMG_COMP (dbgShowCleanup , Config.bDebug) 0 0 0
OPTMG_COMP (dbgShowCleanup , Config.bDebug) 0 0 0
755 0 ▶OPTMG_COMP (dbgProfile , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgProfile , Config.bDebug) 0 0 0
OPTMG_COMP (dbgProfile , Config.bDebug) 0 0 0
OPTMG_COMP (dbgProfile , Config.bDebug) 0 0 0
OPTMG_COMP (dbgProfile , Config.bDebug) 0 0 0
OPTMG_COMP (dbgProfile , Config.bDebug) 0 0 0
756 0 ▶OPTMG_COMP (dbgSession , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgSession , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSession , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSession , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSession , Config.bDebug) 0 0 0
OPTMG_COMP (dbgSession , Config.bDebug) 0 0 0
757 0 ▶OPTMG_COMP (dbgImport , Config.bDebug)
Branch: 5 branches
BranchTrueFalseTotal
OPTMG_COMP (dbgImport , Config.bDebug) 0 0 0
OPTMG_COMP (dbgImport , Config.bDebug) 0 0 0
OPTMG_COMP (dbgImport , Config.bDebug) 0 0 0
OPTMG_COMP (dbgImport , Config.bDebug) 0 0 0
OPTMG_COMP (dbgImport , Config.bDebug) 0 0 0
758  
759  
760
761 /* ---------------------------------------------------------------------------- */
762 /* add magic to integer var */
763 /* */
764 /* in sVarName = Name of varibale */
765 /* in pVirtTab = pointer to virtual table */
766 /* */
767 /* ---------------------------------------------------------------------------- */
768  
769 0 static int AddMagic (/*i/o*/ tApp * a,
770 /*in*/ char * sVarName,
771 /*in*/ MGVTBL * pVirtTab)
772  
773 {
774 SV * pSV ;
775 struct magic * pMagic ;
776 epaTHX ;
777  
778 EPENTRY (AddMagic) ;
779  
780
781 0 pSV = perl_get_sv (sVarName, TRUE) ;
782 0 sv_magic (pSV, NULL, 0, sVarName, strlen (sVarName)) ;
783 0 sv_setiv (pSV, 0) ;
784 0 pMagic = mg_find (pSV, 0) ;
785  
786 0 ▶ if (pMagic)
Branch: 1 branch
BranchTrueFalseTotal
if (pMagic) 0 0 0
787 0 pMagic -> mg_virtual = pVirtTab ;
788 else
789 {
790 0 LogError (NULL, rcMagicError) ;
791 0 return 1 ;
792 }
793  
794 0 perl_get_sv (sVarName, TRUE) ; /* avoid warning */
795  
796 0 return ok ;
797 }
798  
799
800 /* ---------------------------------------------------------------------------- */
801 /* add magic to array */
802 /* */
803 /* in sVarName = Name of varibale */
804 /* in pVirtTab = pointer to virtual table */
805 /* */
806 /* ---------------------------------------------------------------------------- */
807  
808 0 int AddMagicAV (/*i/o*/ register req * r,
809 /*in*/ char * sVarName,
810 /*in*/ MGVTBL * pVirtTab)
811  
812 {
813 SV * pSV ;
814 struct magic * pMagic ;
815 epTHX ;
816  
817 EPENTRY (AddMagicAV) ;
818  
819
820 0 pSV = (SV *)perl_get_av (sVarName, TRUE) ;
821 0 sv_magic (pSV, NULL, 'P', sVarName, strlen (sVarName)) ;
822 0 pMagic = mg_find (pSV, 0) ;
823  
824 0 ▶ if (pMagic)
Branch: 1 branch
BranchTrueFalseTotal
if (pMagic) 0 0 0
825 0 pMagic -> mg_virtual = pVirtTab ;
826 else
827 {
828 0 LogError (r, rcMagicError) ;
829 0 return 1 ;
830 }
831  
832  
833 0 return ok ;
834 }
835  
836  
837  
838 /* ---------------------------------------------------------------------------- */
839 /* init embperl module */
840 /* */
841 /* in nIOType = type of requested i/o */
842 /* */
843 /* ---------------------------------------------------------------------------- */
844  
845 0 int embperl_Init (/*in*/ pTHX_
846 /*in*/ SV * pApacheSrvSV,
847 /*in*/ SV * pPerlParam,
848 /*in*/ server_rec * ap_s)
849  
850 {
851 int rc ;
852 tThreadData * pThread ;
853 tApp * pApp ;
854 0 tApacheDirConfig * pApacheCfg = NULL ;
855  
856  
857 0 memcpy (&ep_sv_undef, &PL_sv_undef, sizeof (PL_sv_undef)) ;
858  
859 #ifdef APACHE
860 if (pApacheSrvSV && SvROK (pApacheSrvSV))
861 {
862 /* when running under mod_perl only register the module */
863 /* rest will be call from module initialzation when config has been read */
864 ap_s = epxs_sv2_Apache__Server(pApacheSrvSV) ;
865 embperl_ApacheAddModule () ;
866 #ifdef APACHE2
867 #else
868 return ok ;
869 #endif
870 }
871 #endif
872  
873 0 ▶ if (!pMainPool)
Branch: 1 branch
BranchTrueFalseTotal
if (!pMainPool) 0 0 0
874 0 pMainPool = ep_init_alloc() ;
875
876 0 ▶ if ((rc = embperl_SetupThread (aTHX_ &pThread)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_SetupThread (aTHX_ &pThread)) != ok) 0 0 0
877 0 return rc ;
878
879 #ifdef APACHE
880 if (ap_s)
881 {
882 embperl_GetApacheConfig (pThread, NULL, ap_s, &pApacheCfg) ;
883 }
884 #endif
885  
886 0 ▶ if ((rc = embperl_SetupApp (aTHX_ pThread, pApacheCfg, pPerlParam, &pApp)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_SetupApp (aTHX_ pThread, pApacheCfg, pPerlParam, &pApp)) != ok) 0 0 0
887 0 return rc ;
888
889  
890  
891 0 ▶ ADDINTMG (EscMode)
Branch: 1 branch
BranchTrueFalseTotal
ADDINTMG (EscMode) 0 0 0
892 0 ▶ ADDINTMG (CurrNode)
Branch: 1 branch
BranchTrueFalseTotal
ADDINTMG (CurrNode) 0 0 0
893
894 0 ▶ ADDOPTMG (optDisableVarCleanup )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableVarCleanup ) 0 0 0
895 0 ▶ ADDOPTMG (optDisableEmbperlErrorPage)
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableEmbperlErrorPage) 0 0 0
896 0 ▶ ADDOPTMG (optReturnError)
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optReturnError) 0 0 0
897 0 ▶ ADDOPTMG (optSafeNamespace )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optSafeNamespace ) 0 0 0
898 0 ▶ ADDOPTMG (optOpcodeMask )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optOpcodeMask ) 0 0 0
899 0 ▶ ADDOPTMG (optRawInput )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optRawInput ) 0 0 0
900 0 ▶ ADDOPTMG (optSendHttpHeader )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optSendHttpHeader ) 0 0 0
901 0 ▶ ADDOPTMG (optDisableChdir )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableChdir ) 0 0 0
902 0 ▶ ADDOPTMG (optDisableHtmlScan )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableHtmlScan ) 0 0 0
903 0 ▶ ADDOPTMG (optEarlyHttpHeader )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optEarlyHttpHeader ) 0 0 0
904 0 ▶ ADDOPTMG (optDisableFormData )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableFormData ) 0 0 0
905 0 ▶ ADDOPTMG (optDisableInputScan )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableInputScan ) 0 0 0
906 0 ▶ ADDOPTMG (optDisableTableScan )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableTableScan ) 0 0 0
907 0 ▶ ADDOPTMG (optDisableMetaScan )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optDisableMetaScan ) 0 0 0
908 0 ▶ ADDOPTMG (optAllFormData )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optAllFormData ) 0 0 0
909 0 ▶ ADDOPTMG (optRedirectStdout )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optRedirectStdout ) 0 0 0
910 0 ▶ ADDOPTMG (optUndefToEmptyValue )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optUndefToEmptyValue ) 0 0 0
911 0 ▶ ADDOPTMG (optNoHiddenEmptyValue )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optNoHiddenEmptyValue ) 0 0 0
912 0 ▶ ADDOPTMG (optAllowZeroFilesize )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optAllowZeroFilesize ) 0 0 0
913 0 ▶ ADDOPTMG (optKeepSrcInMemory )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optKeepSrcInMemory ) 0 0 0
914 0 ▶ ADDOPTMG (optKeepSpaces )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optKeepSpaces ) 0 0 0
915 0 ▶ ADDOPTMG (optOpenLogEarly )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optOpenLogEarly ) 0 0 0
916 0 ▶ ADDOPTMG (optNoUncloseWarn )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (optNoUncloseWarn ) 0 0 0
917  
918 0 ▶ ADDOPTMG (dbgStd )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgStd ) 0 0 0
919 0 ▶ ADDOPTMG (dbgMem )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgMem ) 0 0 0
920 0 ▶ ADDOPTMG (dbgEval )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgEval ) 0 0 0
921 0 ▶ ADDOPTMG (dbgCmd )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgCmd ) 0 0 0
922 0 ▶ ADDOPTMG (dbgEnv )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgEnv ) 0 0 0
923 0 ▶ ADDOPTMG (dbgForm )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgForm ) 0 0 0
924 0 ▶ ADDOPTMG (dbgTab )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgTab ) 0 0 0
925 0 ▶ ADDOPTMG (dbgInput )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgInput ) 0 0 0
926 0 ▶ ADDOPTMG (dbgFlushOutput )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgFlushOutput ) 0 0 0
927 0 ▶ ADDOPTMG (dbgFlushLog )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgFlushLog ) 0 0 0
928 0 ▶ ADDOPTMG (dbgAllCmds )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgAllCmds ) 0 0 0
929 0 ▶ ADDOPTMG (dbgSource )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgSource ) 0 0 0
930 0 ▶ ADDOPTMG (dbgFunc )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgFunc ) 0 0 0
931 0 ▶ ADDOPTMG (dbgLogLink )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgLogLink ) 0 0 0
932 0 ▶ ADDOPTMG (dbgDefEval )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgDefEval ) 0 0 0
933 0 ▶ ADDOPTMG (dbgHeadersIn )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgHeadersIn ) 0 0 0
934 0 ▶ ADDOPTMG (dbgShowCleanup )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgShowCleanup ) 0 0 0
935 0 ▶ ADDOPTMG (dbgProfile )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgProfile ) 0 0 0
936 0 ▶ ADDOPTMG (dbgSession )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgSession ) 0 0 0
937 0 ▶ ADDOPTMG (dbgImport )
Branch: 1 branch
BranchTrueFalseTotal
ADDOPTMG (dbgImport ) 0 0 0
938
939 0 ▶ if (bInitDone)
Branch: 1 branch
BranchTrueFalseTotal
if (bInitDone) 0 0 0
940 0 return ok ; /* the rest needs to be done only once per process */
941  
942 #if defined (_MDEBUG) && defined (WIN32)
943 _CrtSetReportHook( EmbperlCRTDebugOutput );
944 #endif
945  
946 0 DomInit (pApp) ;
947 0 Cache_Init (pApp) ;
948 0 Provider_Init (pApp) ;
949 #ifdef APACHE2
950 ApFilter_Init (pApp) ;
951 #endif
952 #ifdef XALAN
953 embperl_Xalan_Init () ;
954 #endif
955 #ifdef LIBXSLT
956 embperl_LibXSLT_Init () ;
957 #endif
958  
959 ep_create_mutex(RequestCountMutex) ;
960
961 0 bInitDone = 1 ;
962  
963 #ifdef APACHE
964 {
965 int preload = 1 ;
966 if (ap_s)
967 {
968 module * m ;
969 if ((m = ap_find_linked_module("mod_perl.c")))
970 {
971 if (m -> dynamic_load_handle)
972 preload = 0 ;
973 }
974 }
975 if (preload)
976 {
977 dSP;
978 PUSHMARK(sp) ;
979 perl_call_pv ("Embperl::PreLoadFiles", G_DISCARD) ;
980 }
981 }
982 #else
983 {
984 0 dSP;
985 0 ▶ PUSHMARK(sp) ;
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp) ; 0 0 0
986 0 perl_call_pv ("Embperl::PreLoadFiles", G_DISCARD) ;
987 }
988 #endif
989
990  
991 0 return rc ;
992 }
993
994  
995 /*---------------------------------------------------------------------------
996 * embperl_GetFormData
997 */
998 /*!
999 *
1000 * \_en
1001 * Takes the given form data and put them in %fdat/@ffld
1002 * \endif
1003 *
1004 * \_de
1005 * Nimmt die ?bergebenen Formulardaten und legt sie in %fdat/@ffld ab
1006 * \endif
1007 *
1008 * ------------------------------------------------------------------------ */
1009  
1010 0 static int embperl_GetFormData (/*i/o*/ register req * r,
1011 /*in*/ char * pQueryString,
1012 /*in*/ int nLen)
1013  
1014 {
1015 int num ;
1016 char * p ;
1017 char * pMem ;
1018 int nVal ;
1019 int nKey ;
1020 char * pKey ;
1021 char * pVal ;
1022 SV * pSVV ;
1023 SV * pSVK ;
1024 SV * * ppSV ;
1025  
1026 0 AV * pFormArray = r -> pThread -> pFormArray ;
1027 0 HV * pFormHash = r -> pThread -> pFormHash ;
1028 0 bool bAll = (r -> Config.bOptions & optAllFormData) != 0 ;
1029 0 bool bNoUtf8 = (r -> Config.bOptions & optFormDataNoUtf8) != 0 ;
1030 0 bool bDebug = (r -> Config.bDebug & dbgForm) != 0 ;
1031 0 int mayutf8 = 0 ;
1032 0 bool bInValue = 0 ;
1033 char c ;
1034 epTHX ;
1035  
1036 0 ▶ if (nLen == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (nLen == 0) 0 0 0
1037 0 return ok ;
1038
1039 0 ▶ if ((pMem = _malloc (r, nLen + 4)) == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if ((pMem = _malloc (r, nLen + 4)) == NULL) 0 0 0
1040 0 return rcOutOfMemory ;
1041  
1042 0 p = pMem ;
1043  
1044  
1045 0 nKey = nVal = 0 ;
1046 0 pKey = pVal = p ;
1047 while (1)
1048 {
1049 0 ▶ switch (nLen > 0?*pQueryString:'\0')
Branch: 1 branch
BranchTrueFalseTotal
switch (nLen > 0?*pQueryString:'\0') 0 0 0
1050 {
1051 0 case '+':
1052 0 pQueryString++ ;
1053 0 nLen-- ;
1054 0 *p++ = ' ' ;
1055 0 break ;
1056
1057 0 case '%':
1058 0 pQueryString++ ;
1059 0 nLen-- ;
1060 0 num = 0 ;
1061 0 ▶ if (*pQueryString)
Branch: 1 branch
BranchTrueFalseTotal
if (*pQueryString) 0 0 0
1062 {
1063 0 ▶ if (toupper (*pQueryString) >= 'A')
Branch: 1 branch
BranchTrueFalseTotal
if (toupper (*pQueryString) >= 'A') 0 0 0
1064 0 num += (toupper (*pQueryString) - 'A' + 10) << 4 ;
1065 else
1066 0 num += ((*pQueryString) - '0') << 4 ;
1067 0 pQueryString++ ;
1068 }
1069 0 ▶ if (*pQueryString)
Branch: 1 branch
BranchTrueFalseTotal
if (*pQueryString) 0 0 0
1070 {
1071 0 ▶ if (toupper (*pQueryString) >= 'A')
Branch: 1 branch
BranchTrueFalseTotal
if (toupper (*pQueryString) >= 'A') 0 0 0
1072 0 num += (toupper (*pQueryString) - 'A' + 10) ;
1073 else
1074 0 num += ((*pQueryString) - '0') ;
1075 0 pQueryString++ ;
1076 0 nLen-- ;
1077 }
1078 0 *p++ = num ;
1079 0 break ;
1080 0 case ';':
1081 case '&':
1082 0 bInValue = 0 ;
1083 0 pQueryString++ ;
1084 0 nLen-- ;
1085 0 case '\0':
1086 0 nVal = p - pVal ;
1087 0 *p++ = '\0' ;
1088
1089 0 ▶ if (nKey > 0 && (nVal > 0 || (bAll)))
Branch: 3 branches
BranchTrueFalseTotal
if (nKey > 0 && (nVal > 0 || (bAll))) 0 0 0
if (nKey > 0 && (nVal > 0 || (bAll))) 0 0 0
if (nKey > 0 && (nVal > 0 || (bAll))) 0 0 0
1090 {
1091 0 char * sid = NULL ;
1092 0 sid = r -> pApp -> Config.sCookieName ;
1093 0 ▶ if (sid)
Branch: 1 branch
BranchTrueFalseTotal
if (sid) 0 0 0
1094 { /* remove session id */
1095 0 ▶ if (strncmp (pKey, sid, nKey) != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (strncmp (pKey, sid, nKey) != 0) 0 0 0
1096 0 sid = NULL ;
1097 else
1098 {
1099 0 char * p = strchr(pVal, ':') ;
1100 0 ▶ if (p && *p)
Branch: 2 branches
BranchTrueFalseTotal
if (p && *p) 0 0 0
if (p && *p) 0 0 0
1101 {
1102 0 char * p2 = strchr(p+1, ':') ;
1103 0 ▶ if (p2)
Branch: 1 branch
BranchTrueFalseTotal
if (p2) 0 0 0
1104 0 *p2 = '\0' ;
1105 0 r -> sSessionUserID = ep_pstrdup (r -> pPool, p + 1) ;
1106 0 *p = '\0' ;
1107 }
1108 0 ▶ if (*pVal)
Branch: 1 branch
BranchTrueFalseTotal
if (*pVal) 0 0 0
1109 0 r -> sSessionStateID = ep_pstrdup (r -> pPool, pVal) ;
1110 }
1111 }
1112  
1113 0 ▶ if (sid == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if (sid == NULL) 0 0 0
1114 { /* field is not the session id */
1115 0 ▶ if (pVal > pKey)
Branch: 1 branch
BranchTrueFalseTotal
if (pVal > pKey) 0 0 0
1116 0 pVal[-1] = '\0' ;
1117
1118 0 ▶ if ((ppSV = hv_fetch (pFormHash, pKey, nKey, 0)))
Branch: 1 branch
BranchTrueFalseTotal
if ((ppSV = hv_fetch (pFormHash, pKey, nKey, 0))) 0 0 0
1119 { /* Field exists already -> append separator and field value */
1120 0 sv_catpvn (*ppSV, &r -> Config.cMultFieldSep , 1) ;
1121 0 sv_catpvn (*ppSV, pVal, nVal) ;
1122 }
1123 else
1124 { /* New Field -> store it */
1125 0 pSVV = newSVpv (pVal, nVal) ;
1126 #ifdef UTF8_IS_START
1127 0 ▶ if (mayutf8 && is_utf8_string((U8*)pVal, nVal))
Branch: 2 branches
BranchTrueFalseTotal
if (mayutf8 && is_utf8_string((U8*)pVal, nVal)) 0 0 0
if (mayutf8 && is_utf8_string((U8*)pVal, nVal)) 0 0 0
1128 0 SvUTF8_on (pSVV) ;
1129 #endif
1130 0 ▶ if (hv_store (pFormHash, pKey, nKey, pSVV, 0) == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if (hv_store (pFormHash, pKey, nKey, pSVV, 0) == NULL) 0 0 0
1131 {
1132 0 _free (r, pMem) ;
1133 0 strcpy (r -> errdat1, "fdat") ;
1134 0 return rcHashError ;
1135 }
1136  
1137 0 pSVK = newSVpv (pKey, nKey) ;
1138  
1139 0 av_push (pFormArray, pSVK) ;
1140 }
1141  
1142
1143 0 ▶ if (bDebug)
Branch: 1 branch
BranchTrueFalseTotal
if (bDebug) 0 0 0
1144 0 lprintf (r -> pApp, "[%d]FORM: %s=%s\n", r -> pThread -> nPid, pKey, pVal) ;
1145 }
1146 }
1147 0 pKey = pVal = p ;
1148 0 nKey = nVal = 0 ;
1149 0 mayutf8 = 0 ;
1150
1151 0 ▶ if (*pQueryString == '\0')
Branch: 1 branch
BranchTrueFalseTotal
if (*pQueryString == '\0') 0 0 0
1152 {
1153 0 _free (r, pMem) ;
1154 0 return ok ;
1155 }
1156
1157
1158 0 break ;
1159 0 case '=':
1160 0 ▶ if (!bInValue)
Branch: 1 branch
BranchTrueFalseTotal
if (!bInValue) 0 0 0
1161 {
1162 0 nKey = p - pKey ;
1163 0 *p++ = r -> Config.cMultFieldSep ;
1164 0 nVal = 0 ;
1165 0 pVal = p ;
1166 0 pQueryString++ ;
1167 0 nLen-- ;
1168 0 bInValue = 1 ;
1169 0 break ;
1170 }
1171 /* fall through */
1172 default:
1173 0 c = *p++ = *pQueryString++ ;
1174 0 nLen-- ;
1175 #ifdef UTF8_IS_START
1176 0 ▶ if (!bNoUtf8)
Branch: 1 branch
BranchTrueFalseTotal
if (!bNoUtf8) 0 0 0
1177 0 mayutf8 += UTF8_IS_START(c) ;
1178 #endif
1179 0 break ;
1180 }
1181 }
1182  
1183 return ok ;
1184 }
1185  
1186  
1187 /*---------------------------------------------------------------------------
1188 * embperl_SetupFormData
1189 */
1190 /*!
1191 *
1192 * \_en
1193 * Get the posted form data and put them in %fdat/@ffld
1194 * \endif
1195 *
1196 * \_de
1197 * Lie?t die formular daten ein und legt sie in %fdat/@ffld ab
1198 * \endif
1199 *
1200 * ------------------------------------------------------------------------ */
1201  
1202  
1203 0 static int embperl_SetupFormData (/*i/o*/ register req * r)
1204  
1205 {
1206 epTHX_
1207 0 char * p = NULL ;
1208 char * f ;
1209 0 int rc = ok ;
1210 0 STRLEN len = 0 ;
1211 char sLen [20] ;
1212 const char * sType ;
1213  
1214 0 hv_clear (r -> pThread -> pFormHash) ;
1215 0 hv_clear (r -> pThread -> pFormSplitHash) ;
1216 0 av_clear (r -> pThread -> pFormArray) ;
1217 0 hv_clear (r -> pThread -> pInputHash) ;
1218  
1219 0 ▶ if (r -> Config.bOptions & optDisableFormData)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Config.bOptions & optDisableFormData) 0 0 0
1220 0 return ok ;
1221
1222 /* print out of env set tainted, so reset it now */
1223 0 tainted = 0 ;
1224  
1225 #ifdef APACHE
1226 if (r -> pApacheReq)
1227 {
1228 const char * sLength = apr_table_get(r -> pApacheReq->headers_in, "Content-Length") ;
1229 sType = apr_table_get(r -> pApacheReq->headers_in, "Content-Type") ;
1230 len = sLength?atoi (sLength):0 ;
1231 }
1232 else
1233 #endif
1234 {
1235 0 sLen [0] = '\0' ;
1236 0 GetHashValue (r, r -> pThread -> pEnvHash, "CONTENT_LENGTH", sizeof (sLen) - 1, sLen) ;
1237 0 sType = GetHashValueStr (aTHX_ r -> pThread -> pEnvHash, "CONTENT_TYPE", "") ;
1238 0 len = atoi (sLen) ;
1239 }
1240  
1241 0 ▶ if (sType && strncmp (sType, "multipart/form-data", 19) == 0)
Branch: 2 branches
BranchTrueFalseTotal
if (sType && strncmp (sType, "multipart/form-data", 19) == 0) 0 0 0
if (sType && strncmp (sType, "multipart/form-data", 19) == 0) 0 0 0
1242 {
1243 0 dSP ;
1244  
1245 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
1246 0 ▶ XPUSHs(r -> _perlsv);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(r -> _perlsv); 0 0 0
1247 0 PUTBACK;
1248 0 perl_call_method ("get_multipart_formdata", G_EVAL) ;
1249 0 ▶ if (SvTRUE (ERRSV))
Branch: 2 branches
BranchTrueFalseTotal
if (SvTRUE (ERRSV)) 0 0 0
if (SvTRUE (ERRSV)) 0 0 0
1250 {
1251 STRLEN l ;
1252 0 ▶ strncpy (r -> errdat1, SvPV (ERRSV, l), sizeof (r -> errdat1) - 1) ;
Branch: 1 branch
BranchTrueFalseTotal
strncpy (r -> errdat1, SvPV (ERRSV, l), sizeof (r -> errdat1) - 1) ; 0 0 0
1253 0 LogError (r, rcEvalErr) ;
1254 0 ▶ sv_setpv(ERRSV,"");
Branch: 1 branch
BranchTrueFalseTotal
sv_setpv(ERRSV,""); 0 0 0
1255 0 POPs ; /* cleanup stack */
1256 }
1257 0 tainted = 0 ;
1258 0 return ok ;
1259 }
1260
1261 0 ▶ if (len > MAX_FORMDATA_SIZE)
Branch: 1 branch
BranchTrueFalseTotal
if (len > MAX_FORMDATA_SIZE) 0 0 0
1262 {
1263 0 LogErrorParam (r, rcFormDataTruncated, MAX_FORMDATA_SIZE_STR, NULL) ;
1264 0 len = MAX_FORMDATA_SIZE ;
1265 }
1266  
1267 0 ▶ if (len == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (len == 0) 0 0 0
1268 {
1269 0 p = r -> Param.sQueryInfo ;
1270 0 ▶ len = p?strlen (p):0 ;
Branch: 1 branch
BranchTrueFalseTotal
len = p?strlen (p):0 ; 0 0 0
1271 0 f = NULL ;
1272 }
1273 else
1274 {
1275 0 ▶ if ((p = _malloc (r, len + 1)) == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if ((p = _malloc (r, len + 1)) == NULL) 0 0 0
1276 0 return rcOutOfMemory ;
1277  
1278 0 ▶ if ((rc = OpenInput (r, NULL)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = OpenInput (r, NULL)) != ok) 0 0 0
1279 {
1280 0 _free (r, p) ;
1281 0 return rc ;
1282 }
1283 0 iread (r, p, len) ;
1284 0 CloseInput (r) ;
1285
1286 0 p[len] = '\0' ;
1287 0 f = p ;
1288 }
1289
1290 0 ▶ if (r -> Config.bDebug & dbgForm)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Config.bDebug & dbgForm) 0 0 0
1291 0 lprintf (r -> pApp, "[%d]Formdata... length = %d\n", r -> pThread -> nPid, len) ;
1292  
1293 0 rc = embperl_GetFormData (r, p, len) ;
1294
1295 0 ▶ if (len > 0 && f)
Branch: 2 branches
BranchTrueFalseTotal
if (len > 0 && f) 0 0 0
if (len > 0 && f) 0 0 0
1296 {
1297 0 r -> Param.sQueryInfo = f ;
1298 0 f[len] = '\0' ;
1299 }
1300  
1301 0 return rc ;
1302 }
1303  
1304  
1305 /*---------------------------------------------------------------------------
1306 * embperl_LogStartReq
1307 */
1308 /*!
1309 *
1310 * \_en
1311 * Log request startup, headers and environment
1312 * \endif
1313 *
1314 * \_de
1315 * Logged den Requeststart, HTTP-Header und Umgebungsvariablen
1316 * \endif
1317 *
1318 * ------------------------------------------------------------------------ */
1319  
1320  
1321 0 static void embperl_LogStartReq (/*i/o*/ req * r)
1322  
1323 {
1324 epTHX ;
1325
1326 0 ▶ if (r -> Config.bDebug)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Config.bDebug) 0 0 0
1327 {
1328 0 time_t t = time(NULL) ;
1329 0 lprintf (r -> pApp, "[%d]REQ: ***** Start Request at %s", r -> pThread -> nPid, ctime (&t)) ;
1330 0 lprintf (r -> pApp, "[%d]Use App: %s\n", r -> pApp -> pThread -> nPid, r -> pApp -> Config.sAppName) ;
1331 }
1332  
1333  
1334  
1335 #ifdef APACHE
1336 if (r -> pApacheReq && (r -> Config.bDebug & dbgHeadersIn))
1337 {
1338 int i;
1339 const apr_array_header_t *hdrs_arr;
1340 apr_table_entry_t *hdrs;
1341  
1342 hdrs_arr = apr_table_elts (r -> pApacheReq->headers_in);
1343 hdrs = (apr_table_entry_t *)hdrs_arr->elts;
1344  
1345 lprintf (r -> pApp, "[%d]HDR: %d\n", r -> pThread -> nPid, hdrs_arr->nelts) ;
1346 for (i = 0; i < hdrs_arr->nelts; ++i)
1347 if (hdrs[i].key)
1348 lprintf (r -> pApp, "[%d]HDR: %s=%s\n", r -> pThread -> nPid, hdrs[i].key, hdrs[i].val) ;
1349 }
1350 #endif
1351 0 ▶ if (r -> Config.bDebug & dbgEnv)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Config.bDebug & dbgEnv) 0 0 0
1352 {
1353 SV * psv ;
1354 HE * pEntry ;
1355 char * pKey ;
1356 I32 l ;
1357 0 int savewarn = dowarn ;
1358 0 dowarn = 0 ; /* no warnings here */
1359
1360 0 hv_iterinit (r -> pThread -> pEnvHash) ;
1361 0 ▶ while ((pEntry = hv_iternext (r -> pThread -> pEnvHash)))
Branch: 1 branch
BranchTrueFalseTotal
while ((pEntry = hv_iternext (r -> pThread -> pEnvHash))) 0 0 0
1362 {
1363 0 pKey = hv_iterkey (pEntry, &l) ;
1364 0 psv = hv_iterval (r -> pThread -> pEnvHash, pEntry) ;
1365  
1366 0 lprintf (r -> pApp, "[%d]ENV: %s=%s\n", r -> pThread -> nPid, pKey, SvPV (psv, na)) ;
1367 }
1368 0 dowarn = savewarn ;
1369 }
1370  
1371 0 }
1372  
1373  
1374  
1375 /*---------------------------------------------------------------------------
1376 * embperl_SetupRequest
1377 */
1378 /*!
1379 *
1380 * \_en
1381 * setup data for (http-)request object
1382 * \endif
1383 *
1384 * \_de
1385 * Initialisiert das Requestobjekt
1386 * \endif
1387 *
1388 * ------------------------------------------------------------------------ */
1389  
1390  
1391 0 int embperl_SetupRequest (/*in*/ pTHX_
1392 /*in*/ SV * pApacheReqSV,
1393 /*in*/ tApp * pApp,
1394 /*in*/ tApacheDirConfig * pApacheCfg,
1395 /*in*/ SV * pPerlParam,
1396 /*out*/tReq * * ppReq)
1397
1398
1399 {
1400 tReq * r ;
1401 tThreadData * pThread ;
1402 SV * pReqSV ;
1403 SV * pReqRV ;
1404 SV * pSV ;
1405 SV * pRV ;
1406 tReqConfig * pConfig ;
1407 tReqParam * pParam ;
1408 char * pCookieName ;
1409 0 HV * pParamHV = NULL ;
1410 0 dSP ;
1411  
1412 #ifdef APACHE
1413 request_rec * pApacheReq ;
1414 #endif
1415 0 tMemPool * pPool = ep_make_sub_pool (pApp -> pPool) ;
1416  
1417 0 tainted = 0 ;
1418  
1419 0 ▶ if (pPerlParam && SvROK(pPerlParam))
Branch: 2 branches
BranchTrueFalseTotal
if (pPerlParam && SvROK(pPerlParam)) 0 0 0
if (pPerlParam && SvROK(pPerlParam)) 0 0 0
1420 0 pParamHV = (HV *)SvRV(pPerlParam) ;
1421  
1422 0 epxs_Embperl__Req_create_obj(r,pReqSV,pReqRV,ep_palloc(pPool,sizeof(*r))) ;
1423 0 epxs_Embperl__Req__Config_create_obj(pConfig,pSV,pRV,&r->Config) ;
1424 0 epxs_Embperl__Req__Param_create_obj(pParam,pSV,pRV,&r->Param) ;
1425 #ifdef PERL_IMPLICIT_CONTEXT
1426 r -> pPerlTHX = aTHX ;
1427 #endif
1428 0 r -> pPool = pPool ;
1429 0 pConfig -> pPool = pPool ;
1430 0 pParam -> pPool = pPool ;
1431  
1432 0 r -> pApp = pApp ;
1433 0 pThread = r -> pThread = pApp -> pThread ;
1434 0 r -> pPrevReq = pThread -> pCurrReq ;
1435 0 pThread -> pCurrReq = r ;
1436 0 pApp -> pCurrReq = r ;
1437 0 sv_setsv(pThread -> pReqRV, r -> _perlsv) ;
1438
1439 0 r -> startclock = clock () ;
1440 0 r -> stsv_count = sv_count ;
1441  
1442 #ifdef PERL_IMPLICIT_CONTEXT
1443 r -> pPerlTHX = aTHX ;
1444 #endif
1445  
1446  
1447
1448 #ifdef APACHE
1449 if (SvROK (pApacheReqSV))
1450 pApacheReq = r -> pApacheReq = (request_rec *)SvIV((SV*)SvRV(pApacheReqSV));
1451 else
1452 pApacheReq = r -> pApacheReq = NULL ;
1453 r -> pApacheReqSV = SvREFCNT_inc(pApacheReqSV) ;
1454 if (pApacheReq)
1455 {
1456 embperl_GetApacheReqConfig (pApp, pPool, pApacheCfg, &r -> Config) ;
1457 embperl_GetApacheReqParam (pApp, pPool, pApacheReq, &r -> Param) ;
1458 }
1459 else
1460 #endif
1461 {
1462 0 bool bUseEnv = 0 ;
1463 0 bool bUseRedirectEnv = 0 ;
1464 0 ▶ if (pParamHV)
Branch: 1 branch
BranchTrueFalseTotal
if (pParamHV) 0 0 0
1465 {
1466 0 bUseEnv = (bool)GetHashValueInt (aTHX_ pParamHV, "use_env", 0) ;
1467 0 bUseRedirectEnv = (bool)GetHashValueInt (aTHX_ pParamHV, "use_redirect_env", 0) ;
1468 }
1469 0 embperl_GetCGIReqConfig (pApp, pPool, &r -> Config, bUseEnv, bUseRedirectEnv, 1) ;
1470 0 embperl_GetCGIReqParam (pApp, pPool, &r -> Param) ;
1471 }
1472
1473 0 ▶ if (pParamHV)
Branch: 1 branch
BranchTrueFalseTotal
if (pParamHV) 0 0 0
1474 {
1475 0 char * fn = GetHashValueStrDup(aTHX_ pPool, pParamHV, "inputfile", NULL) ;
1476 0 Embperl__Req__Config_new_init(aTHX_ &r -> Config, (SV *)pParamHV, 0) ;
1477 0 Embperl__Req__Param_new_init(aTHX_ &r -> Param, (SV *)pParamHV, 0) ;
1478 0 ▶ if (fn)
Branch: 1 branch
BranchTrueFalseTotal
if (fn) 0 0 0
1479 0 r -> Param.sFilename = fn ;
1480
1481 }
1482  
1483 0 tainted = 0 ;
1484  
1485  
1486 /*if (r -> Config.bDebug)
1487 lprintf (r -> pApp, "[%d]ep_acquire_mutex(RequestCountMutex)\n", r -> pThread -> nPid) ; */
1488 ep_acquire_mutex(RequestCountMutex) ;
1489 0 r -> nRequestCount = nRequestCount++ ;
1490 ep_release_mutex(RequestCountMutex) ;
1491 /*if (r -> Config.bDebug)
1492 lprintf (r -> pApp, "[%d]ep_release_mutex(RequestCountMutex)\n", r -> pThread -> nPid) ; */
1493 0 r -> nRequestTime = time(NULL) ;
1494  
1495 0 r -> pErrArray = newAV () ;
1496 0 r -> pDomTreeAV = newAV () ;
1497 0 r -> pCleanupAV = newAV () ;
1498 0 r -> pCleanupPackagesHV = newHV () ;
1499 0 r -> pMessages = newAV () ;
1500 0 r -> pDefaultMessages = newAV () ;
1501  
1502 0 pCookieName = r -> pApp -> Config.sCookieName ;
1503 0 ▶ if (pCookieName)
Branch: 1 branch
BranchTrueFalseTotal
if (pCookieName) 0 0 0
1504 { /* remove session id */
1505 0 char * pVal = GetHashValueStr (aTHX_ r -> Param.pCookies, pCookieName, NULL) ;
1506 0 ▶ if (pVal)
Branch: 1 branch
BranchTrueFalseTotal
if (pVal) 0 0 0
1507 0 r -> sSessionUserID = ep_pstrdup (r -> pPool, pVal) ;
1508 }
1509  
1510 0 ▶ if (r -> pApp -> Config.sCookieExpires)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> pApp -> Config.sCookieExpires) 0 0 0
1511 {
1512 char buf[256] ;
1513  
1514 0 ▶ if (!embperl_CalcExpires(r -> pApp -> Config.sCookieExpires, buf, 0))
Branch: 1 branch
BranchTrueFalseTotal
if (!embperl_CalcExpires(r -> pApp -> Config.sCookieExpires, buf, 0)) 0 0 0
1515 0 LogErrorParam (r -> pApp, rcTimeFormatErr, "EMBPERL_COOKIE_EXPIRES", r -> pApp -> Config.sCookieExpires) ;
1516 else
1517 0 r -> sCookieExpires = ep_pstrdup (r -> pPool, buf) ;
1518 }
1519  
1520 0 ▶ if (r -> pApp -> pUserHash)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> pApp -> pUserHash) 0 0 0
1521 0 r -> nSessionMgnt = 1 ;
1522  
1523 0 r -> nLogFileStartPos = GetLogFilePos (pApp) ;
1524  
1525 0 hv_clear (pThread -> pHeaderHash) ;
1526  
1527 0 embperl_LogStartReq (r) ;
1528  
1529 0 embperl_SetupFormData (r) ;
1530  
1531 0 ▶ if (r -> sSessionUserID && pApp -> pUserObj)
Branch: 2 branches
BranchTrueFalseTotal
if (r -> sSessionUserID && pApp -> pUserObj) 0 0 0
if (r -> sSessionUserID && pApp -> pUserObj) 0 0 0
1532 {
1533 0 tainted = 0 ;
1534 0 SPAGAIN;
1535 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
1536 0 ▶ XPUSHs(pApp -> pUserObj);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(pApp -> pUserObj); 0 0 0
1537 0 ▶ XPUSHs(sv_2mortal(newSVpv(r -> sSessionUserID, 0)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSVpv(r -> sSessionUserID, 0))); 0 0 0
1538 0 PUTBACK;
1539 0 perl_call_method ("setid", 0) ;
1540 }
1541  
1542 0 ▶ if (r -> sSessionStateID && pApp -> pStateObj)
Branch: 2 branches
BranchTrueFalseTotal
if (r -> sSessionStateID && pApp -> pStateObj) 0 0 0
if (r -> sSessionStateID && pApp -> pStateObj) 0 0 0
1543 {
1544 0 tainted = 0 ;
1545 0 SPAGAIN;
1546 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
1547 0 ▶ XPUSHs(pApp -> pStateObj);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(pApp -> pStateObj); 0 0 0
1548 0 ▶ XPUSHs(sv_2mortal(newSVpv(r -> sSessionStateID, 0)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSVpv(r -> sSessionStateID, 0))); 0 0 0
1549 0 PUTBACK;
1550 0 perl_call_method ("setid", 0) ;
1551 }
1552  
1553
1554 0 r -> sInitialCWD = ep_palloc(pPool, PATH_MAX * 2) ;
1555 0 getcwd (r -> sInitialCWD, PATH_MAX * 2 - 1) ;
1556  
1557 0 *ppReq = r ;
1558  
1559 0 ▶ if (pApp -> Config.sAppHandlerClass)
Branch: 1 branch
BranchTrueFalseTotal
if (pApp -> Config.sAppHandlerClass) 0 0 0
1560 {
1561 0 tainted = 0 ;
1562 0 SPAGAIN ;
1563 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
1564 0 ▶ XPUSHs(pApp -> _perlsv);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(pApp -> _perlsv); 0 0 0
1565 0 ▶ XPUSHs(r -> _perlsv);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(r -> _perlsv); 0 0 0
1566 0 PUTBACK;
1567 0 perl_call_method ("init", G_EVAL) ;
1568 0 tainted = 0 ;
1569  
1570 0 ▶ if (SvTRUE (ERRSV))
Branch: 2 branches
BranchTrueFalseTotal
if (SvTRUE (ERRSV)) 0 0 0
if (SvTRUE (ERRSV)) 0 0 0
1571 {
1572 STRLEN l ;
1573 0 POPs ; /* cleanup stack */
1574 0 ▶ LogErrorParam (pApp, rcEvalErr, SvPV (ERRSV, l), " while calling APP_HANDLER_CLASS -> init") ;
Branch: 1 branch
BranchTrueFalseTotal
LogErrorParam (pApp, rcEvalErr, SvPV (ERRSV, l), " while calling APP_HANDLER_CLASS -> init") ; 0 0 0
1575 0 ▶ sv_setpv(ERRSV,"");
Branch: 1 branch
BranchTrueFalseTotal
sv_setpv(ERRSV,""); 0 0 0
1576 0 return rcEvalErr ;
1577 }
1578 }
1579  
1580 0 tainted = 0 ;
1581
1582 0 return ok ;
1583 }
1584
1585 /*---------------------------------------------------------------------------
1586 * embperl_CleanupOutput
1587 */
1588 /*!
1589 *
1590 * \_en
1591 * cleanup data for component output object
1592 * \endif
1593 *
1594 * \_de
1595 * R?umt das Component-Ausgabe Objekt auf
1596 * \endif
1597 *
1598 * ------------------------------------------------------------------------ */
1599  
1600  
1601  
1602 0 int embperl_CleanupOutput (/*in*/ tReq * r,
1603 /*in*/ tComponent * c)
1604
1605
1606 {
1607 epTHX_
1608 0 tComponentOutput * pOutput = c -> pOutput ;
1609  
1610 0 ▶ if (!pOutput || (c -> pPrev && c -> pPrev -> pOutput == pOutput))
Branch: 3 branches
BranchTrueFalseTotal
if (!pOutput || (c -> pPrev && c -> pPrev -> pOutput == pOutput)) 0 0 0
if (!pOutput || (c -> pPrev && c -> pPrev -> pOutput == pOutput)) 0 0 0
if (!pOutput || (c -> pPrev && c -> pPrev -> pOutput == pOutput)) 0 0 0
1611 { /* this component uses the main output object */
1612 0 return ok ;
1613 }
1614  
1615 0 CloseOutput (r, pOutput) ;
1616  
1617 0 ▶ if (SvREFCNT(SvRV(pOutput -> _perlsv)) != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (SvREFCNT(SvRV(pOutput -> _perlsv)) != 1) 0 0 0
1618 {
1619 char buf[20] ;
1620 0 sprintf (buf, "%d", (int)SvREFCNT(SvRV(pOutput -> _perlsv)) - 1) ;
1621 0 LogErrorParam (r -> pApp, rcRefcntNotOne, buf, "request.component.output") ;
1622 }
1623 0 sv_unmagic(SvRV(pOutput -> _perlsv), '~') ;
1624 0 SvREFCNT_dec (pOutput -> _perlsv) ;
1625 0 ep_destroy_pool (pOutput -> pPool) ;
1626  
1627 0 return ok ;
1628 }
1629  
1630
1631 /*---------------------------------------------------------------------------
1632 * embperl_CleanupComponent
1633 */
1634 /*!
1635 *
1636 * \_en
1637 * cleanup component object
1638 * \endif
1639 *
1640 * \_de
1641 * Component-Objekt aufr?umen
1642 * \endif
1643 *
1644 * ------------------------------------------------------------------------ */
1645  
1646  
1647  
1648 0 int embperl_CleanupComponent (/*in*/ tComponent * c)
1649
1650
1651 {
1652 0 tReq * r = c -> pReq ;
1653 epTHX_
1654 SV * pHV ;
1655 MAGIC * mg;
1656  
1657 0 ▶ if (c -> Param.sISA && c -> sCurrPackage)
Branch: 2 branches
BranchTrueFalseTotal
if (c -> Param.sISA && c -> sCurrPackage) 0 0 0
if (c -> Param.sISA && c -> sCurrPackage) 0 0 0
1658 {
1659 STRLEN l ;
1660 0 SV * pName = newSVpvf ("%s::ISA", c -> sImportPackage) ;
1661 0 AV * pCallerISA = perl_get_av (SvPV(pName, l), TRUE) ;
1662 int i ;
1663 0 int n = av_len(pCallerISA) + 1;
1664 SV ** ppSV ;
1665 newSVpvf2(pName) ;
1666  
1667 0 SvREFCNT_dec (pName) ;
1668
1669 0 ▶ for (i = 0; i < n; i++)
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) 0 0 0
1670 {
1671 0 ▶ if ((ppSV = av_fetch(pCallerISA, i, 0)) && *ppSV && strcmp (SvPV(*ppSV, l), c -> sCurrPackage) == 0)
Branch: 3 branches
BranchTrueFalseTotal
if ((ppSV = av_fetch(pCallerISA, i, 0)) && *ppSV && strcmp (SvPV(*ppSV, l), c -> sCurrPackage) == 0) 0 0 0
if ((ppSV = av_fetch(pCallerISA, i, 0)) && *ppSV && strcmp (SvPV(*ppSV, l), c -> sCurrPackage) == 0) 0 0 0
if ((ppSV = av_fetch(pCallerISA, i, 0)) && *ppSV && strcmp (SvPV(*ppSV, l), c -> sCurrPackage) == 0) 0 0 0
1672 0 break ;
1673 }
1674  
1675 0 ▶ if (n == i)
Branch: 1 branch
BranchTrueFalseTotal
if (n == i) 0 0 0
1676 0 av_push(pCallerISA, newSVpv (c -> sCurrPackage, 0)) ;
1677 }
1678
1679 0 embperl_CleanupOutput (r, c) ;
1680  
1681 0 ▶ if (SvREFCNT(SvRV(c -> Config._perlsv)) != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (SvREFCNT(SvRV(c -> Config._perlsv)) != 1) 0 0 0
1682 {
1683 char buf[20] ;
1684 0 sprintf (buf, "%d", (int)SvREFCNT(SvRV(c -> Config._perlsv)) - 1) ;
1685 0 LogErrorParam (r -> pApp, rcRefcntNotOne, buf, "request.component.config") ;
1686 }
1687 0 ▶ if (SvREFCNT(SvRV(c -> Param._perlsv)) != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (SvREFCNT(SvRV(c -> Param._perlsv)) != 1) 0 0 0
1688 {
1689 char buf[20] ;
1690 0 sprintf (buf, "%d", (int)SvREFCNT(SvRV(c -> Param._perlsv)) - 1) ;
1691 0 LogErrorParam (r -> pApp, rcRefcntNotOne, buf, "request.component.param") ;
1692 }
1693 0 ▶ if (SvREFCNT(c -> _perlsv) != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (SvREFCNT(c -> _perlsv) != 1) 0 0 0
1694 {
1695 char buf[20] ;
1696 0 sprintf (buf, "%d", (int)SvREFCNT(SvRV(c -> _perlsv)) - 1) ;
1697 0 LogErrorParam (r -> pApp, rcRefcntNotOne, buf, "request.component") ;
1698 }
1699  
1700  
1701 0 Embperl__Component__Config_destroy(aTHX_ &c -> Config) ;
1702 0 Embperl__Component__Param_destroy(aTHX_ &c -> Param) ;
1703 0 Embperl__Component_destroy(aTHX_ c) ;
1704  
1705 0 pHV = SvRV (c -> _perlsv) ;
1706 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1707 0 *((tComponent **)(mg -> mg_ptr)) = &NullRequest.Component ;
1708 0 pHV = SvRV (c -> Config._perlsv) ;
1709 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1710 0 *((tComponentConfig **)(mg -> mg_ptr)) = &NullRequest.Component.Config ;
1711 0 pHV = SvRV (c -> Param._perlsv) ;
1712 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1713 0 *((tComponentParam **)(mg -> mg_ptr)) = &NullRequest.Component.Param ;
1714  
1715 0 SvREFCNT_dec (c -> Config._perlsv) ;
1716 0 SvREFCNT_dec (c -> Param._perlsv) ;
1717 0 SvREFCNT_dec (c -> _perlsv) ;
1718  
1719  
1720 0 ▶ if (c == &r -> Component && c -> pPrev)
Branch: 2 branches
BranchTrueFalseTotal
if (c == &r -> Component && c -> pPrev) 0 0 0
if (c == &r -> Component && c -> pPrev) 0 0 0
1721 0 { /* we have a previous component, so let restore it */
1722 0 tComponent * pPrev = c -> pPrev;
1723  
1724 0 memcpy (c, pPrev, sizeof (*c)) ;
1725
1726 /* adjust pointer in perl magic */
1727 0 pHV = SvRV (c -> _perlsv) ;
1728 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1729 0 *((tComponent **)(mg -> mg_ptr)) = c ;
1730 0 pHV = SvRV (c -> Config._perlsv) ;
1731 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1732 0 *((tComponentConfig **)(mg -> mg_ptr)) = &c -> Config ;
1733 0 pHV = SvRV (c -> Param._perlsv) ;
1734 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1735 0 *((tComponentParam **)(mg -> mg_ptr)) = &c -> Param ;
1736 }
1737 else
1738 {
1739 0 c -> _perlsv = NULL ;
1740 }
1741
1742 0 return ok ;
1743 }
1744  
1745  
1746 /*---------------------------------------------------------------------------
1747 * embperl_CleanupRequest
1748 */
1749 /*!
1750 *
1751 * \_en
1752 * cleanup request
1753 * \endif
1754 *
1755 * \_de
1756 * Das Requestobjekt aufr?umen
1757 * \endif
1758 *
1759 * ------------------------------------------------------------------------ */
1760  
1761 0 int embperl_CleanupRequest (/*in*/ tReq * r)
1762  
1763 {
1764 epTHX_
1765 int i ;
1766 HE * pEntry ;
1767 I32 l ;
1768 0 tApp * pApp = r -> pApp ;
1769 SV * pHV ;
1770 MAGIC * mg;
1771 0 dSP ;
1772  
1773
1774 0 hv_iterinit (r -> pCleanupPackagesHV) ;
1775 0 ▶ while ((pEntry = hv_iternext (r -> pCleanupPackagesHV)))
Branch: 1 branch
BranchTrueFalseTotal
while ((pEntry = hv_iternext (r -> pCleanupPackagesHV))) 0 0 0
1776 {
1777 0 char * sPackage = hv_iterkey (pEntry, &l) ;
1778 0 ClearSymtab (r, sPackage, r -> Config.bDebug & dbgShowCleanup) ;
1779 }
1780 0 tainted = 0 ;
1781  
1782 0 sv_setsv(r -> pThread -> pReqRV, &sv_undef) ;
1783  
1784 0 ▶ while (r -> Component._perlsv)
Branch: 1 branch
BranchTrueFalseTotal
while (r -> Component._perlsv) 0 0 0
1785 0 embperl_CleanupComponent(&r -> Component) ;
1786
1787 0 ▶ if (r -> nSessionMgnt)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> nSessionMgnt) 0 0 0
1788 {
1789 0 SPAGAIN ;
1790 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
1791 0 ▶ XPUSHs(pApp -> pAppObj);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(pApp -> pAppObj); 0 0 0
1792 0 PUTBACK;
1793 0 perl_call_method ("cleanup", G_DISCARD) ;
1794 0 SPAGAIN ;
1795 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
1796 0 ▶ XPUSHs(pApp -> pUserObj);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(pApp -> pUserObj); 0 0 0
1797 0 PUTBACK;
1798 0 perl_call_method ("cleanup", G_DISCARD) ;
1799 0 SPAGAIN ;
1800 0 ▶ PUSHMARK(sp);
Branch: 1 branch
BranchTrueFalseTotal
PUSHMARK(sp); 0 0 0
1801 0 ▶ XPUSHs(pApp -> pStateObj);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(pApp -> pStateObj); 0 0 0
1802 0 PUTBACK;
1803 0 perl_call_method ("cleanup", G_DISCARD) ;
1804 0 SPAGAIN ;
1805 }
1806
1807 0 hv_clear (r -> pThread -> pHeaderHash) ;
1808 0 hv_clear (r -> pThread -> pInputHash) ;
1809 0 av_clear (r -> pThread -> pFormArray) ;
1810 0 hv_clear (r -> pThread -> pFormHash) ;
1811 0 hv_clear (r -> pThread -> pFormSplitHash) ;
1812 /*
1813 for (i = 0 ; i <= av_len (r -> pDomTreeAV); i++)
1814 {
1815 SV ** ppSV = av_fetch (r -> pDomTreeAV, i, 0) ;
1816 SV * pSV = * ppSV ;
1817 lprintf (r -> pApp, "r -> pDomTreeAV DomTree #%d type = %d cnt=%d n=%d\n", i, SvTYPE(pSV), SvREFCNT(pSV), SvIVX(pSV)) ;
1818 }
1819 */
1820 0 av_clear (r -> pDomTreeAV) ;
1821 0 SvREFCNT_dec (r -> pDomTreeAV) ;
1822 0 ▶ for (i = 0 ; i <= av_len (r -> pCleanupAV); i++)
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0 ; i <= av_len (r -> pCleanupAV); i++) 0 0 0
1823 {
1824 0 SV ** ppSV = av_fetch (r -> pCleanupAV, i, 0) ;
1825 0 SV * pSV = * ppSV ;
1826 /*
1827 if (SvROK(pSV))
1828 lprintf (r -> pApp, "r -> pCleanupAV DomTree #%d type = %d cnt=%d n=%d\n", i, SvTYPE(SvRV(pSV)), SvREFCNT(SvRV(pSV)), SvIVX(SvRV(pSV))) ;
1829 */
1830 0 ▶ if (SvROK(pSV))
Branch: 1 branch
BranchTrueFalseTotal
if (SvROK(pSV)) 0 0 0
1831 0 sv_setsv (SvRV(pSV), &sv_undef) ;
1832 }
1833 0 av_clear (r -> pCleanupAV) ;
1834  
1835 0 Cache_CleanupRequest (r) ;
1836  
1837 0 ▶ if (SvREFCNT(SvRV(r -> Config._perlsv)) != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (SvREFCNT(SvRV(r -> Config._perlsv)) != 1) 0 0 0
1838 {
1839 char buf[20] ;
1840 0 sprintf (buf, "%d", (int)SvREFCNT(SvRV(r -> Config._perlsv)) - 1) ;
1841 0 LogErrorParam (r -> pApp, rcRefcntNotOne, buf, "request.config") ;
1842 }
1843 0 ▶ if (SvREFCNT(SvRV(r -> Param._perlsv)) != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (SvREFCNT(SvRV(r -> Param._perlsv)) != 1) 0 0 0
1844 {
1845 char buf[20] ;
1846 0 sprintf (buf, "%d", (int)SvREFCNT(SvRV(r -> Param._perlsv)) - 1) ;
1847 0 LogErrorParam (r -> pApp, rcRefcntNotOne, buf, "request.param") ;
1848 }
1849 /*
1850 if (SvREFCNT(SvRV(r -> _perlsv)) != 1)
1851 {
1852 char buf[20] ;
1853 sprintf (buf, "%d", SvREFCNT(SvRV(r -> _perlsv)) - 1) ;
1854 LogErrorParam (r -> pApp, rcRefcntNotOne, buf, "request") ;
1855 }
1856 */
1857  
1858 /* cleanup errarray manualy, to avoid segv incase error in destroy */
1859 0 SvREFCNT_dec (r -> pErrArray) ;
1860 0 r -> pErrArray = NULL ;
1861  
1862
1863 0 Embperl__Req__Config_destroy(aTHX_ &r -> Config) ;
1864 0 Embperl__Req__Param_destroy(aTHX_ &r -> Param) ;
1865 0 Embperl__Req_destroy(aTHX_ r) ;
1866  
1867 0 pHV = SvRV (r -> _perlsv) ;
1868 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1869 0 *((tReq **)(mg -> mg_ptr)) = &NullRequest ;
1870 0 pHV = SvRV (r -> Config._perlsv) ;
1871 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1872 0 *((tReqConfig **)(mg -> mg_ptr)) = &NullRequest.Config ;
1873 0 pHV = SvRV (r -> Param._perlsv) ;
1874 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
1875 0 *((tReqParam **)(mg -> mg_ptr)) = &NullRequest.Param ;
1876
1877
1878 0 SvREFCNT_dec (r -> Config._perlsv) ;
1879 0 SvREFCNT_dec (r -> Param._perlsv) ;
1880 0 SvREFCNT_dec (r -> _perlsv) ;
1881
1882 0 ep_destroy_pool (r -> pPool) ;
1883 0 ▶ sv_setpv(ERRSV,"");
Branch: 1 branch
BranchTrueFalseTotal
sv_setpv(ERRSV,""); 0 0 0
1884  
1885 0 ▶ if (r -> Config.bDebug)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Config.bDebug) 0 0 0
1886 0 DomStats (r -> pApp) ;
1887  
1888 0 r -> pThread -> pCurrReq = r -> pPrevReq ;
1889 0 r -> pApp -> pCurrReq = r -> pPrevReq ;
1890  
1891 0 ▶ if (r -> pPrevReq)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> pPrevReq) 0 0 0
1892 0 sv_setsv(r -> pThread -> pReqRV, r -> pPrevReq -> _perlsv) ;
1893  
1894
1895 0 return ok ;
1896 }
1897  
1898  
1899  
1900  
1901  
1902 /*---------------------------------------------------------------------------
1903 * embperl_SetupOutput
1904 */
1905 /*!
1906 *
1907 * \_en
1908 * setup data for component output object
1909 * \endif
1910 *
1911 * \_de
1912 * Initialisiert das Component-Ausgabe Objekt
1913 * \endif
1914 *
1915 * ------------------------------------------------------------------------ */
1916  
1917  
1918  
1919 0 int embperl_SetupOutput (/*in*/ tReq * r,
1920 /*in*/tComponent * c)
1921
1922
1923 {
1924 epTHX_
1925 int rc ;
1926 SV * pSV ;
1927 SV * pRV ;
1928 tComponentOutput * pOutput ;
1929 tMemPool * pPool ;
1930  
1931 0 ▶ if (!c -> Param.pOutput && !c -> Param.sOutputfile && c -> pPrev && !r -> Component.pImportStash)
Branch: 4 branches
BranchTrueFalseTotal
if (!c -> Param.pOutput && !c -> Param.sOutputfile && c -> pPrev && !r -> Component.pImportStash) 0 0 0
if (!c -> Param.pOutput && !c -> Param.sOutputfile && c -> pPrev && !r -> Component.pImportStash) 0 0 0
if (!c -> Param.pOutput && !c -> Param.sOutputfile && c -> pPrev && !r -> Component.pImportStash) 0 0 0
if (!c -> Param.pOutput && !c -> Param.sOutputfile && c -> pPrev && !r -> Component.pImportStash) 0 0 0
1932 { /* this component uses the main output object */
1933 0 c -> pOutput = c -> pPrev -> pOutput ;
1934 0 return ok ;
1935 }
1936  
1937 0 pPool = ep_make_sub_pool (r -> pPool) ;
1938  
1939 0 tainted = 0 ;
1940 0 epxs_Embperl__Component__Output_create_obj(pOutput,pSV,pRV,ep_palloc(pPool,sizeof(tComponentOutput))) ;
1941 0 tainted = 0 ;
1942 0 pOutput -> pPool = pPool ;
1943 0 c -> pOutput = pOutput ;
1944  
1945 0 ▶ if (r -> Component.pImportStash)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Component.pImportStash) 0 0 0
1946 0 pOutput -> bDisableOutput = 1 ;
1947 0 ▶ else if (c -> Param.pOutput)
Branch: 1 branch
BranchTrueFalseTotal
else if (c -> Param.pOutput) 0 0 0
1948 {
1949 0 ▶ if ((rc = OpenOutput (r, "")) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = OpenOutput (r, "")) != ok) 0 0 0
1950 0 return rc ;
1951 }
1952 else
1953 {
1954 0 ▶ if ((rc = OpenOutput (r, embperl_File2Abs(r, pOutput -> pPool, c -> Param.sOutputfile))) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = OpenOutput (r, embperl_File2Abs(r, pOutput -> pPool, c -> Param.sOutputfile))) != ok) 0 0 0
1955 0 return rc ;
1956 }
1957  
1958 0 return ok ;
1959 }
1960  
1961  
1962 /*---------------------------------------------------------------------------
1963 * embperl_SetupComponent
1964 */
1965 /*!
1966 *
1967 * \_en
1968 * setup data for component object
1969 * \endif
1970 *
1971 * \_de
1972 * Initialisiert das Component-Objekt
1973 * \endif
1974 *
1975 * ------------------------------------------------------------------------ */
1976  
1977  
1978  
1979 0 int embperl_SetupComponent (/*in*/ tReq * r,
1980 /*in*/ SV * pPerlParam,
1981 /*out*/tComponent * * ppComponent)
1982
1983
1984 {
1985 int rc ;
1986 SV * pComponentSV ;
1987 SV * pComponentRV ;
1988 SV * pSV ;
1989 SV * pRV ;
1990 tComponent * c ;
1991 tComponentParam * pParam ;
1992 tComponentConfig * pConfig ;
1993 epTHX_
1994 0 tComponent * pPrev = NULL ;
1995 char * p ;
1996 0 HV * pParamHV = NULL ;
1997  
1998 0 ▶ if (r -> Component._perlsv)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Component._perlsv) 0 0 0
1999 { /* we have already a component, so let safe it first */
2000 SV * pHV ;
2001 MAGIC * mg ;
2002  
2003 0 pPrev = ep_palloc(r->pPool,sizeof(*pPrev)) ;
2004  
2005 0 memcpy (pPrev, &r -> Component, sizeof (*pPrev)) ;
2006
2007 /* adjust pointer in perl magic */
2008 0 pHV = SvRV (pPrev -> _perlsv) ;
2009 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
2010 0 *((tComponent **)(mg -> mg_ptr)) = pPrev ;
2011 0 pHV = SvRV (pPrev -> Config._perlsv) ;
2012 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
2013 0 *((tComponentConfig **)(mg -> mg_ptr)) = &pPrev -> Config ;
2014 0 pHV = SvRV (pPrev -> Param._perlsv) ;
2015 0 ▶ if ((mg = mg_find (pHV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pHV, '~'))) 0 0 0
2016 0 *((tComponentParam **)(mg -> mg_ptr)) = &pPrev -> Param ;
2017 }
2018  
2019 0 ▶ if (pPerlParam && SvROK(pPerlParam))
Branch: 2 branches
BranchTrueFalseTotal
if (pPerlParam && SvROK(pPerlParam)) 0 0 0
if (pPerlParam && SvROK(pPerlParam)) 0 0 0
2020 0 pParamHV = (HV *)SvRV(pPerlParam) ;
2021
2022 0 epxs_Embperl__Component_create_obj(c,pComponentSV, pComponentRV,&r->Component) ;
2023 0 epxs_Embperl__Component__Param_create_obj(pParam,pSV, pRV,&r->Component.Param) ;
2024 0 epxs_Embperl__Component__Config_create_obj(pConfig,pSV, pRV,&r->Component.Config) ;
2025
2026 0 r -> Component.pPrev = pPrev ;
2027  
2028 0 c -> pPool = r -> pPool ;
2029 0 pParam -> pPool = r -> pPool ;
2030 0 pConfig -> pPool = r -> pPool ;
2031  
2032 0 c -> Param.nImport = -1 ;
2033 0 c -> Param.nFirstLine = 1 ;
2034  
2035 0 c -> pReq = r ;
2036 #ifdef APACHE
2037 if (r -> pApacheReq)
2038 {
2039 embperl_GetApacheComponentConfig (r, r -> pPool, r -> pApacheConfig, &c -> Config) ;
2040 }
2041 else
2042 #endif
2043 {
2044 0 bool bUseEnv = 0 ;
2045 0 bool bUseRedirectEnv = 0 ;
2046 0 ▶ if (pParamHV)
Branch: 1 branch
BranchTrueFalseTotal
if (pParamHV) 0 0 0
2047 {
2048 0 bUseEnv = (bool)GetHashValueInt (aTHX_ pParamHV, "use_env", 0) ;
2049 0 bUseRedirectEnv = (bool)GetHashValueInt (aTHX_ pParamHV, "use_redirect_env", 0) ;
2050 }
2051 0 embperl_GetCGIComponentConfig (r, r -> pPool, &c -> Config, bUseEnv, bUseRedirectEnv, 1) ;
2052 }
2053
2054 0 ▶ if (pPrev)
Branch: 1 branch
BranchTrueFalseTotal
if (pPrev) 0 0 0
2055 0 c -> Config.bOptions &= ~optReturnError ;
2056
2057 0 ▶ if (pParamHV)
Branch: 1 branch
BranchTrueFalseTotal
if (pParamHV) 0 0 0
2058 {
2059 0 Embperl__Component__Config_new_init (aTHX_ &c -> Config, (SV *)pParamHV, 0) ;
2060 0 Embperl__Component__Param_new_init (aTHX_ &c -> Param, (SV *)pParamHV, 0) ;
2061 }
2062  
2063 0 ▶ c -> sCWD = pPrev?pPrev -> sCWD:r -> sInitialCWD ;
Branch: 1 branch
BranchTrueFalseTotal
c -> sCWD = pPrev?pPrev -> sCWD:r -> sInitialCWD ; 0 0 0
2064 0 ▶ if (c -> sCWD == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if (c -> sCWD == NULL) 0 0 0
2065 0 c -> sCWD = "" ;
2066  
2067 0 NewEscMode (r, NULL) ;
2068 0 c -> bEscModeSet = 0 ;
2069  
2070 0 ▶ if (c -> Param.nImport < 0 && (c -> Param.sObject || c -> Param.sISA))
Branch: 3 branches
BranchTrueFalseTotal
if (c -> Param.nImport < 0 && (c -> Param.sObject || c -> Param.sISA)) 0 0 0
if (c -> Param.nImport < 0 && (c -> Param.sObject || c -> Param.sISA)) 0 0 0
if (c -> Param.nImport < 0 && (c -> Param.sObject || c -> Param.sISA)) 0 0 0
2071 0 c -> Param.nImport = 0 ;
2072  
2073 0 ▶ if (c -> Param.nImport >= 0)
Branch: 1 branch
BranchTrueFalseTotal
if (c -> Param.nImport >= 0) 0 0 0
2074 {
2075 char code[40] ;
2076 SV * pSVImport ;
2077 STRLEN l ;
2078  
2079 0 sprintf (code, "caller(%d)", c -> Param.nImport>0?c -> Param.nImport:1) ;
2080 /* there is no c api to the caller function, eval it... */
2081 0 pSVImport = perl_eval_pv(code, 0) ;
2082 0 ▶ if (!SvOK(pSVImport))
Branch: 1 branch
BranchTrueFalseTotal
if (!SvOK(pSVImport)) 0 0 0
2083 {
2084 0 ▶ if (c -> Param.nImport == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (c -> Param.nImport == 0) 0 0 0
2085 0 c -> sImportPackage = "main" ;
2086 else
2087 {
2088 0 LogError (r, rcImportStashErr) ;
2089 0 c -> sImportPackage = NULL ;
2090 }
2091 }
2092 else
2093 0 c -> sImportPackage = ep_pstrdup(r -> pPool, SvPV (pSVImport, l)) ;
2094  
2095 0 ▶ if (c -> sImportPackage)
Branch: 1 branch
BranchTrueFalseTotal
if (c -> sImportPackage) 0 0 0
2096 {
2097 0 ▶ if ((c -> pImportStash = gv_stashpv (c -> sImportPackage, 0)) == NULL)
Branch: 1 branch
BranchTrueFalseTotal
if ((c -> pImportStash = gv_stashpv (c -> sImportPackage, 0)) == NULL) 0 0 0
2098 {
2099 0 strncpy (r -> errdat1, c -> sImportPackage, sizeof (r -> errdat1) - 1);
2100 0 LogError (r, rcImportStashErr) ;
2101 }
2102 0 SvREFCNT_inc(c -> pImportStash) ;
2103 }
2104 }
2105  
2106 0 c -> nSourceline = pParam -> nFirstLine ;
2107 0 ▶ if (!pParam -> sInputfile)
Branch: 1 branch
BranchTrueFalseTotal
if (!pParam -> sInputfile) 0 0 0
2108 {
2109 0 ▶ if (pParam -> sISA)
Branch: 1 branch
BranchTrueFalseTotal
if (pParam -> sISA) 0 0 0
2110 0 pParam -> sInputfile = pParam -> sISA ;
2111 0 ▶ else if (pParam -> sObject)
Branch: 1 branch
BranchTrueFalseTotal
else if (pParam -> sObject) 0 0 0
2112 0 pParam -> sInputfile = pParam -> sObject ;
2113 else
2114 {
2115 0 ▶ if (pPrev)
Branch: 1 branch
BranchTrueFalseTotal
if (pPrev) 0 0 0
2116 0 pParam -> sInputfile = pPrev -> sSourcefile ;
2117 0 ▶ if (!pParam -> sInputfile)
Branch: 1 branch
BranchTrueFalseTotal
if (!pParam -> sInputfile) 0 0 0
2118 0 pParam -> sInputfile = r -> Param.sFilename ;
2119 }
2120 }
2121 0 ▶ else if ((p = strchr(pParam -> sInputfile, '#')))
Branch: 1 branch
BranchTrueFalseTotal
else if ((p = strchr(pParam -> sInputfile, '#'))) 0 0 0
2122 {
2123 0 pParam -> sSub = p + 1 ;
2124 0 ▶ if (p == pParam -> sInputfile && c -> pPrev)
Branch: 2 branches
BranchTrueFalseTotal
if (p == pParam -> sInputfile && c -> pPrev) 0 0 0
if (p == pParam -> sInputfile && c -> pPrev) 0 0 0
2125 0 pParam -> sInputfile = c -> pPrev -> sSourcefile ;
2126 else
2127 0 *p = '\0' ;
2128 }
2129 0 ▶ if (!pParam -> sInputfile || !*pParam -> sInputfile || strcmp(pParam -> sInputfile, "*") == 0)
Branch: 3 branches
BranchTrueFalseTotal
if (!pParam -> sInputfile || !*pParam -> sInputfile || strcmp(pParam -> sInputfile, "*") == 0) 0 0 0
if (!pParam -> sInputfile || !*pParam -> sInputfile || strcmp(pParam -> sInputfile, "*") == 0) 0 0 0
if (!pParam -> sInputfile || !*pParam -> sInputfile || strcmp(pParam -> sInputfile, "*") == 0) 0 0 0
2130 0 pParam -> sInputfile = r -> Param.sFilename ;
2131 0 ▶ else if (strcmp(pParam -> sInputfile, "../*") == 0)
Branch: 1 branch
BranchTrueFalseTotal
else if (strcmp(pParam -> sInputfile, "../*") == 0) 0 0 0
2132 {
2133 #ifdef WIN32
2134 char * p = strrchr(r -> Param.sFilename, '\\') ;
2135 if (!p)
2136 p = strrchr(r -> Param.sFilename, '/') ;
2137 #else
2138 0 char * p = strrchr(r -> Param.sFilename, '/') ;
2139 #endif
2140 0 ▶ if (!p)
Branch: 1 branch
BranchTrueFalseTotal
if (!p) 0 0 0
2141 0 p = r -> Param.sFilename ;
2142 else
2143 0 p++ ;
2144
2145 0 pParam -> sInputfile = ep_pstrcat(r -> pPool, "../", p, NULL) ;
2146 }
2147  
2148 0 *ppComponent = c ;
2149  
2150 0 ▶ if (!pParam -> sInputfile)
Branch: 1 branch
BranchTrueFalseTotal
if (!pParam -> sInputfile) 0 0 0
2151 0 rc = rcMissingInput ;
2152 else
2153 0 rc = embperl_SetupOutput (r, c) ;
2154 0 ▶ if (rc != ok)
Branch: 1 branch
BranchTrueFalseTotal
if (rc != ok) 0 0 0
2155 0 LogError (r, rc) ;
2156 0 return rc ;
2157 }
2158  
2159  
2160  
2161  
2162  
2163  
2164 /*---------------------------------------------------------------------------
2165 * embperl_InitRequest
2166 */
2167 /*!
2168 *
2169 * \_en
2170 * Initialize the Thread and Application object and if available return the
2171 * Apache configuration data
2172 * \endif
2173 *
2174 * \_de
2175 * Initialisiert das Thread und Application Objekt und leifert, soweit vorhanden,
2176 * die Apache Konfiguration
2177 * \endif
2178 *
2179 * ------------------------------------------------------------------------ */
2180  
2181  
2182  
2183  
2184 0 int embperl_InitAppForRequest (/*in*/ pTHX_
2185 /*in*/ SV * pApacheReqSV,
2186 /*in*/ SV * pPerlParam,
2187 /*out*/tThreadData * * ppThread,
2188 /*out*/tApp * * ppApp,
2189 /*out*/tApacheDirConfig * * ppApacheCfg)
2190  
2191  
2192 {
2193 int rc ;
2194 tThreadData * pThread ;
2195 tApp * pApp ;
2196 0 tApacheDirConfig * pApacheCfg = NULL ;
2197  
2198
2199 /* get our thread object */
2200 0 ▶ if ((rc = embperl_SetupThread (aTHX_ &pThread)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_SetupThread (aTHX_ &pThread)) != ok) 0 0 0
2201 {
2202 0 LogError (NULL, rc) ;
2203 0 return rc ;
2204 }
2205  
2206 #ifdef APACHE
2207 if (pApacheReqSV && SvROK (pApacheReqSV))
2208 {
2209 request_rec * ap_r = (request_rec *)SvIV((SV*)SvRV(pApacheReqSV));
2210
2211 embperl_GetApacheConfig (pThread, ap_r, ap_r -> server, &pApacheCfg) ;
2212
2213 }
2214 #endif
2215  
2216 /* get the application object */
2217 0 ▶ if ((rc = embperl_SetupApp (aTHX_ pThread, pApacheCfg, pPerlParam, &pApp)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_SetupApp (aTHX_ pThread, pApacheCfg, pPerlParam, &pApp)) != ok) 0 0 0
2218 {
2219 0 LogError (NULL, rc) ;
2220 0 return rc ;
2221 }
2222  
2223  
2224 0 *ppThread = pThread ;
2225 0 *ppApp = pApp ;
2226 0 *ppApacheCfg = pApacheCfg ;
2227  
2228 0 return ok ;
2229 }
2230  
2231  
2232 /*---------------------------------------------------------------------------
2233 * embperl_InitRequest
2234 */
2235 /*!
2236 *
2237 * \_en
2238 * Initialize all necessary data structures to start a request like thread,
2239 * application and request object
2240 * \endif
2241 *
2242 * \_de
2243 * Initialisiert alle n?tigen Datenstrukturen um den Request zu starten, wie
2244 * Thread-, Applikcation und Request-Objekt.
2245 * \endif
2246 *
2247 * ------------------------------------------------------------------------ */
2248  
2249  
2250  
2251  
2252 0 int embperl_InitRequest (/*in*/ pTHX_
2253 /*in*/ SV * pApacheReqSV,
2254 /*in*/ SV * pPerlParam,
2255 /*out*/tReq * * ppReq)
2256  
2257  
2258 {
2259 int rc ;
2260 tThreadData * pThread ;
2261 tApp * pApp ;
2262 tReq * r ;
2263 0 tApacheDirConfig * pApacheCfg = NULL ;
2264  
2265
2266 /* get our thread & Application object */
2267  
2268 0 ▶ if ((rc = embperl_InitAppForRequest (aTHX_
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_InitAppForRequest (aTHX_ 0 0 0
2269 pApacheReqSV,
2270 pPerlParam,
2271 &pThread,
2272 &pApp,
2273 &pApacheCfg)) != ok)
2274 {
2275 0 LogError (NULL, rc) ;
2276 0 return rc ;
2277 }
2278  
2279  
2280 /* and setup the request object */
2281 0 ▶ if ((rc = embperl_SetupRequest (aTHX_ pApacheReqSV, pApp, pApacheCfg, pPerlParam, &r)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_SetupRequest (aTHX_ pApacheReqSV, pApp, pApacheCfg, pPerlParam, &r)) != ok) 0 0 0
2282 {
2283 0 LogErrorParam (pApp, rc, NULL, NULL) ;
2284 0 return rc ;
2285 }
2286  
2287 0 r -> pApacheConfig = pApacheCfg ;
2288
2289 0 *ppReq = r ;
2290  
2291 0 ▶ if (r -> Config.pAllow || r -> Config.pUriMatch)
Branch: 2 branches
BranchTrueFalseTotal
if (r -> Config.pAllow || r -> Config.pUriMatch) 0 0 0
if (r -> Config.pAllow || r -> Config.pUriMatch) 0 0 0
2292 {
2293 SV * args[1] ;
2294 SV * pRet ;
2295 STRLEN l ;
2296  
2297 0 ▶ if (r -> Param.sUri && *r -> Param.sUri)
Branch: 2 branches
BranchTrueFalseTotal
if (r -> Param.sUri && *r -> Param.sUri) 0 0 0
if (r -> Param.sUri && *r -> Param.sUri) 0 0 0
2298 0 args[0] = newSVpv (r -> Param.sUri, 0) ;
2299 0 ▶ else if (r -> Param.sFilename && *r -> Param.sFilename)
Branch: 2 branches
BranchTrueFalseTotal
else if (r -> Param.sFilename && *r -> Param.sFilename) 0 0 0
else if (r -> Param.sFilename && *r -> Param.sFilename) 0 0 0
2300 0 args[0] = newSVpv (r -> Param.sFilename, 0) ;
2301 0 ▶ else if (pPerlParam && SvROK(pPerlParam))
Branch: 2 branches
BranchTrueFalseTotal
else if (pPerlParam && SvROK(pPerlParam)) 0 0 0
else if (pPerlParam && SvROK(pPerlParam)) 0 0 0
2302 0 args[0] = (SV *)GetHashValueSVinc (r, (HV *)SvRV(pPerlParam), "inputfile", &sv_undef) ;
2303 else
2304 {
2305 0 LogError (r, rcCannotCheckUri) ;
2306 0 return rcCannotCheckUri ;
2307 }
2308  
2309 0 ▶ if (r -> Config.pAllow)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Config.pAllow) 0 0 0
2310 {
2311 0 CallStoredCV (r, "ALLOW", r -> Config.pAllow, 1, args, 0, &pRet) ;
2312 0 ▶ if (pRet && !SvTRUE(pRet))
Branch: 2 branches
BranchTrueFalseTotal
if (pRet && !SvTRUE(pRet)) 0 0 0
if (pRet && !SvTRUE(pRet)) 0 0 0
2313 {
2314 0 strncpy (r -> errdat1, SvPV(args[0], l), sizeof(r -> errdat1) - 1) ;
2315 0 SvREFCNT_dec(args[0]) ;
2316 0 ▶ if (pRet)
Branch: 1 branch
BranchTrueFalseTotal
if (pRet) 0 0 0
2317 0 SvREFCNT_dec(pRet) ;
2318 0 LogError (r, rcForbidden) ;
2319 0 return rcForbidden ;
2320 }
2321 0 ▶ if (pRet)
Branch: 1 branch
BranchTrueFalseTotal
if (pRet) 0 0 0
2322 0 SvREFCNT_dec(pRet) ;
2323 }
2324  
2325 0 ▶ if (r -> Config.pUriMatch)
Branch: 1 branch
BranchTrueFalseTotal
if (r -> Config.pUriMatch) 0 0 0
2326 {
2327 0 CallStoredCV (r, "URIMATCH", r -> Config.pUriMatch, 1, args, 0, &pRet) ;
2328 0 ▶ if (pRet && !SvTRUE(pRet))
Branch: 2 branches
BranchTrueFalseTotal
if (pRet && !SvTRUE(pRet)) 0 0 0
if (pRet && !SvTRUE(pRet)) 0 0 0
2329 {
2330 0 strncpy (r -> errdat1, SvPV(args[0], l), sizeof(r -> errdat1) - 1) ;
2331 0 SvREFCNT_dec(args[0]) ;
2332 0 ▶ if (pRet)
Branch: 1 branch
BranchTrueFalseTotal
if (pRet) 0 0 0
2333 0 SvREFCNT_dec(pRet) ;
2334 0 return rcDecline ;
2335 }
2336 0 ▶ if (pRet)
Branch: 1 branch
BranchTrueFalseTotal
if (pRet) 0 0 0
2337 0 SvREFCNT_dec(pRet) ;
2338 }
2339 0 SvREFCNT_dec(args[0]) ;
2340 }
2341  
2342 0 return ok ;
2343 }
2344  
2345  
2346  
2347  
2348 0 int embperl_InitRequestComponent (/*in*/ pTHX_
2349 /*in*/ SV * pApacheReqSV,
2350 /*in*/ SV * pPerlParam,
2351 /*out*/tReq * * ppReq)
2352  
2353 {
2354 int rc ;
2355 tComponent * pComponent ;
2356
2357 0 ▶ if ((rc = embperl_InitRequest (aTHX_ pApacheReqSV, pPerlParam, ppReq)) != ok)
Branch: 1 branch
BranchTrueFalseTotal
if ((rc = embperl_InitRequest (aTHX_ pApacheReqSV, pPerlParam, ppReq)) != ok) 0 0 0
2358 0 return rc ;
2359  
2360 0 return embperl_SetupComponent (*ppReq, pPerlParam, &pComponent) ;
2361 }
2362  
« epeval.c ↑ Summary epio.c »