You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ag9 (JIRA)" <ji...@apache.org> on 2011/04/29 10:20:03 UTC

[jira] [Updated] (THRIFT-1159) THttpClient->Flush() issue (connection thru proxy)

     [ https://issues.apache.org/jira/browse/THRIFT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ag9 updated THRIFT-1159:
------------------------

           Description: 
*1)* Issue with *timeout* at the moment of call *THttpClient->Flush()* when I try to get data thru *proxy*.
Prerequestites: clent(c# thrift) before proxy, we resource (in my case http://google.com)
Code:
{code:java} 
class Program {
   static void Main(string[] args) {
	Uri uri = new Uri("http://google.com");
	TTransport transport = new THttpClient(uri);
  	transport.Flush();
   }
}
{code}

At the moment of call the method *transport.Flush();* just goes to sleep forever (in my app). 
Issue is locates in the: file *Transport/THttpClient.cs -> method CreateRequest()*  
code:
{code:java} 
connection.Proxy = null;
{code}

The lib should set state of proxy using some methods like to:
  use default proxy - property WebRequest.DefaultWebProxy from namespace System.Net
  add new property or methods with Proxy object
  probably use a method of declaring an attribute in C# - to write own custom attribute(s) for class THttpClient; it's   be able manage state of object inside without usage of some xml config files

*2)* *Timeout period* is not set by default.
Actually timeout period set to *0*
Code (file Transport/THttpClient.cs):
{code:java}
private int connectTimeout = 0;
private int readTimeout = 0;
{code}
Need to set value of timeout by default like *15* seconds instead of infinite interval.

*3)* *HttpWebRequest connection properties* sets by default
Code (file Transport/THttpClient.cs -> method CreateRequest()):
{code:java}
connection.ContentType = "application/x-thrift";
connection.Accept = "application/x-thrift";
connection.UserAgent = "C#/THttpClient";
connection.Method = "POST";
connection.ProtocolVersion = HttpVersion.Version10;
{code}
But need to *have a way to configure* it options thru object or class attributes in client code

  was:
1) Issue with timeout at the moment of call THttpClient->Flush() when I try to get data thru proxy.
Prerequestites: clent(c# thrift) before proxy, we resource (in my case http://google.com)
Code:
class Program {
   static void Main(string[] args) {
	Uri uri = new Uri("http://google.com");
	TTransport transport = new THttpClient(uri);
	transport.Flush();
   }
}

At the moment of call the method "transport.Flush();" just goes to sleep forever (in my app). 
Issue is locates in the: file Transport/THttpClient.cs -> method CreateRequest() - > 
code: connection.Proxy = null;

The lib should set state of proxy using some methods like to:
use default proxy - property WebRequest.DefaultWebProxy from namespace System.Net
add new property or methods with Proxy object
probably use a method of declaring an attribute in C# - to write own custom attribute(s) for class THttpClient; it's be able manage state of object inside without usage of some xml config files

2) Timeout period is not set by default.
Actually timeout period set to 0
Code (file Transport/THttpClient.cs):
private int connectTimeout = 0;
private int readTimeout = 0;
Need to set value of timeout by default like 15 seconds instead of infinite interval.

3) HttpWebRequest connection properties sets by default
Code (file Transport/THttpClient.cs -> method CreateRequest()):
connection.ContentType = "application/x-thrift";
connection.Accept = "application/x-thrift";
connection.UserAgent = "C#/THttpClient";
connection.Method = "POST";
connection.ProtocolVersion = HttpVersion.Version10;

But need to have a way to configure it options thru object or class attributes in client code

    Remaining Estimate: 12h  (was: 0.2h)
     Original Estimate: 12h  (was: 0.2h)

> THttpClient->Flush() issue (connection thru proxy)
> --------------------------------------------------
>
>                 Key: THRIFT-1159
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1159
>             Project: Thrift
>          Issue Type: Bug
>          Components: C# - Library
>         Environment: w2k sp4, .net2
>            Reporter: ag9
>            Priority: Minor
>              Labels: thrift
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
> *1)* Issue with *timeout* at the moment of call *THttpClient->Flush()* when I try to get data thru *proxy*.
> Prerequestites: clent(c# thrift) before proxy, we resource (in my case http://google.com)
> Code:
> {code:java} 
> class Program {
>    static void Main(string[] args) {
> 	Uri uri = new Uri("http://google.com");
> 	TTransport transport = new THttpClient(uri);
>   	transport.Flush();
>    }
> }
> {code}
> At the moment of call the method *transport.Flush();* just goes to sleep forever (in my app). 
> Issue is locates in the: file *Transport/THttpClient.cs -> method CreateRequest()*  
> code:
> {code:java} 
> connection.Proxy = null;
> {code}
> The lib should set state of proxy using some methods like to:
>   use default proxy - property WebRequest.DefaultWebProxy from namespace System.Net
>   add new property or methods with Proxy object
>   probably use a method of declaring an attribute in C# - to write own custom attribute(s) for class THttpClient; it's   be able manage state of object inside without usage of some xml config files
> *2)* *Timeout period* is not set by default.
> Actually timeout period set to *0*
> Code (file Transport/THttpClient.cs):
> {code:java}
> private int connectTimeout = 0;
> private int readTimeout = 0;
> {code}
> Need to set value of timeout by default like *15* seconds instead of infinite interval.
> *3)* *HttpWebRequest connection properties* sets by default
> Code (file Transport/THttpClient.cs -> method CreateRequest()):
> {code:java}
> connection.ContentType = "application/x-thrift";
> connection.Accept = "application/x-thrift";
> connection.UserAgent = "C#/THttpClient";
> connection.Method = "POST";
> connection.ProtocolVersion = HttpVersion.Version10;
> {code}
> But need to *have a way to configure* it options thru object or class attributes in client code

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira