|
|
@ -61,6 +61,8 @@ httpParserParse(void * _this, Stream st) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (0 > (read = cbufRead(this->buffer, st))) { |
|
|
if (0 > (read = cbufRead(this->buffer, st))) { |
|
|
|
|
|
cbufRelease(this->buffer); |
|
|
|
|
|
this->ourLock = FALSE; |
|
|
return read; |
|
|
return read; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -75,9 +77,8 @@ httpParserParse(void * _this, Stream st) |
|
|
cbufRelease(this->buffer); |
|
|
cbufRelease(this->buffer); |
|
|
this->ourLock = FALSE; |
|
|
this->ourLock = FALSE; |
|
|
cont = 0; |
|
|
cont = 0; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
case HTTP_MESSAGE_START: |
|
|
case HTTP_MESSAGE_START: |
|
|
if (NULL == (line = cbufGetLine(this->buffer, &line_end))) { |
|
|
if (NULL == (line = cbufGetLine(this->buffer, &line_end))) { |
|
|
@ -98,12 +99,11 @@ httpParserParse(void * _this, Stream st) |
|
|
if (NULL == this->current) { |
|
|
if (NULL == this->current) { |
|
|
cbufRelease(this->buffer); |
|
|
cbufRelease(this->buffer); |
|
|
this->ourLock = FALSE; |
|
|
this->ourLock = FALSE; |
|
|
return -1; |
|
|
|
|
|
|
|
|
return -2; // a server error occured can't process... |
|
|
} |
|
|
} |
|
|
httpParserRequestVars(this); |
|
|
httpParserRequestVars(this); |
|
|
|
|
|
|
|
|
this->state = HTTP_MESSAGE_INTRO_DONE; |
|
|
this->state = HTTP_MESSAGE_INTRO_DONE; |
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case HTTP_MESSAGE_INTRO_DONE: |
|
|
case HTTP_MESSAGE_INTRO_DONE: |
|
|
if (NULL == (line = cbufGetLine(this->buffer, &line_end))) { |
|
|
if (NULL == (line = cbufGetLine(this->buffer, &line_end))) { |
|
|
@ -120,20 +120,17 @@ httpParserParse(void * _this, Stream st) |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (0 == strlen(line)) { |
|
|
|
|
|
this->state = HTTP_MESSAGE_HEADERS_DONE; |
|
|
|
|
|
|
|
|
if (0 != strlen(line)) { |
|
|
|
|
|
httpParserHeader(this, line, line_end); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
httpParserHeader(this, line, line_end); |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
this->state = HTTP_MESSAGE_HEADERS_DONE; |
|
|
|
|
|
|
|
|
case HTTP_MESSAGE_HEADERS_DONE: |
|
|
case HTTP_MESSAGE_HEADERS_DONE: |
|
|
if (this->current->dbody == this->current->nbody) { |
|
|
if (this->current->dbody == this->current->nbody) { |
|
|
this->state = HTTP_MESSAGE_DONE; |
|
|
this->state = HTTP_MESSAGE_DONE; |
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
if (cbufIsEmpty(this->buffer)) { |
|
|
if (cbufIsEmpty(this->buffer)) { |
|
|
cbufRelease(this->buffer); |
|
|
cbufRelease(this->buffer); |
|
|
this->ourLock = FALSE; |
|
|
this->ourLock = FALSE; |
|
|
@ -147,7 +144,9 @@ httpParserParse(void * _this, Stream st) |
|
|
this, |
|
|
this, |
|
|
cbufGetRead(this->buffer), |
|
|
cbufGetRead(this->buffer), |
|
|
this->buffer->bused)); |
|
|
this->buffer->bused)); |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
case HTTP_MESSAGE_DONE: |
|
|
case HTTP_MESSAGE_DONE: |
|
|
{ |
|
|
{ |
|
|
|