mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
Deprecate split* family of BIFs.
These functions are now deprecated in favor of alternative versions that return a vector of strings rather than a table of strings. Deprecated functions: - split: use split_string instead. - split1: use split_string1 instead. - split_all: use split_string_all instead. - split_n: use split_string_n instead. - cat_string_array: see join_string_vec instead. - cat_string_array_n: see join_string_vec instead. - join_string_array: see join_string_vec instead. - sort_string_array: use sort instead instead. - find_ip_addresses: use extract_ip_addresses instead. Changed functions: - has_valid_octets: uses a string_vec parameter instead of string_array. Addresses BIT-924, BIT-757.
This commit is contained in:
parent
011e2cdd32
commit
23f04835c6
30 changed files with 574 additions and 359 deletions
|
@ -105,21 +105,21 @@ function request(req: Request): ActiveHTTP::Response
|
|||
# The reply is the first line.
|
||||
if ( i == 0 )
|
||||
{
|
||||
local response_line = split_n(headers[0], /[[:blank:]]+/, F, 2);
|
||||
local response_line = split_string_n(headers[0], /[[:blank:]]+/, F, 2);
|
||||
if ( |response_line| != 3 )
|
||||
return resp;
|
||||
|
||||
resp$code = to_count(response_line[2]);
|
||||
resp$msg = response_line[3];
|
||||
resp$code = to_count(response_line[1]);
|
||||
resp$msg = response_line[2];
|
||||
resp$body = join_string_vec(result$files[bodyfile], "");
|
||||
}
|
||||
else
|
||||
{
|
||||
local line = headers[i];
|
||||
local h = split1(line, /:/);
|
||||
local h = split_string1(line, /:/);
|
||||
if ( |h| != 2 )
|
||||
next;
|
||||
resp$headers[h[1]] = sub_bytes(h[2], 0, |h[2]|-1);
|
||||
resp$headers[h[0]] = sub_bytes(h[1], 0, |h[1]|-1);
|
||||
}
|
||||
}
|
||||
return resp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue