Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: C# - Library
    • Labels:
      None

      Description

      IHttpHandler for Thrift.

      1. thrift-csharp-httphandler.diff
        4 kB
        Fredrik Hedberg
      2. thrift-csharp-httphandler.diffupdated.diff
        4 kB
        Nils Hügelmann
      3. thrift-csharp-httphandler2.diff
        5 kB
        Nils Hügelmann
      4. thrift-csharp-httphandler3.diff
        0.6 kB
        Nils Hügelmann
      5. thrift-csharp-httphandler-test.diff
        5 kB
        Nils Hügelmann
      6. ProcessRequestOverload.patch
        1 kB
        Nils Hügelmann
      7. ProcessRequestOverload_proper.patch
        2 kB
        Nils Hügelmann

        Issue Links

          Activity

          Fredrik Hedberg created issue -
          Fredrik Hedberg made changes -
          Field Original Value New Value
          Attachment thrift-csharp-httphandler.diff [ 12399739 ]
          Hide
          Michael Greene added a comment -

          Other than the formatting/header issues noted in THRIFT-323 :

          • Is there a reason this is marked executable?
          • Have you tested this with THRIFT-160 ? If that and this work properly together, we can write some good functional tests.

          I don't use System.Web for much, so I can't comment on the handling, but it looks simple enough. Can you give me an idea of how to test this?

          Show
          Michael Greene added a comment - Other than the formatting/header issues noted in THRIFT-323 : Is there a reason this is marked executable? Have you tested this with THRIFT-160 ? If that and this work properly together, we can write some good functional tests. I don't use System.Web for much, so I can't comment on the handling, but it looks simple enough. Can you give me an idea of how to test this?
          Hide
          Bryan Duxbury added a comment -

          This patch doesn't apply cleanly anymore - seems to be something about the csproj file.

          Show
          Bryan Duxbury added a comment - This patch doesn't apply cleanly anymore - seems to be something about the csproj file.
          Bryan Duxbury made changes -
          Patch Info [Patch Available]
          Roger Meier made changes -
          Link This issue is related to THRIFT-1138 [ THRIFT-1138 ]
          Hide
          Nils Hügelmann added a comment -

          Updated the patch to apply against trunk(r1091901) and added reference to System.Web in Thrift.csproj and Makefile

          Show
          Nils Hügelmann added a comment - Updated the patch to apply against trunk(r1091901) and added reference to System.Web in Thrift.csproj and Makefile
          Nils Hügelmann made changes -
          Hide
          Jake Farrell added a comment -

          Committed to trunk, thanks for the patch

          Show
          Jake Farrell added a comment - Committed to trunk, thanks for the patch
          Jake Farrell made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Nils Hügelmann [ nilshu ]
          Resolution Fixed [ 1 ]
          Hide
          Nils Hügelmann added a comment -

          This alternative Version of my patch contains 2 new overloads for ProcessRequest:

          ProcessRequest(HttpListenerContext context)
          ProcessRequest(Stream input, Stream output)
          (For use with the HttpListener and more general use cases)

          and some necessary restructuring for that.

          If there is some interest i could create some tests for it with the HttpClient of c# and/or js

          Show
          Nils Hügelmann added a comment - This alternative Version of my patch contains 2 new overloads for ProcessRequest: ProcessRequest(HttpListenerContext context) ProcessRequest(Stream input, Stream output) (For use with the HttpListener and more general use cases) and some necessary restructuring for that. If there is some interest i could create some tests for it with the HttpClient of c# and/or js
          Nils Hügelmann made changes -
          Attachment thrift-csharp-httphandler2.diff [ 12476283 ]
          Hide
          Jake Farrell added a comment -

          Any test cases you can provide in the test/csharp folder would be great. Please submit the new changes along with the test cases again the current trunk so they can apply cleanly.

          Reopened ticket pending test cases.

          Show
          Jake Farrell added a comment - Any test cases you can provide in the test/csharp folder would be great. Please submit the new changes along with the test cases again the current trunk so they can apply cleanly. Reopened ticket pending test cases.
          Jake Farrell made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Nils Hügelmann added a comment -

          Sorry...found a bug the applied patch. In the Makefile.am i have accidentially added the reference to the files to THRIFTCODE which results in a make error.
          Now it's a parameter in the csc build line.
          Patch is made against trunk

          Show
          Nils Hügelmann added a comment - Sorry...found a bug the applied patch. In the Makefile.am i have accidentially added the reference to the files to THRIFTCODE which results in a make error. Now it's a parameter in the csc build line. Patch is made against trunk
          Nils Hügelmann made changes -
          Attachment thrift-csharp-httphandler3.diff [ 12476285 ]
          Hide
          Jake Farrell added a comment -

          Can you add some test cases for this

          Show
          Jake Farrell added a comment - Can you add some test cases for this
          Hide
          Nils Hügelmann added a comment - - edited

          Created some test, but everytimes the third request aborts with a "System.Net.WebException: The request timed out" at System.Net.HttpWebRequest.GetRequestStream () of the client. There is no data transmitted tcp but the server is able to process further requests after client restart.

          Can somebody please confirm this?

          Patch does also contain the error in the makefile.

          I have changed the syntax for the test program:
          old
          ThriftTest.exe server [port]
          new
          ThriftTest.exe server tcp|http [port]

          my test:
          mono ThriftTest.exe server http 61000
          mono ThriftTest.exe client -u http://localhost:61000/

          btw please dont forget to apply my httphandler3.patch to fix the makefile problem

          [EDIT] typo

          Show
          Nils Hügelmann added a comment - - edited Created some test, but everytimes the third request aborts with a "System.Net.WebException: The request timed out" at System.Net.HttpWebRequest.GetRequestStream () of the client. There is no data transmitted tcp but the server is able to process further requests after client restart. Can somebody please confirm this? Patch does also contain the error in the makefile. I have changed the syntax for the test program: old ThriftTest.exe server [port] new ThriftTest.exe server tcp|http [port] my test: mono ThriftTest.exe server http 61000 mono ThriftTest.exe client -u http://localhost:61000/ btw please dont forget to apply my httphandler3.patch to fix the makefile problem [EDIT] typo
          Nils Hügelmann made changes -
          Attachment thrift-csharp-httphandler-test.diff [ 12476368 ]
          Hide
          Jake Farrell added a comment -

          Your patch v3 was applied as soon as you commented that it had an error in v2.

          Show
          Jake Farrell added a comment - Your patch v3 was applied as soon as you commented that it had an error in v2.
          Hide
          Jake Farrell added a comment -

          Nils, where you able to find a resolution for the 3rd test case aborting?

          Show
          Jake Farrell added a comment - Nils, where you able to find a resolution for the 3rd test case aborting?
          Hide
          Nils Hügelmann added a comment -

          Not yet... but as my server is working together with the js clientperfectly, i assume the error is in the client or because of this special combination...

          I have not tried further debugging yet.

          Show
          Nils Hügelmann added a comment - Not yet... but as my server is working together with the js clientperfectly, i assume the error is in the client or because of this special combination... I have not tried further debugging yet.
          Hide
          Sean Powers added a comment -

          Is there an example of how to host the server using THttpHandler? I looked through the "thrift-csharp-httphandler-test.diff" which uses the "HttpListenerContext httpctx;" on line 128 and passes that object to the "th.ProcessRequest(httpctx);" and this will not compile for me because ProcessRequest expects the HttpContext from System.Web and not a HttpListenerContext from System.Net.

          Am I reading it wrong or is there an updated example? Thanks.

          Show
          Sean Powers added a comment - Is there an example of how to host the server using THttpHandler? I looked through the "thrift-csharp-httphandler-test.diff" which uses the "HttpListenerContext httpctx;" on line 128 and passes that object to the "th.ProcessRequest(httpctx);" and this will not compile for me because ProcessRequest expects the HttpContext from System.Web and not a HttpListenerContext from System.Net. Am I reading it wrong or is there an updated example? Thanks.
          Hide
          Sean Powers added a comment -

          I figured out my prior post by incorporating Nils: thrift-csharp-httphandler2.diff.

          I am also having the same issue with the C# client communicating with the C# server after the third request throws an exception on the client application.

          Show
          Sean Powers added a comment - I figured out my prior post by incorporating Nils: thrift-csharp-httphandler2.diff. I am also having the same issue with the C# client communicating with the C# server after the third request throws an exception on the client application.
          Hide
          Sean Powers added a comment -

          Nils is correct, this is a bug in the HttpClient not in the server. The inputStream needs to be closed before a new response is read. I fixed it on my local copy and everything seems stable now with the Thrift THttpClient and THttpHandler.

          Show
          Sean Powers added a comment - Nils is correct, this is a bug in the HttpClient not in the server. The inputStream needs to be closed before a new response is read. I fixed it on my local copy and everything seems stable now with the Thrift THttpClient and THttpHandler.
          Hide
          Nils Hügelmann added a comment -

          This piece of code was not commited yet in 0.7
          It transforms the current ProcessRequest into a generic one which accept in- and out-streams. Then it adds 2 overloads for ProcessRequest, one to use it with HttpListenerContext from System.Net and one to use with HttpContext from System.Web.

          The one for System.Net is very useful because you can make a webserver in your application using System.Net.HttpListener.
          I'm using it for comunication with my JavaScript client

          Show
          Nils Hügelmann added a comment - This piece of code was not commited yet in 0.7 It transforms the current ProcessRequest into a generic one which accept in- and out-streams. Then it adds 2 overloads for ProcessRequest, one to use it with HttpListenerContext from System.Net and one to use with HttpContext from System.Web. The one for System.Net is very useful because you can make a webserver in your application using System.Net.HttpListener. I'm using it for comunication with my JavaScript client
          Nils Hügelmann made changes -
          Attachment ProcessRequestOverload.patch [ 12490465 ]
          Hide
          Roger Meier added a comment -

          Hi Nils
          the ProcessRequestOverload.patch does not apply properly
          could you recreate that patch?

          see http://wiki.apache.org/thrift/HowToContribute

          thanks
          roger

          Show
          Roger Meier added a comment - Hi Nils the ProcessRequestOverload.patch does not apply properly could you recreate that patch? see http://wiki.apache.org/thrift/HowToContribute thanks roger
          Hide
          Nils Hügelmann added a comment -

          okay, this one is created with svn diff against trunk, rev 1161548

          Show
          Nils Hügelmann added a comment - okay, this one is created with svn diff against trunk, rev 1161548
          Nils Hügelmann made changes -
          Attachment ProcessRequestOverload_proper.patch [ 12491635 ]
          Hide
          Roger Meier added a comment -

          thanks Nils!

          Show
          Roger Meier added a comment - thanks Nils!
          Roger Meier made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Hudson added a comment -

          Integrated in Thrift #248 (See https://builds.apache.org/job/Thrift/248/)
          THRIFT-322 IHttpHandler for Thrift
          Patch: Nils Huegelmann

          roger : http://svn.apache.org/viewvc/?view=rev&rev=1164723
          Files :

          • /thrift/trunk/lib/csharp/src/Transport/THttpHandler.cs
          Show
          Hudson added a comment - Integrated in Thrift #248 (See https://builds.apache.org/job/Thrift/248/ ) THRIFT-322 IHttpHandler for Thrift Patch: Nils Huegelmann roger : http://svn.apache.org/viewvc/?view=rev&rev=1164723 Files : /thrift/trunk/lib/csharp/src/Transport/THttpHandler.cs
          Jake Farrell made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          794d 22h 35m 1 Jake Farrell 13/Apr/11 22:09
          Resolved Resolved Reopened Reopened
          13m 44s 1 Jake Farrell 13/Apr/11 22:23
          Reopened Reopened Resolved Resolved
          142d 22m 1 Roger Meier 02/Sep/11 22:45
          Resolved Resolved Closed Closed
          59d 5h 7m 1 Jake Farrell 01/Nov/11 02:53

            People

            • Assignee:
              Nils Hügelmann
              Reporter:
              Fredrik Hedberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development