send(sock, *h, strlen((char *) *h), 0); send(sock, "\n", 1, 0); h++;
len += countOrCopy(&p, (char *) url->path); } if (url->params) { len += countOrCopy(&p, (char *) url->params); } if (url->query) { len += countOrCopy(&p, (char *) url->query); } len += countOrCopy(&p, httpStr); h = headers; if (h) { while (*h) { len += countOrCopy(&p, (char *) *h); len += countOrCopy(&p, "\n"); h++; } } len += countOrCopy(&p, "\n"); if (!buf) { buf = malloc(len); if (!buf) { return; } p = buf;
httpGetObject(HTTP *http, App *app, int sock, URL *url, unsigned char **headers){	char		*get;	unsigned char	**h;	char		*httpStr;	get = "GET ";	httpStr = " HTTP/1.0\n";	send(sock, get, strlen(get), 0);	if (url->path)	{		send(sock, url->path, strlen((char *) url->path), 0);	}	if (url->params)	{		send(sock, url->params, strlen((char *) url->params), 0);	}	if (url->query)	{		send(sock, url->query, strlen((char *) url->query), 0);	}	send(sock, httpStr, strlen(httpStr), 0);	h = headers;	if (h)	{		while (*h)		{			send(sock, *h, strlen((char *) *h), 0);			send(sock, "\n", 1, 0);			h++;		}	}	send(sock, "\n", 1, 0);	httpRead(http, app, sock, url->url);}