...
 
Commits (7)
......@@ -565,13 +565,36 @@ void add_query_variables(mapping(string:string) vars) {
// RFC 1738, 2.2. URL Character Encoding Issues
protected constant url_non_corresponding = enumerate(0x21) +
enumerate(0x81,1,0x7f);
protected constant url_unsafe = ({ '<', '>', '"', '#', '%', '{', '}',
'|', '\\', '^', '~', '[', ']', '`' });
protected constant url_reserved = ({ ';', '/', '?', ':', '@', '=', '&' });
// RFC 3986 2.2: gen-delims
protected constant url_gen_delims = ({
':', '/', '?', '#', '[', ']', '@',
});
// RFC 3986 2.2: sub-delims
protected constant url_sub_delims = ({
'!', '$', '&', '\'', '(', ')',
'*', '+', ',', ';', '=',
});
// RFC 3986 2.2: reserved
protected constant url_reserved = url_gen_delims + url_sub_delims;
protected constant rfc1738_url_unsafe = ({
// RFC 1738 5: punctuation
'%', '"',
// RFC 1738 5: national
'{', '}', '|', '\\', '^', '~', '`',
}) - ({
/* RFC 3986 2.3:
* For consistency, percent-encoded octets in the ranges of ALPHA
* (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period
* (%2E), underscore (%5F), or tilde (%7E) should not be created
* by URI producers and, when found in a URI, should be decoded to
* their corresponding unreserved characters by URI normalizers.
*/
'~',
});
// Encode these chars
protected constant url_chars = url_non_corresponding + url_unsafe +
url_reserved + ({ '+', '\'' });
protected constant url_chars = url_reserved + rfc1738_url_unsafe +
url_non_corresponding;
protected constant url_from = sprintf("%c", url_chars[*]);
protected constant url_to = sprintf("%%%02x", url_chars[*]);
......
......@@ -1495,7 +1495,7 @@ TBSCertificate verify_certificate(string s,
foreach(verifiers || ({}), Verifier v) {
if (v->verify(cert[1], cert[0]->get_der(), cert[2]->value,
options->?verifier_algorithms))
options?->verifier_algorithms))
return tbs;
}
return 0;
......
......@@ -158,7 +158,7 @@ PIKEFUN array(string|int) parse_event(string data) {
*! @tt{inotify_init(2)@}. Every object of this class has its own inotify
*! file descriptor. Use this class only if you want direct access to
*! the file descriptor to read from it manually. For a more user
*! friendly inferface use @[System.Inotify.Instance].
*! friendly interface use @[System.Inotify.Instance].
*!
*! @seealso
*! @[System.Inotify.Instance]
......@@ -433,6 +433,7 @@ PIKECLASS _Instance {
if (bytes > 0) {
THIS->buf.s->len += bytes;
}
while (THIS->buf.s->len >=
(off + (ptrdiff_t)sizeof(struct inotify_event))) {
/* NB: Assumes that e->len has a valid alignment
......@@ -442,10 +443,14 @@ PIKECLASS _Instance {
struct inotify_event *e = (void *)(THIS->buf.s->str + off);
const char *path = (char *)(e + 1);
ptrdiff_t new_off = off + sizeof(struct inotify_event) + e->len;
if (new_off > THIS->buf.s->len) {
/* Not enough data for the filename yet. */
if ((new_off > THIS->buf.s->len) ||
!callablep(&THIS->event_callback)) {
/* Not enough data for the filename yet,
* or the callback has been invalidated.
*/
break;
}
off = new_off;
push_int(e->wd);
......
......@@ -6,7 +6,7 @@
#define PIKE_MAJOR_VERSION 8
#define PIKE_MINOR_VERSION 0
#define PIKE_BUILD_VERSION 977
#define PIKE_BUILD_VERSION 981
#define LOWEST_COMPAT_MAJOR 7
#define LOWEST_COMPAT_MINOR 6
......