~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-http/http-server-connection.c

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2015-05-24 15:01:19 UTC
  • mto: (4.1.53 sid)
  • mto: This revision was merged to the branch mainline in revision 102.
  • Revision ID: package-import@ubuntu.com-20150524150119-hsh6cbr1fqseapga
Tags: upstream-2.2.18
ImportĀ upstreamĀ versionĀ 2.2.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
296
296
                   actual payload stream. */
297
297
                conn->incoming_payload = req->req.payload =
298
298
                        i_stream_create_limit(req->req.payload, (uoff_t)-1);
299
 
                i_stream_add_destroy_callback(req->req.payload,
300
 
                                              http_server_payload_destroyed, req);
301
 
                /* the callback may add its own I/O, so we need to remove
302
 
                   our one before calling it */
303
 
                http_server_connection_input_halt(conn);
 
299
        } else {
 
300
                conn->incoming_payload = req->req.payload =
 
301
                        i_stream_create_from_data("", 0);
304
302
        }
 
303
        i_stream_add_destroy_callback(req->req.payload,
 
304
                                      http_server_payload_destroyed, req);
 
305
        /* the callback may add its own I/O, so we need to remove
 
306
           our one before calling it */
 
307
        http_server_connection_input_halt(conn);
305
308
 
306
309
        http_server_connection_request_callback(conn, req);
307
310
        if (conn->closed) {
541
544
                        switch (error_code) {
542
545
                        case HTTP_REQUEST_PARSE_ERROR_BROKEN_REQUEST:
543
546
                                conn->input_broken = TRUE;
 
547
                                /* fall through */
544
548
                        case HTTP_REQUEST_PARSE_ERROR_BAD_REQUEST:
545
549
                                http_server_request_fail(req, 400, "Bad Request");
546
550
                                break;
547
551
                        case HTTP_REQUEST_PARSE_ERROR_METHOD_TOO_LONG:
548
552
                                conn->input_broken = TRUE;
 
553
                                /* fall through */
549
554
                        case HTTP_REQUEST_PARSE_ERROR_NOT_IMPLEMENTED:
550
555
                                http_server_request_fail(req, 501, "Not Implemented");
551
556
                                break;