]>
Commit | Line | Data |
---|---|---|
495e7591 AM |
1 | Index: squid/src/gopher.c |
2 | diff -c squid/src/gopher.c:1.162.2.6 squid/src/gopher.c:1.162.2.7 | |
3 | *** squid/src/gopher.c:1.162.2.6 Sun Sep 1 06:38:04 2002 | |
4 | --- squid/src/gopher.c Sat Nov 29 01:38:36 2003 | |
5 | *************** | |
6 | *** 77,85 **** | |
7 | HTML_CSO_PAGE | |
8 | } conversion; | |
9 | int HTML_header_added; | |
10 | char type_id; | |
11 | char request[MAX_URL]; | |
12 | - int data_in; | |
13 | int cso_recno; | |
14 | int len; | |
15 | char *buf; /* pts to a 4k page */ | |
16 | --- 77,85 ---- | |
17 | HTML_CSO_PAGE | |
18 | } conversion; | |
19 | int HTML_header_added; | |
20 | + int HTML_pre; | |
21 | char type_id; | |
22 | char request[MAX_URL]; | |
23 | int cso_recno; | |
24 | int len; | |
25 | char *buf; /* pts to a 4k page */ | |
26 | *************** | |
27 | *** 265,274 **** | |
28 | gopherEndHTML(GopherStateData * gopherState) | |
29 | { | |
30 | StoreEntry *e = gopherState->entry; | |
31 | ! if (!gopherState->data_in) { | |
32 | gopherHTMLHeader(e, "Server Return Nothing", NULL); | |
33 | storeAppendPrintf(e, "<P>The Gopher query resulted in a blank response</P>"); | |
34 | ! } else { | |
35 | storeAppendPrintf(e, "</PRE>\n"); | |
36 | } | |
37 | gopherHTMLFooter(e); | |
38 | --- 265,274 ---- | |
39 | gopherEndHTML(GopherStateData * gopherState) | |
40 | { | |
41 | StoreEntry *e = gopherState->entry; | |
42 | ! if (!gopherState->HTML_header_added) { | |
43 | gopherHTMLHeader(e, "Server Return Nothing", NULL); | |
44 | storeAppendPrintf(e, "<P>The Gopher query resulted in a blank response</P>"); | |
45 | ! } else if (gopherState->HTML_pre) { | |
46 | storeAppendPrintf(e, "</PRE>\n"); | |
47 | } | |
48 | gopherHTMLFooter(e); | |
49 | *************** | |
50 | *** 310,317 **** | |
51 | gopherHTMLFooter(entry); | |
52 | /* now let start sending stuff to client */ | |
53 | storeBufferFlush(entry); | |
54 | ! gopherState->data_in = 1; | |
55 | ! | |
56 | return; | |
57 | } | |
58 | if (gopherState->conversion == HTML_CSO_PAGE) { | |
59 | --- 310,316 ---- | |
60 | gopherHTMLFooter(entry); | |
61 | /* now let start sending stuff to client */ | |
62 | storeBufferFlush(entry); | |
63 | ! gopherState->HTML_header_added = 1; | |
64 | return; | |
65 | } | |
66 | if (gopherState->conversion == HTML_CSO_PAGE) { | |
67 | *************** | |
68 | *** 324,331 **** | |
69 | gopherHTMLFooter(entry); | |
70 | /* now let start sending stuff to client */ | |
71 | storeBufferFlush(entry); | |
72 | ! gopherState->data_in = 1; | |
73 | ! | |
74 | return; | |
75 | } | |
76 | inbuf[len] = '\0'; | |
77 | --- 323,329 ---- | |
78 | gopherHTMLFooter(entry); | |
79 | /* now let start sending stuff to client */ | |
80 | storeBufferFlush(entry); | |
81 | ! gopherState->HTML_header_added = 1; | |
82 | return; | |
83 | } | |
84 | inbuf[len] = '\0'; | |
85 | *************** | |
86 | *** 337,342 **** | |
87 | --- 335,341 ---- | |
88 | gopherHTMLHeader(entry, "Gopher Menu", NULL); | |
89 | strCat(outbuf, "<PRE>"); | |
90 | gopherState->HTML_header_added = 1; | |
91 | + gopherState->HTML_pre = 1; | |
92 | } | |
93 | while ((pos != NULL) && (pos < inbuf + len)) { | |
94 | ||
95 | *************** | |
96 | *** 505,511 **** | |
97 | } | |
98 | safe_free(escaped_selector); | |
99 | strCat(outbuf, tmpbuf); | |
100 | - gopherState->data_in = 1; | |
101 | } else { | |
102 | memset(line, '\0', TEMP_BUF_SIZE); | |
103 | continue; | |
104 | --- 504,509 ---- | |
105 | *************** | |
106 | *** 543,549 **** | |
107 | snprintf(tmpbuf, TEMP_BUF_SIZE, "%s\n", html_quote(result)); | |
108 | } | |
109 | strCat(outbuf, tmpbuf); | |
110 | - gopherState->data_in = 1; | |
111 | break; | |
112 | } else { | |
113 | int code; | |
114 | --- 541,546 ---- | |
115 | *************** | |
116 | *** 571,577 **** | |
117 | /* Print the message the server returns */ | |
118 | snprintf(tmpbuf, TEMP_BUF_SIZE, "</PRE><HR noshade size=\"1px\"><H2>%s</H2>\n<PRE>", html_quote(result)); | |
119 | strCat(outbuf, tmpbuf); | |
120 | - gopherState->data_in = 1; | |
121 | break; | |
122 | } | |
123 | ||
124 | --- 568,573 ---- |