Latest updates.
This commit is contained in:
parent
c10b760903
commit
deb88cb14d
@ -11,17 +11,17 @@ namespace coreutils {
|
||||
|
||||
IMFMessage::IMFMessage(ZString &in) : ZString(in) {
|
||||
|
||||
while (!in.ifNext((char *)"\r\n")) {
|
||||
while (!in.ifNext("\r\n")) {
|
||||
headers.emplace_back(in);
|
||||
}
|
||||
|
||||
ZString type = getHeader((char *)"Content-Type");
|
||||
int len = getHeader((char *)"Content-Length").asInteger();
|
||||
ZString type = getHeader("Content-Type");
|
||||
int len = getHeader("Content-Length").asInteger();
|
||||
if(len > 0) {
|
||||
ZString block = in.readBlock(len);
|
||||
if(type.equals((char *)"multipart/form-data"))
|
||||
body = new IMFMultipart(block, getHeaderKeyPairValue((char *)"Content-Type", (char *)"boundary"));
|
||||
else if(type.equals((char *)"text/plain"))
|
||||
if(type.equals("multipart/form-data"))
|
||||
body = new IMFMultipart(block, getHeaderKeyPairValue("Content-Type", "boundary"));
|
||||
else if(type.equals("text/plain"))
|
||||
body = new IMFPlainText(block);
|
||||
else
|
||||
body = new IMFBody(block);
|
||||
|
@ -4,9 +4,9 @@
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
IMFRequest::IMFRequest(ZString &in) : IMFMessage(in) {
|
||||
setZString(in.goeol());
|
||||
this->split((char *)" ");
|
||||
IMFRequest::IMFRequest(ZString &in) : ZString(in) {
|
||||
in.goeol();
|
||||
this->split(" ", 3);
|
||||
}
|
||||
|
||||
ZString IMFRequest::getMethod() {
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
class IMFRequest : public IMFMessage {
|
||||
class IMFRequest : ZString {
|
||||
|
||||
public:
|
||||
IMFRequest(ZString &in);
|
||||
|
@ -128,7 +128,7 @@ namespace coreutils {
|
||||
return string == std::string(data, length);
|
||||
}
|
||||
|
||||
bool ZString::ifNext(char *value) {
|
||||
bool ZString::ifNext(const char *value) {
|
||||
bool test = (strncmp(cursor, value, strlen(value)) == 0);
|
||||
if(test)
|
||||
cursor += strlen(value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user