Server 0.0.1
HTTP/REST server implementation

src/http/message/has_valid_version.c

Go to the documentation of this file.
00001 
00023 #include <string.h>
00024 
00025 #include "http/message.h"
00026 #include "utils/http.h"
00027 
00028 int
00029 httpMessageHasValidVersion(HttpMessage this)
00030 {
00031         int major;
00032         int minor;
00033 
00034         if (! isHttpVersion(this->version, strlen(this->version)))
00035                 return 0;
00036 
00037         if (0 > httpMessageGetVersion(this, &major, &minor))
00038                 return 0;
00039 
00040         if (1 != major)
00041                 return 0;
00042 
00043         if (0 > minor || 1 < minor)
00044                 return 0;
00045 
00046         return 1;
00047 }
00048 
00049 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines