Project

General

Profile

Bug #1732 ยป replace_buffer_append_string_with_macros.patch

-- dierbro - Anonymous, 2008-07-26 14:14

View differences:

src/mod_proxy_core_protocol.c (copia locale)
44 44

  
45 45
	/* append protocol name to list of names. */
46 46
	if(!buffer_is_empty(protocol_names)) {
47
		buffer_append_string(protocol_names, ", '");
47
		BUFFER_APPEND_STRING_CONST(protocol_names, ", '");
48 48
	} else {
49
		buffer_append_string(protocol_names, "'");
49
		BUFFER_APPEND_STRING_CONST(protocol_names, "'");
50 50
	}
51 51
	buffer_append_string(protocol_names, BUF_STR(protocol->name));
52
	buffer_append_string(protocol_names, "'");
52
	BUFFER_APPEND_STRING_CONST(protocol_names, "'");
53 53
}
54 54

  
55 55
proxy_protocol *proxy_get_protocol(buffer *name) {
src/connections.c (copia locale)
317 317
					   " <head>\n"
318 318
					   "  <title>");
319 319
			buffer_append_long(b, con->http_status);
320
			buffer_append_string(b, " - ");
320
			BUFFER_APPEND_STRING_CONST(b, " - ");
321 321
			buffer_append_string(b, get_http_status_name(con->http_status));
322 322

  
323 323
			buffer_append_string(b,
......
326 326
					     " <body>\n"
327 327
					     "  <h1>");
328 328
			buffer_append_long(b, con->http_status);
329
			buffer_append_string(b, " - ");
329
			BUFFER_APPEND_STRING_CONST(b, " - ");
330 330
			buffer_append_string(b, get_http_status_name(con->http_status));
331 331

  
332 332
			buffer_append_string(b,"</h1>\n"
src/mod_staticfile.c (copia locale)
251 251

  
252 252
			b = chunkqueue_get_append_buffer(con->send);
253 253

  
254
			buffer_copy_string(b, "\r\n--");
254
			BUFFER_COPY_STRING_CONST(b, "\r\n--");
255 255
			buffer_append_string(b, boundary);
256 256

  
257 257
			/* write Content-Range */
258
			buffer_append_string(b, "\r\nContent-Range: bytes ");
258
			BUFFER_APPEND_STRING_CONST(b, "\r\nContent-Range: bytes ");
259 259
			buffer_append_off_t(b, r->start);
260
			buffer_append_string(b, "-");
260
			BUFFER_APPEND_STRING_CONST(b, "-");
261 261
			buffer_append_off_t(b, r->end);
262
			buffer_append_string(b, "/");
262
			BUFFER_APPEND_STRING_CONST(b, "/");
263 263
			buffer_append_off_t(b, sce->st.st_size);
264 264

  
265
			buffer_append_string(b, "\r\nContent-Type: ");
265
			BUFFER_APPEND_STRING_CONST(b, "\r\nContent-Type: ");
266 266
			buffer_append_string_buffer(b, content_type);
267 267

  
268 268
			/* write END-OF-HEADER */
269
			buffer_append_string(b, "\r\n\r\n");
269
			BUFFER_APPEND_STRING_CONST(b, "\r\n\r\n");
270 270

  
271 271
			con->response.content_length += b->used - 1;
272 272
			con->send->bytes_in += b->used - 1;
src/network.c (copia locale)
623 623
	b = buffer_init();
624 624

  
625 625
	buffer_copy_string_buffer(b, srv->srvconf.bindhost);
626
	buffer_append_string(b, ":");
626
	BUFFER_APPEND_STRING_CONST(b, ":");
627 627
	buffer_append_long(b, srv->srvconf.port);
628 628

  
629 629
	if (0 != network_server_init(srv, b, srv->config_storage[0])) {
src/configfile.c (copia locale)
479 479
				if (t->input[t->offset + 1] == '>') {
480 480
					t->offset += 2;
481 481

  
482
					buffer_copy_string(token, "=>");
482
					BUFFER_COPY_STRING_CONST(token, "=>");
483 483

  
484 484
					tid = TK_ARRAY_ASSIGN;
485 485
				} else {
......
493 493
				if (t->input[t->offset + 1] == '=') {
494 494
					t->offset += 2;
495 495

  
496
					buffer_copy_string(token, "==");
496
					BUFFER_COPY_STRING_CONST(token, "==");
497 497

  
498 498
					tid = TK_EQ;
499 499
				} else if (t->input[t->offset + 1] == '~') {
500 500
					t->offset += 2;
501 501

  
502
					buffer_copy_string(token, "=~");
502
					BUFFER_COPY_STRING_CONST(token, "=~");
503 503

  
504 504
					tid = TK_MATCH;
505 505
				} else {
......
532 532
				if (t->input[t->offset + 1] == '=') {
533 533
					t->offset += 2;
534 534

  
535
					buffer_copy_string(token, "!=");
535
					BUFFER_COPY_STRING_CONST(token, "!=");
536 536

  
537 537
					tid = TK_NE;
538 538
				} else if (t->input[t->offset + 1] == '~') {
539 539
					t->offset += 2;
540 540

  
541
					buffer_copy_string(token, "!~");
541
					BUFFER_COPY_STRING_CONST(token, "!~");
542 542

  
543 543
					tid = TK_NOMATCH;
544 544
				} else {
......
593 593
				}
594 594
				t->in_key = 1;
595 595
				tid = TK_EOL;
596
				buffer_copy_string(token, "(EOL)");
596
				BUFFER_COPY_STRING_CONST(token, "(EOL)");
597 597
			} else {
598 598
				config_skip_newline(t);
599 599
				t->line_pos = 1;
......
604 604
			if (t->in_brace > 0) {
605 605
				tid = TK_COMMA;
606 606

  
607
				buffer_copy_string(token, "(COMMA)");
607
				BUFFER_COPY_STRING_CONST(token, "(COMMA)");
608 608
			}
609 609

  
610 610
			t->offset++;
......
613 613
		case '"':
614 614
			/* search for the terminating " */
615 615
			start = t->input + t->offset + 1;
616
			buffer_copy_string(token, "");
616
			BUFFER_COPY_STRING_CONST(token, "");
617 617

  
618 618
			for (i = 1; t->input[t->offset + i]; i++) {
619 619
				if (t->input[t->offset + i] == '\\' &&
......
659 659

  
660 660
			tid = TK_LPARAN;
661 661

  
662
			buffer_copy_string(token, "(");
662
			BUFFER_COPY_STRING_CONST(token, "(");
663 663
			break;
664 664
		case ')':
665 665
			t->offset++;
......
667 667

  
668 668
			tid = TK_RPARAN;
669 669

  
670
			buffer_copy_string(token, ")");
670
			BUFFER_COPY_STRING_CONST(token, ")");
671 671
			break;
672 672
		case '$':
673 673
			t->offset++;
......
676 676
			t->in_cond = 1;
677 677
			t->in_key = 0;
678 678

  
679
			buffer_copy_string(token, "$");
679
			BUFFER_COPY_STRING_CONST(token, "$");
680 680

  
681 681
			break;
682 682

  
683 683
		case '+':
684 684
			if (t->input[t->offset + 1] == '=') {
685 685
				t->offset += 2;
686
				buffer_copy_string(token, "+=");
686
				BUFFER_COPY_STRING_CONST(token, "+=");
687 687
				tid = TK_APPEND;
688 688
			} else {
689 689
				t->offset++;
690 690
				tid = TK_PLUS;
691
				buffer_copy_string(token, "+");
691
				BUFFER_COPY_STRING_CONST(token, "+");
692 692
			}
693 693
			break;
694 694

  
......
697 697

  
698 698
			tid = TK_LCURLY;
699 699

  
700
			buffer_copy_string(token, "{");
700
			BUFFER_COPY_STRING_CONST(token, "{");
701 701

  
702 702
			break;
703 703

  
......
706 706

  
707 707
			tid = TK_RCURLY;
708 708

  
709
			buffer_copy_string(token, "}");
709
			BUFFER_COPY_STRING_CONST(token, "}");
710 710

  
711 711
			break;
712 712

  
......
715 715

  
716 716
			tid = TK_LBRACKET;
717 717

  
718
			buffer_copy_string(token, "[");
718
			BUFFER_COPY_STRING_CONST(token, "[");
719 719

  
720 720
			break;
721 721

  
......
724 724

  
725 725
			tid = TK_RBRACKET;
726 726

  
727
			buffer_copy_string(token, "]");
727
			BUFFER_COPY_STRING_CONST(token, "]");
728 728

  
729 729
			break;
730 730
		case '#':
src/mod_scgi.c (copia locale)
786 786
			env.ptr[env.used] = NULL;
787 787

  
788 788
			b = buffer_init();
789
			buffer_copy_string(b, "exec ");
789
			BUFFER_COPY_STRING_CONST(b, "exec ");
790 790
			buffer_append_string_buffer(b, host->bin_path);
791 791

  
792 792
			/* exec the cgi */
src/mod_ssi_expr.c (copia locale)
60 60
			t->offset++;
61 61
			t->line_pos++;
62 62

  
63
			buffer_copy_string(token, "(=)");
63
			BUFFER_COPY_STRING_CONST(token, "(=)");
64 64

  
65 65
			break;
66 66
		case '>':
......
70 70

  
71 71
				tid = TK_GE;
72 72

  
73
				buffer_copy_string(token, "(>=)");
73
				BUFFER_COPY_STRING_CONST(token, "(>=)");
74 74
			} else {
75 75
				t->offset += 1;
76 76
				t->line_pos += 1;
77 77

  
78 78
				tid = TK_GT;
79 79

  
80
				buffer_copy_string(token, "(>)");
80
				BUFFER_COPY_STRING_CONST(token, "(>)");
81 81
			}
82 82

  
83 83
			break;
......
88 88

  
89 89
				tid = TK_LE;
90 90

  
91
				buffer_copy_string(token, "(<=)");
91
				BUFFER_COPY_STRING_CONST(token, "(<=)");
92 92
			} else {
93 93
				t->offset += 1;
94 94
				t->line_pos += 1;
95 95

  
96 96
				tid = TK_LT;
97 97

  
98
				buffer_copy_string(token, "(<)");
98
				BUFFER_COPY_STRING_CONST(token, "(<)");
99 99
			}
100 100

  
101 101
			break;
......
107 107

  
108 108
				tid = TK_NE;
109 109

  
110
				buffer_copy_string(token, "(!=)");
110
				BUFFER_COPY_STRING_CONST(token, "(!=)");
111 111
			} else {
112 112
				t->offset += 1;
113 113
				t->line_pos += 1;
114 114

  
115 115
				tid = TK_NOT;
116 116

  
117
				buffer_copy_string(token, "(!)");
117
				BUFFER_COPY_STRING_CONST(token, "(!)");
118 118
			}
119 119

  
120 120
			break;
......
125 125

  
126 126
				tid = TK_AND;
127 127

  
128
				buffer_copy_string(token, "(&&)");
128
				BUFFER_COPY_STRING_CONST(token, "(&&)");
129 129
			} else {
130 130
				log_error_write(srv, __FILE__, __LINE__, "sds",
131 131
						"pos:", t->line_pos,
......
141 141

  
142 142
				tid = TK_OR;
143 143

  
144
				buffer_copy_string(token, "(||)");
144
				BUFFER_COPY_STRING_CONST(token, "(||)");
145 145
			} else {
146 146
				log_error_write(srv, __FILE__, __LINE__, "sds",
147 147
						"pos:", t->line_pos,
......
184 184

  
185 185
			tid = TK_LPARAN;
186 186

  
187
			buffer_copy_string(token, "(");
187
			BUFFER_COPY_STRING_CONST(token, "(");
188 188
			break;
189 189
		case ')':
190 190
			t->offset++;
......
192 192

  
193 193
			tid = TK_RPARAN;
194 194

  
195
			buffer_copy_string(token, ")");
195
			BUFFER_COPY_STRING_CONST(token, ")");
196 196
			break;
197 197
		case '$':
198 198
			if (t->input[t->offset + 1] == '{') {
......
220 220
			} else if (NULL != (ds = (data_string *)array_get_element(p->ssi_vars, CONST_BUF_LEN(token)))) {
221 221
				buffer_copy_string_buffer(token, ds->value);
222 222
			} else {
223
				buffer_copy_string(token, "");
223
				BUFFER_COPY_STRING_CONST(token, "");
224 224
			}
225 225

  
226 226
			t->offset += i;
src/mod_webdav.c (copia locale)
503 503
	UNUSED(con);
504 504

  
505 505
	if (value) {
506
		buffer_append_string(b,"<");
506
		BUFFER_APPEND_STRING_CONST(b,"<");
507 507
		buffer_append_string(b, prop_name);
508
		buffer_append_string(b, " xmlns=\"");
508
		BUFFER_APPEND_STRING_CONST(b, " xmlns=\"");
509 509
		buffer_append_string(b, prop_ns);
510
		buffer_append_string(b, "\">");
510
		BUFFER_APPEND_STRING_CONST(b, "\">");
511 511

  
512 512
		buffer_append_string(b, value);
513 513

  
514
		buffer_append_string(b,"</");
514
		BUFFER_APPEND_STRING_CONST(b,"</");
515 515
		buffer_append_string(b, prop_name);
516
		buffer_append_string(b, ">");
516
		BUFFER_APPEND_STRING_CONST(b, ">");
517 517
	} else {
518
		buffer_append_string(b,"<");
518
		BUFFER_APPEND_STRING_CONST(b,"<");
519 519
		buffer_append_string(b, prop_name);
520
		buffer_append_string(b, " xmlns=\"");
520
		BUFFER_APPEND_STRING_CONST(b, " xmlns=\"");
521 521
		buffer_append_string(b, prop_ns);
522
		buffer_append_string(b, "\"/>");
522
		BUFFER_APPEND_STRING_CONST(b, "\"/>");
523 523
	}
524 524

  
525 525
	return 0;
......
529 529
static int webdav_gen_response_status_tag(server *srv, connection *con, physical *dst, int status, buffer *b) {
530 530
	UNUSED(srv);
531 531

  
532
	buffer_append_string(b,"<D:response xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
532
	BUFFER_APPEND_STRING_CONST(b,"<D:response xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
533 533

  
534
	buffer_append_string(b,"<D:href>\n");
534
	BUFFER_APPEND_STRING_CONST(b,"<D:href>\n");
535 535
	buffer_append_string_buffer(b, dst->rel_path);
536
	buffer_append_string(b,"</D:href>\n");
537
	buffer_append_string(b,"<D:status>\n");
536
	BUFFER_APPEND_STRING_CONST(b,"</D:href>\n");
537
	BUFFER_APPEND_STRING_CONST(b,"<D:status>\n");
538 538

  
539 539
	if (con->request.http_version == HTTP_VERSION_1_1) {
540 540
		BUFFER_COPY_STRING_CONST(b, "HTTP/1.1 ");
......
545 545
	BUFFER_APPEND_STRING_CONST(b, " ");
546 546
	buffer_append_string(b, get_http_status_name(status));
547 547

  
548
	buffer_append_string(b,"</D:status>\n");
549
	buffer_append_string(b,"</D:response>\n");
548
	BUFFER_APPEND_STRING_CONST(b,"</D:status>\n");
549
	BUFFER_APPEND_STRING_CONST(b,"</D:response>\n");
550 550

  
551 551
	return 0;
552 552
}
......
862 862

  
863 863
		if (0 == strcmp(prop_name, "resourcetype")) {
864 864
			if (S_ISDIR(sce->st.st_mode)) {
865
				buffer_append_string(b, "<D:resourcetype><D:collection/></D:resourcetype>");
865
				BUFFER_APPEND_STRING_CONST(b, "<D:resourcetype><D:collection/></D:resourcetype>");
866 866
				found = 1;
867 867
			}
868 868
		} else if (0 == strcmp(prop_name, "getcontenttype")) {
869 869
			if (S_ISDIR(sce->st.st_mode)) {
870
				buffer_append_string(b, "<D:getcontenttype>httpd/unix-directory</D:getcontenttype>");
870
				BUFFER_APPEND_STRING_CONST(b, "<D:getcontenttype>httpd/unix-directory</D:getcontenttype>");
871 871
				found = 1;
872 872
			} else if(S_ISREG(sce->st.st_mode)) {
873 873
				for (k = 0; k < con->conf.mimetypes->used; k++) {
......
876 876
					if (ds->key->used == 0) continue;
877 877

  
878 878
					if (buffer_is_equal_right_len(dst->path, ds->key, ds->key->used - 1)) {
879
						buffer_append_string(b,"<D:getcontenttype>");
879
						BUFFER_APPEND_STRING_CONST(b,"<D:getcontenttype>");
880 880
						buffer_append_string_buffer(b, ds->value);
881
						buffer_append_string(b, "</D:getcontenttype>");
881
						BUFFER_APPEND_STRING_CONST(b, "</D:getcontenttype>");
882 882
						found = 1;
883 883

  
884 884
						break;
......
886 886
				}
887 887
			}
888 888
		} else if (0 == strcmp(prop_name, "creationdate")) {
889
			buffer_append_string(b, "<D:creationdate ns0:dt=\"dateTime.tz\">");
889
			BUFFER_APPEND_STRING_CONST(b, "<D:creationdate ns0:dt=\"dateTime.tz\">");
890 890
			strftime(ctime_buf, sizeof(ctime_buf), "%Y-%m-%dT%H:%M:%SZ", gmtime(&(sce->st.st_ctime)));
891 891
			buffer_append_string(b, ctime_buf);
892
			buffer_append_string(b, "</D:creationdate>");
892
			BUFFER_APPEND_STRING_CONST(b, "</D:creationdate>");
893 893
			found = 1;
894 894
		} else if (0 == strcmp(prop_name, "getlastmodified")) {
895
			buffer_append_string(b,"<D:getlastmodified ns0:dt=\"dateTime.rfc1123\">");
895
			BUFFER_APPEND_STRING_CONST(b,"<D:getlastmodified ns0:dt=\"dateTime.rfc1123\">");
896 896
			strftime(mtime_buf, sizeof(mtime_buf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&(sce->st.st_mtime)));
897 897
			buffer_append_string(b, mtime_buf);
898
			buffer_append_string(b, "</D:getlastmodified>");
898
			BUFFER_APPEND_STRING_CONST(b, "</D:getlastmodified>");
899 899
			found = 1;
900 900
		} else if (0 == strcmp(prop_name, "getcontentlength")) {
901
			buffer_append_string(b,"<D:getcontentlength>");
901
			BUFFER_APPEND_STRING_CONST(b,"<D:getcontentlength>");
902 902
			buffer_append_off_t(b, sce->st.st_size);
903
			buffer_append_string(b, "</D:getcontentlength>");
903
			BUFFER_APPEND_STRING_CONST(b, "</D:getcontentlength>");
904 904
			found = 1;
905 905
		} else if (0 == strcmp(prop_name, "getcontentlanguage")) {
906
			buffer_append_string(b,"<D:getcontentlanguage>");
907
			buffer_append_string(b, "en");
908
			buffer_append_string(b, "</D:getcontentlanguage>");
906
			BUFFER_APPEND_STRING_CONST(b,"<D:getcontentlanguage>");
907
			BUFFER_APPEND_STRING_CONST(b, "en");
908
			BUFFER_APPEND_STRING_CONST(b, "</D:getcontentlanguage>");
909 909
			found = 1;
910 910
		}
911 911
	}
......
1124 1124

  
1125 1125
	b = chunkqueue_get_append_buffer(con->send);
1126 1126

  
1127
	buffer_copy_string(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
1127
	BUFFER_COPY_STRING_CONST(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
1128 1128

  
1129
	buffer_append_string(b,"<D:prop xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
1130
	buffer_append_string(b,"<D:lockdiscovery>\n");
1131
	buffer_append_string(b,"<D:activelock>\n");
1129
	BUFFER_APPEND_STRING_CONST(b,"<D:prop xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
1130
	BUFFER_APPEND_STRING_CONST(b,"<D:lockdiscovery>\n");
1131
	BUFFER_APPEND_STRING_CONST(b,"<D:activelock>\n");
1132 1132

  
1133
	buffer_append_string(b,"<D:lockscope>");
1134
	buffer_append_string(b,"<D:");
1133
	BUFFER_APPEND_STRING_CONST(b,"<D:lockscope>");
1134
	BUFFER_APPEND_STRING_CONST(b,"<D:");
1135 1135
	buffer_append_string(b, lockscope);
1136
	buffer_append_string(b, "/>");
1137
	buffer_append_string(b,"</D:lockscope>\n");
1136
	BUFFER_APPEND_STRING_CONST(b, "/>");
1137
	BUFFER_APPEND_STRING_CONST(b,"</D:lockscope>\n");
1138 1138

  
1139
	buffer_append_string(b,"<D:locktype>");
1140
	buffer_append_string(b,"<D:");
1139
	BUFFER_APPEND_STRING_CONST(b,"<D:locktype>");
1140
	BUFFER_APPEND_STRING_CONST(b,"<D:");
1141 1141
	buffer_append_string(b, locktype);
1142
	buffer_append_string(b, "/>");
1143
	buffer_append_string(b,"</D:locktype>\n");
1142
	BUFFER_APPEND_STRING_CONST(b, "/>");
1143
	BUFFER_APPEND_STRING_CONST(b,"</D:locktype>\n");
1144 1144

  
1145
	buffer_append_string(b,"<D:depth>");
1145
	BUFFER_APPEND_STRING_CONST(b,"<D:depth>");
1146 1146
	buffer_append_string(b, depth == 0 ? "0" : "infinity");
1147
	buffer_append_string(b,"</D:depth>\n");
1147
	BUFFER_APPEND_STRING_CONST(b,"</D:depth>\n");
1148 1148

  
1149
	buffer_append_string(b,"<D:timeout>");
1150
	buffer_append_string(b, "Second-600");
1151
	buffer_append_string(b,"</D:timeout>\n");
1149
	BUFFER_APPEND_STRING_CONST(b,"<D:timeout>");
1150
	BUFFER_APPEND_STRING_CONST(b, "Second-600");
1151
	BUFFER_APPEND_STRING_CONST(b,"</D:timeout>\n");
1152 1152

  
1153
	buffer_append_string(b,"<D:owner>");
1154
	buffer_append_string(b,"</D:owner>\n");
1153
	BUFFER_APPEND_STRING_CONST(b,"<D:owner>");
1154
	BUFFER_APPEND_STRING_CONST(b,"</D:owner>\n");
1155 1155

  
1156
	buffer_append_string(b,"<D:locktoken>");
1157
	buffer_append_string(b, "<D:href>");
1156
	BUFFER_APPEND_STRING_CONST(b,"<D:locktoken>");
1157
	BUFFER_APPEND_STRING_CONST(b, "<D:href>");
1158 1158
	buffer_append_string_buffer(b, locktoken);
1159
	buffer_append_string(b, "</D:href>");
1160
	buffer_append_string(b,"</D:locktoken>\n");
1159
	BUFFER_APPEND_STRING_CONST(b, "</D:href>");
1160
	BUFFER_APPEND_STRING_CONST(b,"</D:locktoken>\n");
1161 1161

  
1162
	buffer_append_string(b,"</D:activelock>\n");
1163
	buffer_append_string(b,"</D:lockdiscovery>\n");
1164
	buffer_append_string(b,"</D:prop>\n");
1162
	BUFFER_APPEND_STRING_CONST(b,"</D:activelock>\n");
1163
	BUFFER_APPEND_STRING_CONST(b,"</D:lockdiscovery>\n");
1164
	BUFFER_APPEND_STRING_CONST(b,"</D:prop>\n");
1165 1165

  
1166 1166
	return 0;
1167 1167
}
......
1385 1385

  
1386 1386
		b = chunkqueue_get_append_buffer(con->send);
1387 1387

  
1388
		buffer_copy_string(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
1388
		BUFFER_COPY_STRING_CONST(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
1389 1389

  
1390
		buffer_append_string(b,"<D:multistatus xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
1390
		BUFFER_APPEND_STRING_CONST(b,"<D:multistatus xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">\n");
1391 1391

  
1392 1392
		/* allprop */
1393 1393

  
......
1399 1399
			/* Depth: 0 */
1400 1400
			webdav_get_props(srv, con, p, &(con->physical), req_props, prop_200, prop_404);
1401 1401

  
1402
			buffer_append_string(b,"<D:response>\n");
1403
			buffer_append_string(b,"<D:href>");
1402
			BUFFER_APPEND_STRING_CONST(b,"<D:response>\n");
1403
			BUFFER_APPEND_STRING_CONST(b,"<D:href>");
1404 1404
			buffer_append_string_buffer(b, con->uri.scheme);
1405
			buffer_append_string(b,"://");
1405
			BUFFER_APPEND_STRING_CONST(b,"://");
1406 1406
			buffer_append_string_buffer(b, con->uri.authority);
1407 1407
			buffer_append_string_encoded(b, CONST_BUF_LEN(con->uri.path), ENCODING_REL_URI);
1408
			buffer_append_string(b,"</D:href>\n");
1408
			BUFFER_APPEND_STRING_CONST(b,"</D:href>\n");
1409 1409

  
1410 1410
			if (!buffer_is_empty(prop_200)) {
1411
				buffer_append_string(b,"<D:propstat>\n");
1412
				buffer_append_string(b,"<D:prop>\n");
1411
				BUFFER_APPEND_STRING_CONST(b,"<D:propstat>\n");
1412
				BUFFER_APPEND_STRING_CONST(b,"<D:prop>\n");
1413 1413

  
1414 1414
				buffer_append_string_buffer(b, prop_200);
1415 1415

  
1416
				buffer_append_string(b,"</D:prop>\n");
1416
				BUFFER_APPEND_STRING_CONST(b,"</D:prop>\n");
1417 1417

  
1418
				buffer_append_string(b,"<D:status>HTTP/1.1 200 OK</D:status>\n");
1418
				BUFFER_APPEND_STRING_CONST(b,"<D:status>HTTP/1.1 200 OK</D:status>\n");
1419 1419

  
1420
				buffer_append_string(b,"</D:propstat>\n");
1420
				BUFFER_APPEND_STRING_CONST(b,"</D:propstat>\n");
1421 1421
			}
1422 1422
			if (!buffer_is_empty(prop_404)) {
1423
				buffer_append_string(b,"<D:propstat>\n");
1424
				buffer_append_string(b,"<D:prop>\n");
1423
				BUFFER_APPEND_STRING_CONST(b,"<D:propstat>\n");
1424
				BUFFER_APPEND_STRING_CONST(b,"<D:prop>\n");
1425 1425

  
1426 1426
				buffer_append_string_buffer(b, prop_404);
1427 1427

  
1428
				buffer_append_string(b,"</D:prop>\n");
1428
				BUFFER_APPEND_STRING_CONST(b,"</D:prop>\n");
1429 1429

  
1430
				buffer_append_string(b,"<D:status>HTTP/1.1 404 Not Found</D:status>\n");
1430
				BUFFER_APPEND_STRING_CONST(b,"<D:status>HTTP/1.1 404 Not Found</D:status>\n");
1431 1431

  
1432
				buffer_append_string(b,"</D:propstat>\n");
1432
				BUFFER_APPEND_STRING_CONST(b,"</D:propstat>\n");
1433 1433
			}
1434 1434

  
1435
			buffer_append_string(b,"</D:response>\n");
1435
			BUFFER_APPEND_STRING_CONST(b,"</D:response>\n");
1436 1436

  
1437 1437
			break;
1438 1438
		case 1:
......
1468 1468

  
1469 1469
					webdav_get_props(srv, con, p, &d, req_props, prop_200, prop_404);
1470 1470

  
1471
					buffer_append_string(b,"<D:response>\n");
1472
					buffer_append_string(b,"<D:href>");
1471
					BUFFER_APPEND_STRING_CONST(b,"<D:response>\n");
1472
					BUFFER_APPEND_STRING_CONST(b,"<D:href>");
1473 1473
					buffer_append_string_buffer(b, con->uri.scheme);
1474
					buffer_append_string(b,"://");
1474
					BUFFER_APPEND_STRING_CONST(b,"://");
1475 1475
					buffer_append_string_buffer(b, con->uri.authority);
1476 1476
					buffer_append_string_encoded(b, CONST_BUF_LEN(d.rel_path), ENCODING_REL_URI);
1477
					buffer_append_string(b,"</D:href>\n");
1477
					BUFFER_APPEND_STRING_CONST(b,"</D:href>\n");
1478 1478

  
1479 1479
					if (!buffer_is_empty(prop_200)) {
1480
						buffer_append_string(b,"<D:propstat>\n");
1481
						buffer_append_string(b,"<D:prop>\n");
1480
						BUFFER_APPEND_STRING_CONST(b,"<D:propstat>\n");
1481
						BUFFER_APPEND_STRING_CONST(b,"<D:prop>\n");
1482 1482

  
1483 1483
						buffer_append_string_buffer(b, prop_200);
1484 1484

  
1485
						buffer_append_string(b,"</D:prop>\n");
1485
						BUFFER_APPEND_STRING_CONST(b,"</D:prop>\n");
1486 1486

  
1487
						buffer_append_string(b,"<D:status>HTTP/1.1 200 OK</D:status>\n");
1487
						BUFFER_APPEND_STRING_CONST(b,"<D:status>HTTP/1.1 200 OK</D:status>\n");
1488 1488

  
1489
						buffer_append_string(b,"</D:propstat>\n");
1489
						BUFFER_APPEND_STRING_CONST(b,"</D:propstat>\n");
1490 1490
					}
1491 1491
					if (!buffer_is_empty(prop_404)) {
1492
						buffer_append_string(b,"<D:propstat>\n");
1493
						buffer_append_string(b,"<D:prop>\n");
1492
						BUFFER_APPEND_STRING_CONST(b,"<D:propstat>\n");
1493
						BUFFER_APPEND_STRING_CONST(b,"<D:prop>\n");
1494 1494

  
1495 1495
						buffer_append_string_buffer(b, prop_404);
1496 1496

  
1497
						buffer_append_string(b,"</D:prop>\n");
1497
						BUFFER_APPEND_STRING_CONST(b,"</D:prop>\n");
1498 1498

  
1499
						buffer_append_string(b,"<D:status>HTTP/1.1 404 Not Found</D:status>\n");
1499
						BUFFER_APPEND_STRING_CONST(b,"<D:status>HTTP/1.1 404 Not Found</D:status>\n");
1500 1500

  
1501
						buffer_append_string(b,"</D:propstat>\n");
1501
						BUFFER_APPEND_STRING_CONST(b,"</D:propstat>\n");
1502 1502
					}
1503 1503

  
1504
					buffer_append_string(b,"</D:response>\n");
1504
					BUFFER_APPEND_STRING_CONST(b,"</D:response>\n");
1505 1505
				}
1506 1506
				closedir(dir);
1507 1507
				buffer_free(d.path);
......
1524 1524
		buffer_free(prop_200);
1525 1525
		buffer_free(prop_404);
1526 1526

  
1527
		buffer_append_string(b,"</D:multistatus>\n");
1527
		BUFFER_APPEND_STRING_CONST(b,"</D:multistatus>\n");
1528 1528

  
1529 1529
		if (con->conf.log_request_handling) {
1530 1530
			TRACE("sending XML: %s", 
......
1604 1604

  
1605 1605
				b = chunkqueue_get_append_buffer(con->send);
1606 1606

  
1607
				buffer_copy_string(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
1607
				BUFFER_COPY_STRING_CONST(b, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
1608 1608

  
1609
				buffer_append_string(b,"<D:multistatus xmlns:D=\"DAV:\">\n");
1609
				BUFFER_APPEND_STRING_CONST(b,"<D:multistatus xmlns:D=\"DAV:\">\n");
1610 1610

  
1611 1611
				buffer_append_string_buffer(b, multi_status_resp);
1612 1612

  
1613
				buffer_append_string(b,"</D:multistatus>\n");
1613
				BUFFER_APPEND_STRING_CONST(b,"</D:multistatus>\n");
1614 1614

  
1615 1615
				if (p->conf.log_xml) {
1616 1616
					log_error_write(srv, __FILE__, __LINE__, "sb", "XML-response-body:", b);
src/mod_status.c (copia locale)
657 657
		size_t ndx = st->sorted[i];
658 658

  
659 659
		buffer_append_string_buffer(b, st->data[ndx]->key);
660
		buffer_append_string(b, ": ");
660
		BUFFER_APPEND_STRING_CONST(b, ": ");
661 661
		buffer_append_long(b, ((data_integer *)(st->data[ndx]))->value);
662
		buffer_append_string(b, "\n");
662
		BUFFER_APPEND_STRING_CONST(b, "\n");
663 663
	}
664 664

  
665 665
	response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));
src/http_req_test.c (copia locale)
111 111
		"GE");
112 112

  
113 113
	b = chunkqueue_get_append_buffer(cq);
114
	buffer_copy_string(b, "T ");
114
	BUFFER_COPY_STRING_CONST(b, "T ");
115 115
	b = chunkqueue_get_append_buffer(cq);
116
	buffer_copy_string(b, "/foo");
116
	BUFFER_COPY_STRING_CONST(b, "/foo");
117 117
	b = chunkqueue_get_append_buffer(cq);
118
	buffer_copy_string(b, "bar HTTP/1.0\r");
118
	BUFFER_COPY_STRING_CONST(b, "bar HTTP/1.0\r");
119 119

  
120 120
	b = chunkqueue_get_append_buffer(cq);
121 121
	buffer_copy_string(b, "\n"
src/mod_ssi.c (copia locale)
417 417

  
418 418
			b = chunkqueue_get_append_buffer(con->send);
419 419
			if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
420
				buffer_copy_string(b, "(none)");
420
				BUFFER_COPY_STRING_CONST(b, "(none)");
421 421
			} else {
422 422
				buffer_copy_string(b, buf);
423 423
			}
......
428 428

  
429 429
			b = chunkqueue_get_append_buffer(con->send);
430 430
			if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
431
				buffer_copy_string(b, "(none)");
431
				BUFFER_COPY_STRING_CONST(b, "(none)");
432 432
			} else {
433 433
				buffer_copy_string(b, buf);
434 434
			}
......
439 439

  
440 440
			b = chunkqueue_get_append_buffer(con->send);
441 441
			if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, gmtime(&t))) {
442
				buffer_copy_string(b, "(none)");
442
				BUFFER_COPY_STRING_CONST(b, "(none)");
443 443
			} else {
444 444
				buffer_copy_string(b, buf);
445 445
			}
......
470 470
			if (NULL != (ds = (data_string *)array_get_element(p->ssi_cgi_env, var_val, strlen(var_val)))) {
471 471
				buffer_copy_string_buffer(b, ds->value);
472 472
			} else {
473
				buffer_copy_string(b, "(none)");
473
				BUFFER_COPY_STRING_CONST(b, "(none)");
474 474
			}
475 475

  
476 476
			break;
......
571 571
			case SSI_FLASTMOD:
572 572
				b = chunkqueue_get_append_buffer(con->send);
573 573
				if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
574
					buffer_copy_string(b, "(none)");
574
					BUFFER_COPY_STRING_CONST(b, "(none)");
575 575
				} else {
576 576
					buffer_copy_string(b, buf);
577 577
				}
......
649 649
		if (p->if_is_false) break;
650 650

  
651 651
		b = chunkqueue_get_append_buffer(con->send);
652
		buffer_copy_string(b, "<pre>");
652
		BUFFER_COPY_STRING_CONST(b, "<pre>");
653 653
		for (i = 0; i < p->ssi_vars->used; i++) {
654 654
			data_string *ds = (data_string *)p->ssi_vars->data[p->ssi_vars->sorted[i]];
655 655

  
656 656
			buffer_append_string_buffer(b, ds->key);
657
			buffer_append_string(b, ": ");
657
			BUFFER_APPEND_STRING_CONST(b, ": ");
658 658
			buffer_append_string_buffer(b, ds->value);
659
			buffer_append_string(b, "<br />");
659
			BUFFER_APPEND_STRING_CONST(b, "<br />");
660 660

  
661 661
		}
662
		buffer_append_string(b, "</pre>");
662
		BUFFER_APPEND_STRING_CONST(b, "</pre>");
663 663

  
664 664
		break;
665 665
	case SSI_EXEC: {
src/mod_chunked.c (copia locale)
249 249
	b = buffer_init();
250 250

  
251 251
	if (len == 0) {
252
		buffer_copy_string(b, "0");
252
		BUFFER_COPY_STRING_CONST(b, "0");
253 253
	} else {
254 254
		for (i = 0; i < 8 && len; i++) {
255 255
			len >>= 4;
......
266 266
		b->ptr[b->used++] = '\0';
267 267
	}
268 268

  
269
	buffer_append_string(b, "\r\n");
269
	BUFFER_APPEND_STRING_CONST(b, "\r\n");
270 270
	chunkqueue_append_buffer(cq, b);
271 271
	len = b->used - 1;
272 272

  
src/http-header-glue.c (copia locale)
115 115
	o = buffer_init();
116 116

  
117 117
	if (con->conf.is_ssl) {
118
		buffer_copy_string(o, "https://");
118
		BUFFER_COPY_STRING_CONST(o, "https://");
119 119
	} else {
120
		buffer_copy_string(o, "http://");
120
		BUFFER_COPY_STRING_CONST(o, "http://");
121 121
	}
122 122
	if (con->uri.authority->used) {
123 123
		buffer_append_string_buffer(o, con->uri.authority);
......
183 183

  
184 184
		if (!((con->conf.is_ssl == 0 && srv->srvconf.port == 80) ||
185 185
		      (con->conf.is_ssl == 1 && srv->srvconf.port == 443))) {
186
			buffer_append_string(o, ":");
186
			BUFFER_APPEND_STRING_CONST(o, ":");
187 187
			buffer_append_long(o, srv->srvconf.port);
188 188
		}
189 189
	}
190 190
	buffer_append_string_buffer(o, con->uri.path);
191
	buffer_append_string(o, "/");
191
	BUFFER_APPEND_STRING_CONST(o, "/");
192 192
	if (!buffer_is_empty(con->uri.query)) {
193
		buffer_append_string(o, "?");
193
		BUFFER_APPEND_STRING_CONST(o, "?");
194 194
		buffer_append_string_buffer(o, con->uri.query);
195 195
	}
196 196

  
src/mod_uploadprogress.c (copia locale)
494 494
			BUFFER_APPEND_STRING_CONST(b, "'error', 'status' : 413");
495 495
		} else if (post_con_entry->con == NULL) {
496 496
			/* the connection is already gone */
497
			buffer_append_string(b, "'done'");
497
			BUFFER_APPEND_STRING_CONST(b, "'done'");
498 498
		} else {
499 499
			/* the upload is already done, but the connection might be still open */
500 500
			buffer_append_string(b, post_con_entry->con->recv->is_closed ? "'done'" : "'uploading'");
src/http_req_range_test.c (copia locale)
15 15
	log_init();
16 16
	plan_tests(7);
17 17

  
18
	buffer_copy_string(b, "bytes=0-0");
18
	BUFFER_COPY_STRING_CONST(b, "bytes=0-0");
19 19
	ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-0");
20 20
	for (r = ranges; r; r = r->next) {
21 21
		diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end);
22 22
	}
23 23
	http_request_range_reset(ranges);
24 24

  
25
	buffer_copy_string(b, "bytes=1-2,3-4");
25
	BUFFER_COPY_STRING_CONST(b, "bytes=1-2,3-4");
26 26
	ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "1-2,3-4");
27 27
	for (r = ranges; r; r = r->next) {
28 28
		diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end);
29 29
	}
30 30
	http_request_range_reset(ranges);
31 31

  
32
	buffer_copy_string(b, "bytes=-0");
32
	BUFFER_COPY_STRING_CONST(b, "bytes=-0");
33 33
	ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "-0");
34 34
	for (r = ranges; r; r = r->next) {
35 35
		diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end);
36 36
	}
37 37
	http_request_range_reset(ranges);
38 38

  
39
	buffer_copy_string(b, "bytes=0-");
39
	BUFFER_COPY_STRING_CONST(b, "bytes=0-");
40 40
	ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-");
41 41
	for (r = ranges; r; r = r->next) {
42 42
		diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end);
43 43
	}
44 44
	http_request_range_reset(ranges);
45 45

  
46
	buffer_copy_string(b, "bytes=0-0,0-");
46
	BUFFER_COPY_STRING_CONST(b, "bytes=0-0,0-");
47 47
	ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-0,0-");
48 48
	for (r = ranges; r; r = r->next) {
49 49
		diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end);
50 50
	}
51 51
	http_request_range_reset(ranges);
52 52

  
53
	buffer_copy_string(b, "bytes=0-0,-0");
53
	BUFFER_COPY_STRING_CONST(b, "bytes=0-0,-0");
54 54
	ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-0,-0");
55 55
	for (r = ranges; r; r = r->next) {
56 56
		diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end);
57 57
	}
58 58
	http_request_range_reset(ranges);
59 59

  
60
	buffer_copy_string(b, "bytes=1-2,3-4,5-");
60
	BUFFER_COPY_STRING_CONST(b, "bytes=1-2,3-4,5-");
61 61
	ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "1-2,3-4,5-");
62 62
	for (r = ranges; r; r = r->next) {
63 63
		diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end);
src/mod_accesslog.c (copia locale)
630 630

  
631 631
	b = p->conf.access_logbuffer;
632 632
	if (b->used == 0) {
633
		buffer_copy_string(b, "");
633
		BUFFER_COPY_STRING_CONST(b, "");
634 634
	}
635 635

  
636 636
	for (j = 0; j < p->conf.parsed_format->used; j++) {
......
709 709
				break;
710 710
			case FORMAT_REQUEST_LINE:
711 711
				buffer_append_string(b, get_http_method_name(con->request.http_method));
712
				buffer_append_string(b, " ");
712
				BUFFER_APPEND_STRING_CONST(b, " ");
713 713
				buffer_append_string_buffer(b, con->request.orig_uri);
714
				buffer_append_string(b, " ");
714
				BUFFER_APPEND_STRING_CONST(b, " ");
715 715
				buffer_append_string(b, get_http_version_name(con->request.http_version));
716 716

  
717 717
				break;
......
797 797
				break;
798 798
			case FORMAT_CONNECTION_STATUS:
799 799
				switch(con->keep_alive) {
800
				case 0: buffer_append_string(b, "-"); break;
801
				default: buffer_append_string(b, "+"); break;
800
				case 0: BUFFER_APPEND_STRING_CONST(b, "-"); break;
801
				default: BUFFER_APPEND_STRING_CONST(b, "+"); break;
802 802
				}
803 803
				break;
804 804
			default:
src/http_resp_test.c (copia locale)
111 111
		"HTTP");
112 112

  
113 113
	b = chunkqueue_get_append_buffer(cq);
114
	buffer_copy_string(b, "/1.0 ");
114
	BUFFER_COPY_STRING_CONST(b, "/1.0 ");
115 115
	b = chunkqueue_get_append_buffer(cq);
116
	buffer_copy_string(b, "30");
116
	BUFFER_COPY_STRING_CONST(b, "30");
117 117
	b = chunkqueue_get_append_buffer(cq);
118
	buffer_copy_string(b, "4 Not Modified\r");
118
	BUFFER_COPY_STRING_CONST(b, "4 Not Modified\r");
119 119

  
120 120
	b = chunkqueue_get_append_buffer(cq);
121 121
	buffer_copy_string(b, "\n"
src/log.c (copia locale)
358 358
	/* write b */
359 359
	switch(err->mode) {
360 360
	case ERRORLOG_FILE:
361
		buffer_append_string(b, "\r\n");
361
		BUFFER_APPEND_STRING_CONST(b, "\r\n");
362 362
		write(err->fd, b->ptr, b->used - 1);
363 363
		break;
364 364
	case ERRORLOG_STDERR:
365
		buffer_append_string(b, "\r\n");
365
		BUFFER_APPEND_STRING_CONST(b, "\r\n");
366 366
		write(STDERR_FILENO, b->ptr, b->used - 1);
367 367
		break;
368 368
#ifdef HAVE_SYSLOG_H
src/proc_open.c (copia locale)
184 184
		buffer_append_string(cmdline, shell);
185 185
	} else {
186 186
		buffer_append_string(cmdline, windir);
187
		buffer_append_string(cmdline, "\\system32\\cmd.exe");
187
		BUFFER_APPEND_STRING_CONST(cmdline, "\\system32\\cmd.exe");
188 188
	}
189 189
	buffer_append_string_len(cmdline, CONST_STR_LEN(" /c "));
190 190
	buffer_append_string(cmdline, command);
    (1-1/1)