diff options
| author | 2022-11-25 12:21:26 +0100 | |
|---|---|---|
| committer | 2022-11-25 12:21:26 +0100 | |
| commit | 9df1cb129e1702f1a271a948033447167c5c06d7 (patch) | |
| tree | 33fffcd0aa1c61764342e11777edca3632a47e41 | |
| parent | On Update + Person, call object_del() before actor_add(). (diff) | |
| download | snac2-9df1cb129e1702f1a271a948033447167c5c06d7.tar.gz snac2-9df1cb129e1702f1a271a948033447167c5c06d7.tar.xz snac2-9df1cb129e1702f1a271a948033447167c5c06d7.zip | |
Use macro XS_ALL were possible.
| -rw-r--r-- | data.c | 5 | ||||
| -rw-r--r-- | html.c | 4 | ||||
| -rw-r--r-- | main.c | 2 |
3 files changed, 4 insertions, 7 deletions
| @@ -433,9 +433,6 @@ int object_add(const char *id, d_char *obj) | |||
| 433 | return 204; /* No content */ | 433 | return 204; /* No content */ |
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | // if (xs_dict_get(obj, "suspended") != NULL) | ||
| 437 | // srv_log(xs_fmt("object_add suspended: true %s", id)); | ||
| 438 | |||
| 439 | if ((f = fopen(fn, "w")) != NULL) { | 436 | if ((f = fopen(fn, "w")) != NULL) { |
| 440 | flock(fileno(f), LOCK_EX); | 437 | flock(fileno(f), LOCK_EX); |
| 441 | 438 | ||
| @@ -1246,7 +1243,7 @@ int static_get(snac *snac, const char *id, d_char **data, int *size) | |||
| 1246 | FILE *f; | 1243 | FILE *f; |
| 1247 | int status = 404; | 1244 | int status = 404; |
| 1248 | 1245 | ||
| 1249 | *size = 0xfffffff; | 1246 | *size = XS_ALL; |
| 1250 | 1247 | ||
| 1251 | if ((f = fopen(fn, "rb")) != NULL) { | 1248 | if ((f = fopen(fn, "rb")) != NULL) { |
| 1252 | *data = xs_read(f, size); | 1249 | *data = xs_read(f, size); |
| @@ -1008,7 +1008,7 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char * | |||
| 1008 | status = 200; | 1008 | status = 200; |
| 1009 | } | 1009 | } |
| 1010 | else { | 1010 | else { |
| 1011 | xs *list = local_list(&snac, 0xfffffff); | 1011 | xs *list = local_list(&snac, XS_ALL); |
| 1012 | 1012 | ||
| 1013 | *body = html_timeline(&snac, list, 1); | 1013 | *body = html_timeline(&snac, list, 1); |
| 1014 | *b_size = strlen(*body); | 1014 | *b_size = strlen(*body); |
| @@ -1034,7 +1034,7 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char * | |||
| 1034 | else { | 1034 | else { |
| 1035 | snac_debug(&snac, 1, xs_fmt("building timeline")); | 1035 | snac_debug(&snac, 1, xs_fmt("building timeline")); |
| 1036 | 1036 | ||
| 1037 | xs *list = timeline_list(&snac, 0xfffffff); | 1037 | xs *list = timeline_list(&snac, XS_ALL); |
| 1038 | 1038 | ||
| 1039 | *body = html_timeline(&snac, list, 0); | 1039 | *body = html_timeline(&snac, list, 0); |
| 1040 | *b_size = strlen(*body); | 1040 | *b_size = strlen(*body); |
| @@ -156,7 +156,7 @@ int main(int argc, char *argv[]) | |||
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | if (strcmp(cmd, "timeline") == 0) { | 158 | if (strcmp(cmd, "timeline") == 0) { |
| 159 | xs *list = local_list(&snac, 0xfffffff); | 159 | xs *list = local_list(&snac, XS_ALL); |
| 160 | xs *body = html_timeline(&snac, list, 1); | 160 | xs *body = html_timeline(&snac, list, 1); |
| 161 | 161 | ||
| 162 | printf("%s\n", body); | 162 | printf("%s\n", body); |