mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Migrate table-based for-loops to key-value iteration
This commit is contained in:
parent
41c7b229d3
commit
01d303b480
36 changed files with 150 additions and 153 deletions
|
@ -40,10 +40,10 @@ function describe_file(f: fa_file): string
|
|||
if ( f$source != "HTTP" )
|
||||
return "";
|
||||
|
||||
for ( cid in f$conns )
|
||||
for ( cid, c in f$conns )
|
||||
{
|
||||
if ( f$conns[cid]?$http )
|
||||
return build_url_http(f$conns[cid]$http);
|
||||
if ( c?$http )
|
||||
return build_url_http(c$http);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -326,11 +326,11 @@ event connection_state_remove(c: connection) &priority=-5
|
|||
# Flush all pending but incomplete request/response pairs.
|
||||
if ( c?$http_state )
|
||||
{
|
||||
for ( r in c$http_state$pending )
|
||||
for ( r, info in c$http_state$pending )
|
||||
{
|
||||
# We don't use pending elements at index 0.
|
||||
if ( r == 0 ) next;
|
||||
Log::write(HTTP::LOG, c$http_state$pending[r]);
|
||||
Log::write(HTTP::LOG, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue