Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 84291 Details for
Bug 126603
Lighttpd-1.4.11 Version Bump
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
files/1.4.11/ticket598_2.diff
ticket598_2.diff (text/plain), 2.41 KB, created by
Jochen Schalanda
on 2006-04-09 09:29:43 UTC
(
hide
)
Description:
files/1.4.11/ticket598_2.diff
Filename:
MIME Type:
Creator:
Jochen Schalanda
Created:
2006-04-09 09:29:43 UTC
Size:
2.41 KB
patch
obsolete
>--- lighttpd-1.4.11.orig/src/http-header-glue.c (revision 989) >+++ lighttpd-1.4.11/src/http-header-glue.c (revision 1057) >@@ -263,24 +263,9 @@ > } else { > char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")]; >- >- /* convert to timestamp */ >- if (used_len < sizeof(buf)) { >- time_t t_header, t_file; >- struct tm tm; >- >- strncpy(buf, con->request.http_if_modified_since, used_len); >- buf[used_len] = '\0'; >- >- strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm); >- t_header = mktime(&tm); >- >- strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm); >- t_file = mktime(&tm); >- >- if (t_file > t_header) { >- con->http_status = 304; >- return HANDLER_FINISHED; >- } >- } else { >+ time_t t_header, t_file; >+ struct tm tm; >+ >+ /* check if we can safely copy the string */ >+ if (used_len >= sizeof(buf)) { > log_error_write(srv, __FILE__, __LINE__, "ssdd", > "DEBUG: Last-Modified check failed as the received timestamp was too long:", >@@ -290,4 +275,19 @@ > return HANDLER_FINISHED; > } >+ >+ >+ strncpy(buf, con->request.http_if_modified_since, used_len); >+ buf[used_len] = '\0'; >+ >+ strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm); >+ t_header = mktime(&tm); >+ >+ strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm); >+ t_file = mktime(&tm); >+ >+ if (t_file > t_header) return HANDLER_GO_ON; >+ >+ con->http_status = 304; >+ return HANDLER_FINISHED; > } > } else { >@@ -303,5 +303,5 @@ > size_t used_len; > char *semicolon; >- >+ > if (NULL == (semicolon = strchr(con->request.http_if_modified_since, ';'))) { > used_len = strlen(con->request.http_if_modified_since); >@@ -313,4 +313,25 @@ > con->http_status = 304; > return HANDLER_FINISHED; >+ } else { >+ char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")]; >+ time_t t_header, t_file; >+ struct tm tm; >+ >+ /* convert to timestamp */ >+ if (used_len >= sizeof(buf)) return HANDLER_GO_ON; >+ >+ strncpy(buf, con->request.http_if_modified_since, used_len); >+ buf[used_len] = '\0'; >+ >+ strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm); >+ t_header = mktime(&tm); >+ >+ strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm); >+ t_file = mktime(&tm); >+ >+ if (t_file > t_header) return HANDLER_GO_ON; >+ >+ con->http_status = 304; >+ return HANDLER_FINISHED; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 126603
:
82411
|
83993
|
84289
|
84290
| 84291 |
84292
|
84293
|
87892