Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1222

Unhandled exception for TEvhttpServer request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6.1, 0.7
    • 0.7
    • C++ - Library
    • Any

    • Patch Available

    Description

      When an error occur during a HTTP request, exceptions are not captured before entering back libevent. For example a simple 'curl http://localhost:8080' will trigger a 'not enough data' exception, however no code will actually set the HTTP status (triggering a unhandled exception, and a crash).

      Here is a proposed change:

      void TEvhttpServer::request(struct evhttp_request* req, void* self) {
      try

      { static_cast<TEvhttpServer*>(self)->process(req); }

      catch(std::exception& e)

      { evhttp_send_reply(req, HTTP_INTERNAL, e.what(), 0); }

      }

      Attachments

        1. thrift-1222.patchv0.2.txt
          14 kB
          alexandre parenteau

        Activity

          People

            aubonbeurre alexandre parenteau
            aubonbeurre alexandre parenteau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified