* for states after START. When in HTTP_MSG_BODY,
* eoh points to the first byte of the last CRLF
* preceeding data. Relative to buffer's origin.
- * - col and sov : When in HTTP_MSG_BODY, will point to the first
+ * - sov : When in HTTP_MSG_BODY, will point to the first
* byte of data (relative to buffer's origin).
* - sol (start of line) : start of line, also start of message when fully parsed.
* - eol (End of Line) : relative offset in the buffer of the first byte
unsigned int msg_state; /* where we are in the current message parsing */
unsigned int flags; /* flags describing the message (HTTP version, ...) */
unsigned int next; /* pointer to next byte to parse, relative to buf->p */
- unsigned int col, sov; /* current header: colon, start of value */
+ unsigned int sov; /* current header: start of value */
unsigned int eoh; /* End Of Headers, relative to buffer */
char *sol; /* start of line, also start of message when fully parsed */
char *eol; /* end of line */
if (likely(HTTP_IS_TOKEN(*ptr)))
EAT_AND_JUMP_OR_RETURN(http_msg_hdr_name, HTTP_MSG_HDR_NAME);
- if (likely(*ptr == ':')) {
- msg->col = ptr - buf->p;
+ if (likely(*ptr == ':'))
EAT_AND_JUMP_OR_RETURN(http_msg_hdr_l1_sp, HTTP_MSG_HDR_L1_SP);
- }
if (likely(msg->err_pos < -1) || *ptr == '\n')
goto http_msg_invalid;
case HTTP_MSG_HDR_L1_SP:
http_msg_hdr_l1_sp:
- /* assumes msg->sol points to the first char and msg->col to the colon */
+ /* assumes msg->sol points to the first char */
if (likely(HTTP_IS_SPHT(*ptr)))
EAT_AND_JUMP_OR_RETURN(http_msg_hdr_l1_sp, HTTP_MSG_HDR_L1_SP);
case HTTP_MSG_HDR_VAL:
http_msg_hdr_val:
- /* assumes msg->sol points to the first char, msg->col to the
- * colon, and msg->sov points to the first character of the
- * value.
+ /* assumes msg->sol points to the first char, and msg->sov
+ * points to the first character of the value.
*/
if (likely(!HTTP_IS_CRLF(*ptr)))
EAT_AND_JUMP_OR_RETURN(http_msg_hdr_val, HTTP_MSG_HDR_VAL);
http_msg_complete_header:
/*
* It was a new header, so the last one is finished.
- * Assumes msg->sol points to the first char, msg->col to the
- * colon, msg->sov points to the first character of the value
- * and msg->eol to the first CR or LF so we know how the line
- * ends. We insert last header into the index.
+ * Assumes msg->sol points to the first char, msg->sov points
+ * to the first character of the value and msg->eol to the
+ * first CR or LF so we know how the line ends. We insert last
+ * header into the index.
*/
/*
fprintf(stderr,"registering %-2d bytes : ", msg->eol - msg->sol);
/* Assumes msg->sol points to the first of either CR or LF */
EXPECT_LF_HERE(ptr, http_msg_invalid);
ptr++;
- msg->col = msg->sov = msg->next = ptr - buf->p;
+ msg->sov = msg->next = ptr - buf->p;
msg->eoh = msg->sol - buf->p;
msg->sol = buf->p;
msg->msg_state = HTTP_MSG_BODY;
* later. At this point, we have the last CRLF at req->data + msg->eoh.
* If the request is in HTTP/0.9 form, the rule is still true, and eoh
* points to the CRLF of the request line. msg->next points to the first
- * byte after the last LF. msg->col and msg->sov point to the first
- * byte of data. msg->eol cannot be trusted because it may have been
- * left uninitialized (for instance in the absence of headers).
+ * byte after the last LF. msg->sov points to the first byte of data.
+ * msg->eol cannot be trusted because it may have been left uninitialized
+ * (for instance in the absence of headers).
*/
session_inc_http_req_ctr(s);
}
if (msg->msg_state < HTTP_MSG_CHUNK_SIZE) {
- /* we have msg->col and msg->sov which both point to the first
- * byte of message body. msg->som still points to the beginning
- * of the message. We must save the body in msg->next because it
- * survives buffer re-alignments.
+ /* we have msg->sov which points to the first byte of message body.
+ * msg->som still points to the beginning of the message. We must
+ * save the body in msg->next because it survives buffer re-alignments.
*/
msg->next = msg->sov;
}
/* Now we're in HTTP_MSG_DATA or HTTP_MSG_TRAILERS state.
- * We have the first non-header byte in msg->col, which is either the
- * beginning of the chunk size or of the data. The first data byte is in
- * msg->sov, which is equal to msg->col when not using transfer-encoding.
- * We're waiting for at least <url_param_post_limit> bytes after msg->sov.
+ * We have the first data byte is in msg->sov. We're waiting for at
+ * least <url_param_post_limit> bytes after msg->sov.
*/
if (msg->body_len < limit)
*/
if (msg->msg_state < HTTP_MSG_CHUNK_SIZE) {
- /* we have msg->col and msg->sov which both point to the first
- * byte of message body. msg->som still points to the beginning
- * of the message. We must save the body in msg->next because it
- * survives buffer re-alignments.
+ /* we have msg->sov which points to the first byte of message body.
+ * msg->som still points to the beginning of the message. We must
+ * save the body in msg->next because it survives buffer re-alignments.
*/
msg->next = msg->sov;
buffer_auto_close(res);
if (msg->msg_state < HTTP_MSG_CHUNK_SIZE) {
- /* we have msg->col and msg->sov which both point to the first
- * byte of message body. msg->som still points to the beginning
- * of the message. We must save the body in msg->next because it
- * survives buffer re-alignments.
+ /* we have msg->sov which points to the first byte of message body.
+ * msg->som still points to the beginning of the message. We must
+ * save the body in msg->next because it survives buffer re-alignments.
*/
msg->next = msg->sov;