Check-in [361b4d2c62]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Style(9)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | scgi
Files: files | file ages | folders
SHA1:361b4d2c62b3c9bbca349c961d1b0796d4645525
User & Date: bapt 2015-05-18 11:43:48
Context
2015-11-19
13:30
Create new branch named "capsisum" check-in: 21f16f1aeb user: bapt tags: capsisum
2015-05-18
11:43
Style(9) Leaf check-in: 361b4d2c62 user: bapt tags: scgi
2015-05-17
22:11
Remove debugging informations check-in: 759e9a77b3 user: bapt tags: scgi
Changes

Changes to web/cblogweb.c.

514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
	}

	if (type != CBLOG_ATOM && criteria.feed)
			type = CBLOG_ATOM;

	/* work set the good date format and display everything */
	switch (type) {
		case CBLOG_ATOM:
			sql_text(sqlite, &date, "select strftime('%%Y-%%m-%%dT%%H:%%M:%%SZ','now');");

			ucl_object_insert_key(out, ucl_object_fromstring(date),
			    "gentate", 0, false);
			free(date);

			khttp_head(&r, kresps[KRESP_CONTENT_TYPE],
			    "application/atom+xml");

			strlcat(cspath, "/atom.cs", MAXPATHLEN);
			break;
		case CBLOG_ERR:
			snprintf(cspath, MAXPATHLEN, "%s/default.cs", tplpath);
			khttp_head(&r, kresps[KRESP_STATUS],
			    "%s", khttps[KHTTP_404]);
			break;
		case CBLOG_POST_REDIRECT:
			snprintf(cspath, MAXPATHLEN, "%s/default.cs", tplpath);
			khttp_head(&r, kresps[KRESP_LOCATION], "%s", reqpath);
			khttp_head(&r, kresps[KRESP_STATUS],
			    "%s", khttps[KHTTP_302]);
			set_tags(out, sqlite);
			break;
		default:
			khttp_head(&r, kresps[KRESP_CONTENT_TYPE], "%s ; charset=UTF-8",
			    kmimetypes[KMIME_TEXT_HTML]);
			if (type == CBLOG_POST)
				set_tags(out, sqlite);
			if (r.fieldmap[KEY_VIEWSOURCE] != NULL)
				ucl_object_insert_key(out, ucl_object_frombool(true), "viewsource", 0, false);
			snprintf(cspath, MAXPATHLEN, "%s/default.cs", tplpath);
			khttp_head(&r, kresps[KRESP_STATUS],
			    "%s", khttps[KHTTP_200]);
			break;
	}

	khttp_body(&r);
	bzero(&tpl, sizeof(tpl));
	tpl.udata = &r;
	tpl.data = out;
	tpl.addchar = &cblog_putc;







|
|

|
|
|

|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
	}

	if (type != CBLOG_ATOM && criteria.feed)
			type = CBLOG_ATOM;

	/* work set the good date format and display everything */
	switch (type) {
	case CBLOG_ATOM:
		sql_text(sqlite, &date, "select strftime('%%Y-%%m-%%dT%%H:%%M:%%SZ','now');");

		ucl_object_insert_key(out, ucl_object_fromstring(date),
		    "gentate", 0, false);
		free(date);

		khttp_head(&r, kresps[KRESP_CONTENT_TYPE],
		    "application/atom+xml");

		strlcat(cspath, "/atom.cs", MAXPATHLEN);
		break;
	case CBLOG_ERR:
		snprintf(cspath, MAXPATHLEN, "%s/default.cs", tplpath);
		khttp_head(&r, kresps[KRESP_STATUS],
		    "%s", khttps[KHTTP_404]);
		break;
	case CBLOG_POST_REDIRECT:
		snprintf(cspath, MAXPATHLEN, "%s/default.cs", tplpath);
		khttp_head(&r, kresps[KRESP_LOCATION], "%s", reqpath);
		khttp_head(&r, kresps[KRESP_STATUS],
		    "%s", khttps[KHTTP_302]);
		set_tags(out, sqlite);
		break;
	default:
		khttp_head(&r, kresps[KRESP_CONTENT_TYPE], "%s ; charset=UTF-8",
		    kmimetypes[KMIME_TEXT_HTML]);
		if (type == CBLOG_POST)
			set_tags(out, sqlite);
		if (r.fieldmap[KEY_VIEWSOURCE] != NULL)
			ucl_object_insert_key(out, ucl_object_frombool(true), "viewsource", 0, false);
		snprintf(cspath, MAXPATHLEN, "%s/default.cs", tplpath);
		khttp_head(&r, kresps[KRESP_STATUS],
		    "%s", khttps[KHTTP_200]);
		break;
	}

	khttp_body(&r);
	bzero(&tpl, sizeof(tpl));
	tpl.udata = &r;
	tpl.data = out;
	tpl.addchar = &cblog_putc;