New http scripts


quick question. For the new http scripts, after logging a request in http_message_done, should the c$http record be deleted and re-populated? Otherwise if the new request that gets logged only fills part of these fields, the ones from the previous request will be filled out and thus get logged twice.

(Don't know whether that's an issue for other protocols as well)

event http_message_done(c: connection, is_orig: bool, stat: http_message_stat) &priority = -5
     # The reply body is done so we're ready to log.
     if ( ! is_orig )
         Log::write(HTTP, c$http);
         delete c$http_state$pending[c$http_state$current_response];


Gregor and I talked about this and he wasn't seeing the line of code that does what he wanted. :slight_smile:

In almost all cases, when you handle http events and you don't supply a priority for the handler, the c$http record should be set correctly even in the face of pipelined requests.