summaryrefslogtreecommitdiff
path: root/src/gmrequest.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-28 23:41:35 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-28 23:41:35 +0300
commitd921021132367076cd2a5f120b3a49db6e29acf7 (patch)
treeb118977ae998023c71d5e2e2c69d3051dfb77e4a /src/gmrequest.c
parent1a8a0170168568d1c3f075cc2996aceda08e790d (diff)
Loading and rendering images in the document
There can be multiple inline media requests on the page. Images are always associated with a link.
Diffstat (limited to 'src/gmrequest.c')
-rw-r--r--src/gmrequest.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gmrequest.c b/src/gmrequest.c
index ad0c5ed7..25ff90af 100644
--- a/src/gmrequest.c
+++ b/src/gmrequest.c
@@ -163,8 +163,6 @@ static void requestFinished_GmRequest_(iAnyObject *obj) {
163 } 163 }
164 SDL_RemoveTimer(d->timeoutId); 164 SDL_RemoveTimer(d->timeoutId);
165 d->timeoutId = 0; 165 d->timeoutId = 0;
166// iReleaseLater(d->req);
167// d->req = NULL;
168 d->state = finished_GmRequestState; 166 d->state = finished_GmRequestState;
169 unlock_Mutex(&d->mutex); 167 unlock_Mutex(&d->mutex);
170 iNotifyAudience(d, finished, GmRequestFinished); 168 iNotifyAudience(d, finished, GmRequestFinished);
@@ -193,6 +191,15 @@ void submit_GmRequest(iGmRequest *d) {
193 else if (endsWithCase_String(path, ".txt")) { 191 else if (endsWithCase_String(path, ".txt")) {
194 setCStr_String(&d->header, "text/plain"); 192 setCStr_String(&d->header, "text/plain");
195 } 193 }
194 else if (endsWithCase_String(path, ".png")) {
195 setCStr_String(&d->header, "image/png");
196 }
197 else if (endsWithCase_String(path, ".jpg") || endsWithCase_String(path, ".jpeg")) {
198 setCStr_String(&d->header, "image/jpeg");
199 }
200 else if (endsWithCase_String(path, ".gif")) {
201 setCStr_String(&d->header, "image/gif");
202 }
196 else { 203 else {
197 setCStr_String(&d->header, "application/octet-stream"); 204 setCStr_String(&d->header, "application/octet-stream");
198 } 205 }