changed a test program slightly

This commit is contained in:
hyung-hwan 2020-05-26 01:22:28 +00:00
parent 4f8abcf0c5
commit a987655b29

View File

@ -823,7 +823,21 @@ static void on_htts_thr_request (mio_t* mio, mio_dev_thr_iopair_t* iop, mio_svc_
FILE* fp; FILE* fp;
int i; int i;
if (tfi->req_method != MIO_HTTP_GET)
{
write (iop->wfd, "Status: 405\r\n\r\n", 15); /* method not allowed */
return;
}
fp = fdopen(iop->wfd, "w"); fp = fdopen(iop->wfd, "w");
if (!fp)
{
write (iop->wfd, "Status: 500\r\n\r\n", 15); /* internal server error */
return;
}
fprintf (fp, "Content-Type: text/html\r\n\r\n");
fprintf (fp, "Status: 201\r\n"); fprintf (fp, "Status: 201\r\n");
fprintf (fp, "Content-Type: text/html\r\n\r\n"); fprintf (fp, "Content-Type: text/html\r\n\r\n");