fastcgi++
protocol.cpp
Go to the documentation of this file.
1 
2 /***************************************************************************
3 * Copyright (C) 2007 Eddie Carle [eddie@erctech.org] *
4 * *
5 * This file is part of fastcgi++. *
6 * *
7 * fastcgi++ is free software: you can redistribute it and/or modify it *
8 * under the terms of the GNU Lesser General Public License as published *
9 * by the Free Software Foundation, either version 3 of the License, or (at *
10 * your option) any later version. *
11 * *
12 * fastcgi++ is distributed in the hope that it will be useful, but WITHOUT *
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public *
15 * License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public License *
18 * along with fastcgi++. If not, see <http://www.gnu.org/licenses/>. *
19 ****************************************************************************/
20 
21 
22 #include <fastcgi++/protocol.hpp>
23 
24 void Fastcgipp::Protocol::processParamHeader(const char* data, size_t dataSize, const char*& name, size_t& nameSize, const char*& value, size_t& valueSize)
25 {
26  if(*data>>7)
27  {
28  nameSize=readBigEndian(*(uint32_t*)data) & 0x7fffffff;
29  data+=sizeof(uint32_t);
30  }
31  else nameSize=*data++;
32 
33  if(*data>>7)
34  {
35  valueSize=readBigEndian(*(uint32_t*)data) & 0x7fffffff;
36  data+=sizeof(uint32_t);
37  }
38  else valueSize=*data++;
39  name=data;
40  value=name+nameSize;
41 }
42 
46 
47 const char* Fastcgipp::Protocol::recordTypeLabels[] = { "INVALID", "BEGIN_REQUEST", "ABORT_REQUEST", "END_REQUEST", "PARAMS", "IN", "OUT", "ERR", "DATA", "GET_VALUES", "GET_VALUES_RESULT", "UNKNOWN_TYPE" };
48 
49 const char Fastcgipp::version[]=PACKAGE_VERSION;