httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: httpd-2.0/modules/dav/main mod_dav.c
Date Thu, 19 Jun 2003 21:24:10 GMT
gstein      2003/06/19 14:24:10

  Modified:    modules/dav/main mod_dav.c
  Log:
  Have mod_dav deal with errors that happen during a streamy provider
  response.
  
  * mod_dav.c (dav_method_propfind, dav_method_report): if the dav
      provider throws an error in the middle of streaming a response,
      have mod_dav log an error and abort the connection.
  
  Submitted by: Ben Collins-Sussman <sussman@collab.net>
  
  Revision  Changes    Path
  1.96      +28 -5     httpd-2.0/modules/dav/main/mod_dav.c
  
  Index: mod_dav.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/dav/main/mod_dav.c,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- mod_dav.c	19 Jun 2003 21:21:15 -0000	1.95
  +++ mod_dav.c	19 Jun 2003 21:24:10 -0000	1.96
  @@ -2060,8 +2060,18 @@
       }
   
       if (err != NULL) {
  -        /* ### add a higher-level description? */
  -        return dav_handle_err(r, err, NULL);
  +        /* If an error occurred during the resource walk, there's
  +           basically nothing we can do but abort the connection and
  +           log an error.  This is one of the limitations of HTTP; it
  +           needs to "know" the entire status of the response before
  +           generating it, which is just impossible in these streamy
  +           response situations. */
  +        err = dav_push_error(r->pool, err->status, 0,
  +                             "Provider encountered an error while streaming"
  +                             " a multistatus PROPFIND response.", err);
  +        dav_log_err(r, err, APLOG_ERR);
  +        r->connection->aborted = 1;
  +        return DONE;
       }
   
       /* Finish up the multistatus response. */
  @@ -4034,9 +4044,22 @@
       /* run report hook */
       if ((err = (*vsn_hooks->deliver_report)(r, resource, doc,
                                               r->output_filters)) != NULL) {
  -        /* NOTE: we're assuming that the provider has not generated any
  -           content yet! */
  -        return dav_handle_err(r, err, NULL);
  +        if (! r->sent_bodyct)
  +          /* No data has been sent to client yet;  throw normal error. */
  +          return dav_handle_err(r, err, NULL);
  +
  +        /* If an error occurred during the report delivery, there's
  +           basically nothing we can do but abort the connection and
  +           log an error.  This is one of the limitations of HTTP; it
  +           needs to "know" the entire status of the response before
  +           generating it, which is just impossible in these streamy
  +           response situations. */
  +        err = dav_push_error(r->pool, err->status, 0,
  +                             "Provider encountered an error while streaming"
  +                             " a REPORT response.", err);
  +        dav_log_err(r, err, APLOG_ERR);
  +        r->connection->aborted = 1;
  +        return DONE;
       }
   
       return DONE;
  
  
  

Mime
View raw message