}
else if(bytes_read) {
154 m_Buffer.size() + line.size() + 2));
158 if((prev_state &
fHitLF) != 0) {
181 const string& content_type,
182 size_tcontent_length,
183 string* content_log)
186m_OutIter(
out.begin()),
187m_OutIterated(
true),
188m_ContentTypeDeclared(!content_type.
empty()),
189m_ContentLength(content_length),
190m_ContentLog(content_log),
193m_CurrentEntry(
NULL),
194m_CurrentReader(
NULL)
200 CCER "no boundary field in "+ content_type);
214 CCER "multipart opening line "+ line
215+
" differs from declared boundary "+
m_Boundary);
248 stringname,
value, filename, content_type;
335delim_read =
m_In.get();
344 size_tn_read =
m_In.gcount();
345s.append(
buffer, n_read);
376delim_read =
m_In.get();
395delim_read =
m_In.get();
410s.resize(s.size() - 2);
423 if(*it < ' ' || *it >
'~') {
426 " URL-encoded form data: " 435 if(name_len !=
NPOS) {
436 value= name.substr(name_len + 1);
437name.resize(name_len);
448 if(att_pos ==
NPOS) {
451 "part header lacks required attribute "+ name +
": "+
str,
457 SIZE_TYPEatt_start = att_pos + name.size() + 4;
459 if(att_end ==
NPOS) {
461 CCER "part header contains unterminated attribute "+ name +
462 ": "+
str.substr(att_pos),
466 return str.substr(att_start, att_end - att_start);
472 string& content_type)
483 CCER "Hit end of input while reading part headers",
491 CCER "CR in part header not followed by LF", input_pos);
501 CCER "part header lacks colon: "+ line, input_pos);
507 CCER "malformatted Content-Disposition header: " 514content_type = line.substr(pos + 2);
static const char * kContentType
static const char * kBoundaryTag
static CTempString s_FindAttribute(const CTempString &str, const string &name, CT_POS_TYPE input_pos, bool required)
static bool s_MatchesBoundary(const string &l, const string &b)
static const char * kContentDisposition
Support classes for on-demand CGI input parsing.
Exception classes used by the NCBI CGI framework.
CCgiRequestException â.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
const_iterator end() const
iterator insert(const value_type &val)
container_type::value_type value_type
std::ofstream out("events_result.xml")
main entry point for tests
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void x_ReadMultipartHeaders(string &name, string &filename, string &content_type)
EReadTerminator x_DelimitedRead(string &s, SIZE_TYPE n=NPOS)
void x_FlushCurrentEntry(void)
TCgiEntries::iterator TCgiEntriesI
CCgiEntryReaderContext(CNcbiIstream &in, TCgiEntries &out, const string &content_type, size_t content_length=CCgiRequest::kContentLengthUnknown, string *content_log=NULL)
void IncludePreparsedEntries(void)
void x_HitBoundary(bool final)
ERW_Result PendingCount(size_t *count)
Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that a...
TCgiEntriesI GetNextEntry(void)
EContentType m_ContentType
void x_ReadURLEncodedEntry(string &name, string &value)
~CCgiEntryReaderContext()
ERW_Result Read(void *buf, size_t count, size_t *bytes_read)
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
bool m_ContentTypeDeclared
TReader * m_CurrentReader
friend class CCgiEntryReader
static const size_t kContentLengthUnknown
Get content length using value of the property 'eCgi_ContentLength'.
void x_FillBuffer(SIZE_TYPE count)
CCgiEntry * m_CurrentEntry
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
#define NCBI_THROW2(exception_class, err_code, message, extra)
Throw exception with extra parameter.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
ERW_Result
Result codes for I/O operations.
Int8 NcbiStreamposToInt8(NCBI_NS_STD::char_traits< char >::pos_type stream_pos)
Convert stream position to 64-bit int.
CNcbiIstream & NcbiGetline(CNcbiIstream &is, string &str, char delim, string::size_type *count=NULL)
Read from "is" to "str" up to the delimiter symbol "delim" (or EOF)
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
@ eRW_NotImplemented
Action / information is not available.
@ eRW_Eof
End of data, should be considered permanent.
@ eRW_Success
Everything is okay, I/O completed.
NCBI_NS_STD::string::size_type SIZE_TYPE
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static void URLDecodeInPlace(string &str, EUrlDecode flag=eUrlDec_All)
URL-decode string to itself.
@ eNocase
Case insensitive compare.
Definition of all error codes used in cgi (xcgi.lib).
constexpr bool empty(list< Ts... >) noexcept
const GenericPointer< typename T::ValueType > T2 value
std::istream & in(std::istream &in_, double &x_)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4