예제 #1
0
static void http_post(int sd, cptr url, BUF *buf)
{
	BUF *output;

	output = buf_new();
	buf_sprintf(output, "POST %s HTTP/1.0\n", url);
	buf_sprintf(output, "User-Agent: Hengband %d.%d.%d\n",
		    FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);

	buf_sprintf(output, "Content-Length: %d\n", buf->size);
	buf_sprintf(output, "Content-Encoding: binary\n");
	buf_sprintf(output, "Content-Type: application/octet-stream\n");
	buf_sprintf(output, "\n");
	buf_append(output, buf->data, buf->size);

	soc_write(sd, output->data, output->size);
}
예제 #2
0
int soc_write_str(int sd, char *buf)
{
	return soc_write(sd, buf, strlen(buf));
}