The R Project SVN R

Rev

Rev 86790 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 86790 Rev 87180
Line 261... Line 261...
261
	buf = buf->prev;
261
	buf = buf->prev;
262
    }
262
    }
263
    res = allocVector(RAWSXP, len + buf->length);
263
    res = allocVector(RAWSXP, len + buf->length);
264
    dst = (char*) RAW(res);
264
    dst = (char*) RAW(res);
265
    while (buf) {
265
    while (buf) {
-
 
266
	if (buf->length)
266
	memcpy(dst, buf->data, buf->length);
267
	    memcpy(dst, buf->data, buf->length);
267
	dst += buf->length;
268
	dst += buf->length;
268
	buf = buf->next;
269
	buf = buf->next;
269
    }
270
    }
270
    return res;
271
    return res;
271
}
272
}
Line 1036... Line 1037...
1036
			    if (c->headers->size - c->headers->length >= 18 + (mend - bol)) {
1037
			    if (c->headers->size - c->headers->length >= 18 + (mend - bol)) {
1037
				if (!c->method) c->method = METHOD_OTHER;
1038
				if (!c->method) c->method = METHOD_OTHER;
1038
				/* add "Request-Method: xxx" */
1039
				/* add "Request-Method: xxx" */
1039
				memcpy(c->headers->data + c->headers->length, "Request-Method: ", 16);
1040
				memcpy(c->headers->data + c->headers->length, "Request-Method: ", 16);
1040
				c->headers->length += 16;
1041
				c->headers->length += 16;
-
 
1042
				if (mend - bol)
1041
				memcpy(c->headers->data + c->headers->length, bol, mend - bol);
1043
				    memcpy(c->headers->data + c->headers->length, bol, mend - bol);
1042
				c->headers->length += mend - bol;	
1044
				c->headers->length += mend - bol;	
1043
				c->headers->data[c->headers->length++] = '\n';
1045
				c->headers->data[c->headers->length++] = '\n';
1044
			    }
1046
			    }
1045
			}
1047
			}
1046
			if (!c->method) {
1048
			if (!c->method) {
Line 1061... Line 1063...
1061
				if (c->headers->length + l + 1 > c->headers->size) { /* not enough space? */
1063
				if (c->headers->length + l + 1 > c->headers->size) { /* not enough space? */
1062
				    size_t fits = c->headers->size - c->headers->length;
1064
				    size_t fits = c->headers->size - c->headers->length;
1063
				    if (fits) memcpy(c->headers->data + c->headers->length, bol, fits);
1065
				    if (fits) memcpy(c->headers->data + c->headers->length, bol, fits);
1064
				    if (alloc_buffer(2048, c->headers)) {
1066
				    if (alloc_buffer(2048, c->headers)) {
1065
					c->headers = c->headers->next;
1067
					c->headers = c->headers->next;
1066
					memcpy(c->headers->data, bol + fits, l - fits);
1068
					if (l - fits) memcpy(c->headers->data, bol + fits, l - fits);
1067
					c->headers->length = l - fits;
1069
					c->headers->length = l - fits;
1068
					c->headers->data[c->headers->length++] = '\n';
1070
					c->headers->data[c->headers->length++] = '\n';
1069
				    }
1071
				    }
1070
				} else {
1072
				} else {
1071
				    memcpy(c->headers->data + c->headers->length, bol, l);
1073
				    memcpy(c->headers->data + c->headers->length, bol, l);