*
****************************************************************/
-/*
+/*
* Parse the HTTP message and put results into the request structure.
* CISAPI extensions do not see the actual message buffer.
*
GOTO_REDIR;
}
-#define PARSE_STR_FIELD(char,field,str,len) \
+#define PARSE_STR_FIELD(char,field,str,len) \
if (PARSE_TOKEN(curr,field,left)) { \
req->str = curr; \
SKIP_LINE(curr,left); \
* 3) strip trailing dots
* 4) potentially strip off tail
*/
-
+
#define is_w(n) ((curr[n] == 'w') || (curr[n] == 'W'))
if ((left > 4) && is_w(0) && is_w(1) &&
left -= 4;
tmp = curr;
}
-
+
COPY_LINE_TOLOWER(curr, tmp2, left, req->host+MAX_HOST_LEN-2);
req->host_len = curr - tmp - 2;
while (req->host[req->host_len] == '.') {
{
/*
* -1 : no previous checks made
- * 0 : previous check failed, do not check farther,
+ * 0 : previous check failed, do not check farther,
* 1 : previous check successed, check farther
*/
int not_modified = -1;
not_modified = 1;
TDprintk("Etag matched.\n");
} else
- not_modified = 0;
+ not_modified = 0;
}
if ((req->if_modified_since_len >= 24) && (abs(not_modified) == 1)) {
mntput(mnt);
mnt = NULL;
}
-#if CONFIG_TUX_DEBUG
+#ifdef CONFIG_TUX_DEBUG
if (!not_modified) {
TDprintk("req %p has lookup errors!\n", req);
if (tux_TDprintk)
strncpy(ext, new_ext, ext_len);
strncpy(type, new_type, type_len);
strncpy(expire, new_expire, expire_len);
-
+
// in case one of the above parameters was too long :
ext[ext_len] = '\0';
int size;
size = NOTMODIFIED_1_LEN + DATE_LEN - 1 + NOTMODIFIED_2_LEN + req->etaglen + NOTMODIFIED_3_LEN;
- buf = get_abuf(req, size);
+ buf = get_abuf(req, size);
memcpy(buf, NOTMODIFIED_1, NOTMODIFIED_1_LEN);
buf += NOTMODIFIED_1_LEN;
memcpy(buf, tux_date, DATE_LEN-1);
- buf += DATE_LEN-1;
+ buf += DATE_LEN-1;
memcpy(buf, NOTMODIFIED_2, NOTMODIFIED_2_LEN);
buf += NOTMODIFIED_2_LEN;
memcpy(buf, &req->etag, req->etaglen);
static void http_lookup_vhost (tux_req_t *req, int cachemiss)
{
struct dentry *dentry;
- struct nameidata base={};
+ struct nameidata base = { };
struct vfsmount *mnt = NULL;
unsigned int flag = cachemiss ? 0 : LOOKUP_ATOMIC;
-
+
Dprintk("http_lookup_vhost(%p, %d, virtual: %d, host: %s (%d).)\n", req, flag, req->virtual, req->host, req->host_len);
base.flags = LOOKUP_FOLLOW|flag;
goto error;
case MIME_TYPE_CGI:
-#if CONFIG_TUX_EXTCGI
+#ifdef CONFIG_TUX_EXTCGI
Dprintk("CGI request %p.\n", req);
query_extcgi(req);
return;
static void http_post_header (tux_req_t *req, int cachemiss)
{
-#if CONFIG_TUX_DEBUG
+#ifdef CONFIG_TUX_DEBUG
req->bytes_expected = req->output_len;
#endif
req->bytes_sent = 0; // data comes now.
SET_TIMESTAMP(req->output_timestamp);
if (req->error) {
-#if CONFIG_TUX_DEBUG
+#ifdef CONFIG_TUX_DEBUG
req->bytes_expected = 0;
#endif
req->in_file->f_pos = 0;
ret = generic_send_file(req, req->sock, cachemiss);
Dprintk("body send-file returned: %d.\n", ret);
} else {
-#if CONFIG_TUX_DEBUG
+#ifdef CONFIG_TUX_DEBUG
req->bytes_expected = 0;
#endif
}
"Content-Type: "
#define HEADER_PART1B \
- "HTTP/1.1 200 OK"
+ "HTTP/1.1 200 OK"
#define HEADER_PART1AP \
"HTTP/1.1 206 Partial Content\r\n" \
"Content-Type: "
#define HEADER_PART1BP \
- "HTTP/1.1 206 Partial Content"
+ "HTTP/1.1 206 Partial Content"
#define HEADER_PART1C \
"HTTP/1.1 404 Page Not Found\r\n" \
size = curr-buf;
-#if CONFIG_TUX_DEBUG
+#ifdef CONFIG_TUX_DEBUG
*curr = 0;
Dprintk("{%s} [%d/%d]\n", buf, size, strlen(buf));
#endif
Dprintk("http_check_req_err(%p,%d): 1 (state: %d, urg: %d)\n",
req, cachemiss, req->sock->sk->sk_state,
tcp_sk(req->sock->sk)->urg_data);
-#if CONFIG_TUX_DEBUG
+#ifdef CONFIG_TUX_DEBUG
req->bytes_expected = 0;
#endif
req->in_file->f_pos = 0;