summaryrefslogtreecommitdiff
path: root/src/gmrequest.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-22 11:37:15 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-22 11:37:15 +0300
commit8700c039dc04b4c9f22584d4e901ed372442b0f4 (patch)
treec89a1c5cda9baa3204b46df0162f5b1ba62add04 /src/gmrequest.c
parentc6182b6b4158a3227546ae55895b72a326db19fb (diff)
DocumentWidget: Drawing side elements
The banner appears on the left, if there is room in the margin. Also added a document timestamp in the bottom to see when the data was received.
Diffstat (limited to 'src/gmrequest.c')
-rw-r--r--src/gmrequest.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gmrequest.c b/src/gmrequest.c
index 43cc874a..b667c82a 100644
--- a/src/gmrequest.c
+++ b/src/gmrequest.c
@@ -44,6 +44,7 @@ void init_GmResponse(iGmResponse *d) {
44 d->certFlags = 0; 44 d->certFlags = 0;
45 iZap(d->certValidUntil); 45 iZap(d->certValidUntil);
46 init_String(&d->certSubject); 46 init_String(&d->certSubject);
47 iZap(d->when);
47} 48}
48 49
49void initCopy_GmResponse(iGmResponse *d, const iGmResponse *other) { 50void initCopy_GmResponse(iGmResponse *d, const iGmResponse *other) {
@@ -53,6 +54,7 @@ void initCopy_GmResponse(iGmResponse *d, const iGmResponse *other) {
53 d->certFlags = other->certFlags; 54 d->certFlags = other->certFlags;
54 d->certValidUntil = other->certValidUntil; 55 d->certValidUntil = other->certValidUntil;
55 initCopy_String(&d->certSubject, &other->certSubject); 56 initCopy_String(&d->certSubject, &other->certSubject);
57 d->when = other->when;
56} 58}
57 59
58void deinit_GmResponse(iGmResponse *d) { 60void deinit_GmResponse(iGmResponse *d) {
@@ -68,6 +70,7 @@ void clear_GmResponse(iGmResponse *d) {
68 d->certFlags = 0; 70 d->certFlags = 0;
69 iZap(d->certValidUntil); 71 iZap(d->certValidUntil);
70 clear_String(&d->certSubject); 72 clear_String(&d->certSubject);
73 iZap(d->when);
71} 74}
72 75
73iGmResponse *copy_GmResponse(const iGmResponse *d) { 76iGmResponse *copy_GmResponse(const iGmResponse *d) {
@@ -83,6 +86,7 @@ void serialize_GmResponse(const iGmResponse *d, iStream *outs) {
83 write32_Stream(outs, d->certFlags); 86 write32_Stream(outs, d->certFlags);
84 serialize_Date(&d->certValidUntil, outs); 87 serialize_Date(&d->certValidUntil, outs);
85 serialize_String(&d->certSubject, outs); 88 serialize_String(&d->certSubject, outs);
89 /* TODO: Include the timestamp. */
86} 90}
87 91
88void deserialize_GmResponse(iGmResponse *d, iStream *ins) { 92void deserialize_GmResponse(iGmResponse *d, iStream *ins) {
@@ -270,6 +274,7 @@ static void readIncoming_GmRequest_(iAnyObject *obj) {
270 restartTimeout_GmRequest_(d); 274 restartTimeout_GmRequest_(d);
271 notifyUpdate = iTrue; 275 notifyUpdate = iTrue;
272 } 276 }
277 initCurrent_Time(&d->resp.when);
273 delete_Block(data); 278 delete_Block(data);
274 unlock_Mutex(&d->mutex); 279 unlock_Mutex(&d->mutex);
275 if (notifyUpdate) { 280 if (notifyUpdate) {
@@ -287,6 +292,7 @@ static void requestFinished_GmRequest_(iAnyObject *obj) {
287 iBlock *data = readAll_TlsRequest(d->req); 292 iBlock *data = readAll_TlsRequest(d->req);
288 iAssert(isEmpty_Block(data)); 293 iAssert(isEmpty_Block(data));
289 delete_Block(data); 294 delete_Block(data);
295 initCurrent_Time(&d->resp.when);
290 } 296 }
291 SDL_RemoveTimer(d->timeoutId); 297 SDL_RemoveTimer(d->timeoutId);
292 d->timeoutId = 0; 298 d->timeoutId = 0;