You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
560 B
33 lines
560 B
#include <string.h>
|
|
#include <ctype.h>
|
|
|
|
#include "http/message.h"
|
|
#include "http/request.h"
|
|
#include "http/header.h"
|
|
|
|
|
|
char
|
|
httpRequestHasKeepAlive(HttpRequest request)
|
|
{
|
|
HttpMessage message = (HttpMessage)request;
|
|
char * header;
|
|
char * header_ptr;
|
|
|
|
header = httpHeaderGet(&(message->header), "connection");
|
|
|
|
if (NULL == header) {
|
|
return 0;
|
|
}
|
|
|
|
for (header_ptr = header; 0 != *header_ptr; header_ptr++) {
|
|
*header_ptr = tolower(*header_ptr);
|
|
}
|
|
|
|
if (0 == strcmp(header, "keep-alive")) {
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
// vim: set ts=4 sw=4:
|