summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gopher.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gopher.c b/src/gopher.c
index 0a7489ba..fa8495d7 100644
--- a/src/gopher.c
+++ b/src/gopher.c
@@ -160,11 +160,11 @@ void open_Gopher(iGopher *d, const iString *url) {
160 d->type = '0'; 160 d->type = '0';
161 } 161 }
162 else if (parts.path.start < parts.path.end) { 162 else if (parts.path.start < parts.path.end) {
163 d->type = *parts.path.start; 163 d->type = *parts.path.start;
164 parts.path.start++; 164 parts.path.start++;
165 } 165 }
166 else { 166 else {
167 d->type = '1'; 167 d->type = '1';
168 } 168 }
169 if (d->type == '7' && isEmpty_Range(&parts.query)) { 169 if (d->type == '7' && isEmpty_Range(&parts.query)) {
170 /* Ask for the query parameters first. */ 170 /* Ask for the query parameters first. */
@@ -204,12 +204,16 @@ void open_Gopher(iGopher *d, const iString *url) {
204 } 204 }
205 d->isPre = iFalse; 205 d->isPre = iFalse;
206 open_Socket(d->socket); 206 open_Socket(d->socket);
207 writeData_Socket(d->socket, parts.path.start, size_Range(&parts.path)); 207 const iString *reqPath =
208 collect_String(urlDecodeExclude_String(collectNewRange_String(parts.path), "\t"));
209 writeData_Socket(d->socket, cstr_String(reqPath), size_String(reqPath));
208 if (!isEmpty_Range(&parts.query)) { 210 if (!isEmpty_Range(&parts.query)) {
209 iAssert(*parts.query.start == '?'); 211 iAssert(*parts.query.start == '?');
210 parts.query.start++; 212 parts.query.start++;
211 writeData_Socket(d->socket, "\t", 1); 213 writeData_Socket(d->socket, "\t", 1);
212 writeData_Socket(d->socket, parts.query.start, size_Range(&parts.query)); 214 const iString *reqQuery =
215 collect_String(urlDecode_String(collectNewRange_String(parts.query)));
216 writeData_Socket(d->socket, cstr_String(reqQuery), size_String(reqQuery));
213 } 217 }
214 writeData_Socket(d->socket, "\r\n", 2); 218 writeData_Socket(d->socket, "\r\n", 2);
215} 219}