1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
--- FastCGI/WebObjects.c.orig Wed Mar 26 21:13:09 2003
+++ FastCGI/WebObjects.c Sun May 13 07:08:27 2007
@@ -212,7 +212,7 @@
WOLog(WO_INFO,"<FastCGI> Signal %s caught", strsignal(signum));
break;
case SIGPIPE : WOLog(WO_WARN,"<FastCGI> Signal %s caught", strsignal(signum));
- exit(-1);
+ break;
case SIGTERM : WOLog(WO_ERR,"<FastCGI> Signal %s caught", strsignal(signum));
exit(-1);
default: WOLog( WO_INFO,"<FastCGI> Signal %s caught", strsignal(signum));
@@ -327,19 +327,7 @@
/*
* extract WebObjects application name from URI
*/
- qs = FCGX_GetParam("QUERY_STRING", hdrp);
- if (qs) {
- qs_len = strlen(qs);
- } else {
- qs_len = 0;
- }
-
- if (qs_len > 0) {
- /* Make room for query string and "?" */
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1 + qs_len + 2);
- } else {
- url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
- }
+ url = WOMALLOC(strlen(path_info) + strlen(script_name) + 1);
strcpy(url, script_name);
strcat(url, path_info);
WOLog(WO_INFO,"<FastCGI> new request: %s",url);
@@ -459,25 +447,28 @@
*/
}
}
-
- WOLog ( WO_INFO, "Content length: %d",req->content_length );
- WOLog ( WO_INFO, "--------Content: %s---",req->content );
- if ( req->content ) {
- content_buffer = (char *)malloc (req->content_length+1);
- strncpy (content_buffer,req->content,req->content_length);
- content_buffer[req->content_length] = '\0';
- WOLog ( WO_INFO, "---content buffer: %s",content_buffer );
- strncpy (req->content,content_buffer,req->content_length+1);
- free (content_buffer);
- }
- //WOLog ( WO_INFO, "Content_length: %d, real: %d", req->content_length,strlen (req->content) );
+
+ WOLog(WO_INFO, "Content length: %d",req->content_length);
+ WOLog(WO_INFO, "--------Content: %s---",req->content);
+ if (req->content) {
+ content_buffer = (char *)WOMALLOC(req->content_length+1);
+ strncpy(content_buffer,req->content,req->content_length);
+ content_buffer[req->content_length] = '\0';
+ WOLog(WO_INFO, "---content buffer: %s",content_buffer);
+ strncpy(req->content,content_buffer,req->content_length+1);
+ WOFREE(content_buffer);
+ }
+ //WOLog ( WO_INFO, "Content_length: %d, real: %d", req->content_length,strlen (req->content) );
/* Always get the query string */
- /* Don't add ? if the query string is empty. */
+ qs = FCGX_GetParam("QUERY_STRING", hdrp);
+ if (qs) {
+ qs_len = strlen(qs);
+ } else {
+ qs_len = 0;
+ }
+
if (qs_len > 0) {
- /* Add the query string to the full URL - useful for debugging */
- strcat(url, "?");
- strcat(url, qs);
wc.queryString.start = qs;
wc.queryString.length = qs_len;
WOLog(WO_INFO,"<FastCGI> new request with Query String: %s", qs);
@@ -493,10 +484,10 @@
resp_free(resp); /* dump the response */
}
-#if defined(FINDLEAKS)
- WOFREE(url); /* just for neatness */
+ WOFREE(url);
req_free(req);
+#if defined(FINDLEAKS)
showleaks();
#endif
}
|