# HG changeset patch # User Jonathan Ludlam # Date 1276865970 -3600 # Node ID 8e12ced865c4a6c8a23264990335646ffb06bd51 # Parent 002aaaf6c02700ad25b38c32d835f6b9228a9422 Change the 'close' field in the request record to be mutable rather than a reference Signed-off-by: Jon Ludlam diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/audit_log.ml --- a/ocaml/xapi/audit_log.ml +++ b/ocaml/xapi/audit_log.ml @@ -125,7 +125,7 @@ let s = Buf_io.fd_of bio in Buf_io.assert_buffer_empty bio; - req.close := true; + req.close <- true; Xapi_http.with_context (* makes sure to signal task-completed to cli *) (Printf.sprintf "audit_log_get request") diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/config_file_sync.ml --- a/ocaml/xapi/config_file_sync.ml +++ b/ocaml/xapi/config_file_sync.ml @@ -21,7 +21,7 @@ debug "received request to write out dom0 config files"; Xapi_http.with_context "Syncing dom0 config files over HTTP" req s (fun __context -> - req.Http.close := true; + req.Http.close <- true; debug "sending headers"; Http_svr.headers s (Http.http_200_ok ~keep_alive:false ()); debug "writing dom0 config files"; diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/console.ml --- a/ocaml/xapi/console.ml +++ b/ocaml/xapi/console.ml @@ -116,7 +116,7 @@ (* GET /console_uri?ref=..... Cookie: *) let handler proxy_fn (req: request) s = - req.close := true; + req.close <- true; Xapi_http.with_context "Connection to VM console" req s (fun __context -> let console = console_of_request __context req in diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/export.ml --- a/ocaml/xapi/export.ml +++ b/ocaml/xapi/export.ml @@ -368,7 +368,7 @@ let metadata_handler (req: request) s = debug "metadata_handler called"; - req.close := true; + req.close <- true; (* Xapi_http.with_context always completes the task at the end *) Xapi_http.with_context "VM.export_metadata" req s @@ -413,7 +413,7 @@ let handler (req: request) s = debug "export handler"; - req.close := true; + req.close <- true; (* First things first, let's make sure that the request has a valid session or username/password *) diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/import.ml --- a/ocaml/xapi/import.ml +++ b/ocaml/xapi/import.ml @@ -646,7 +646,7 @@ )) let handler (req: request) s = - req.close := true; + req.close <- true; Xapi_http.assert_credentials_ok "VM.import" ~http_action:"put_import" req; diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/import_raw_vdi.ml --- a/ocaml/xapi/import_raw_vdi.ml +++ b/ocaml/xapi/import_raw_vdi.ml @@ -24,7 +24,7 @@ open Pervasiveext let handler (req: request) (s: Unix.file_descr) = - req.close := true; + req.close <- true; Xapi_http.with_context "Importing raw VDI" req s (fun __context -> let vdi = diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/monitor_rrds.ml --- a/ocaml/xapi/monitor_rrds.ml +++ b/ocaml/xapi/monitor_rrds.ml @@ -413,7 +413,7 @@ let receive_handler (req: Http.request) (bio: Buf_io.t) = let query = req.Http.query in - req.Http.close := true; + req.Http.close <- true; debug "RRD receive handler"; if not(List.mem_assoc "uuid" query) then begin error "HTTP request for RRD lacked 'uuid' parameter"; @@ -468,7 +468,7 @@ (** Send handler, for sending out requested RRDs *) let handler (req: Http.request) s = let query = req.Http.query in - req.Http.close := true; + req.Http.close <- true; debug "RRD handler"; if not(List.mem_assoc "ref" query) && not(List.mem_assoc "uuid" query) then begin error "HTTP request for RRD lacked 'uuid' parameter"; @@ -526,7 +526,7 @@ (** Send handler, for sending out requested host RRDs *) let handler_host (req: Http.request) s = let query = req.Http.query in - req.Http.close := true; + req.Http.close <- true; debug "RRD host handler"; Xapi_http.with_context ~dummy:true "Obtaining the Host RRD statistics" req s (fun __context -> @@ -579,7 +579,7 @@ let handler_rrd_updates (req: Http.request) s = let query = req.Http.query in - req.Http.close := true; + req.Http.close <- true; Xapi_http.with_context ~dummy:true "Obtaining the Host RRD statistics" req s (fun __context -> if not(List.mem_assoc "start" query) then begin diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/pool_db_backup.ml --- a/ocaml/xapi/pool_db_backup.ml +++ b/ocaml/xapi/pool_db_backup.ml @@ -163,7 +163,7 @@ (** Called when a CLI user downloads a backup of the database *) let pull_database_backup_handler (req: Http.request) s = debug "received request to write out db as xml"; - req.Http.close := true; + req.Http.close <- true; Xapi_http.with_context "Dumping database as XML" req s (fun __context -> debug "sending headers"; diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/system_status.ml --- a/ocaml/xapi/system_status.ml +++ b/ocaml/xapi/system_status.ml @@ -102,7 +102,7 @@ let handler (req: request) s = debug "In system status http handler..."; - req.close := true; + req.close <- true; let get_param s = try List.assoc s req.query with _ -> "" diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/wlb_reports.ml --- a/ocaml/xapi/wlb_reports.ml +++ b/ocaml/xapi/wlb_reports.ml @@ -224,7 +224,7 @@ let client_sock = Buf_io.fd_of bio in Buf_io.assert_buffer_empty bio; debug "handle: fd = %d" (Unixext.int_of_file_descr client_sock); - req.close := true; + req.close <- true; Xapi_http.with_context (sprintf "WLB %s request" method_name) req client_sock diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/xapi_blob.ml --- a/ocaml/xapi/xapi_blob.ml +++ b/ocaml/xapi/xapi_blob.ml @@ -40,7 +40,7 @@ let handler (req: Http.request) s = let query = req.Http.query in - req.Http.close := true; + req.Http.close <- true; debug "blob handler"; if not(List.mem_assoc "ref" query) then begin let headers = Http.http_400_badrequest in diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/xapi_host_backup.ml --- a/ocaml/xapi/xapi_host_backup.ml +++ b/ocaml/xapi/xapi_host_backup.ml @@ -59,7 +59,7 @@ raise (Api_errors.Server_error (Api_errors.backup_script_failed, [log])) let host_backup_handler (req: request) s = - req.close := true; + req.close <- true; Xapi_http.with_context "Downloading host backup" req s (fun __context -> Http_svr.headers s (Http.http_200_ok ()); @@ -89,7 +89,7 @@ to_close := List.filter (fun x -> fd <> x) !to_close let host_restore_handler (req: request) s = - req.close := true; + req.close <- true; Xapi_http.with_context "Uploading host backup" req s (fun __context -> Http_svr.headers s (Http.http_200_ok ()); diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/xapi_http.ml --- a/ocaml/xapi/xapi_http.ml +++ b/ocaml/xapi/xapi_http.ml @@ -208,7 +208,7 @@ | None -> Server_helpers.exec_with_new_task ~task_in_database:(not dummy) label fail | Some task_id -> Server_helpers.exec_with_forwarded_task task_id fail end; - req.close := true; + req.close <- true; raise e (* Other exceptions are dealt with by the Http_svr module's exception handler *) diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/xapi_message.ml --- a/ocaml/xapi/xapi_message.ml +++ b/ocaml/xapi/xapi_message.ml @@ -385,7 +385,7 @@ days worth of messages as an RSS feed. *) let handler (req: Http.request) (bio: Buf_io.t) = let query = req.Http.query in - req.Http.close := true; + req.Http.close <- true; debug "Message handler"; let s = Buf_io.fd_of bio in Buf_io.assert_buffer_empty bio; diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/xapi_pool_patch.ml --- a/ocaml/xapi/xapi_pool_patch.ml +++ b/ocaml/xapi/xapi_pool_patch.ml @@ -429,7 +429,7 @@ Http_svr.response_file ~mime_content_type:None s path; end; - req.close := true + req.close <- true ) let get_patch_to_local ~__context ~self = diff -r 002aaaf6c027 -r 8e12ced865c4 ocaml/xapi/xapi_vncsnapshot.ml --- a/ocaml/xapi/xapi_vncsnapshot.ml +++ b/ocaml/xapi/xapi_vncsnapshot.ml @@ -42,6 +42,6 @@ ) (fun () -> try Unix.unlink tmp with _ -> ()) with e -> - req.close := true; + req.close <- true; raise e )