91 |
|
|
92 |
|
if (env.get("REQUEST_METHOD") == "POST") |
93 |
|
{ |
94 |
< |
std::streamsize length(lexical_cast<std::streamsize>(env.get("CONTENT_TYPE"))); |
94 |
> |
std::streamsize length(lexical_cast<std::streamsize>(env.get("CONTENT_LENGTH"))); |
95 |
|
char* content(new char[length]); |
96 |
|
|
97 |
< |
api::Cin.Read(content, length); |
97 |
> |
api::Cin.ReadFully(content, length); |
98 |
|
query.write(content, length); |
99 |
|
|
100 |
|
delete [] content; |
126 |
|
if (!date.IsEmpty()) ::strptime(date.NullTerminate(), "%Y-%m-%d", day); |
127 |
|
|
128 |
|
std::time_t difference(mktime(day) / 86400); |
129 |
< |
ext::Vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
130 |
< |
ext::String entry(jargon.GetSize() ? jargon[difference % jargon.GetSize()] : ""); |
129 |
> |
std::vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
130 |
> |
ext::String entry(jargon.size() ? jargon[difference % jargon.size()] : ""); |
131 |
|
|
132 |
|
select(entry); |
133 |
|
} |
136 |
|
{ |
137 |
|
::srandomdev(); |
138 |
|
|
139 |
< |
ext::Vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
139 |
> |
std::vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
140 |
|
size_t random(number.IsEmpty() ? ::random() : lexical_cast<size_t>(number)); |
141 |
|
|
142 |
|
assert(random >= 0); |
143 |
< |
assert(random % jargon.GetSize() < jargon.GetSize()); |
143 |
> |
assert(random % jargon.size() < jargon.size()); |
144 |
|
|
145 |
< |
ext::String entry(jargon.GetSize() ? jargon[random % jargon.GetSize()] : ""); |
145 |
> |
ext::String entry(jargon.size() ? jargon[random % jargon.size()] : ""); |
146 |
|
|
147 |
|
select(entry); |
148 |
|
} |