Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 145654 Details for
Bug 287302
while browsing in ATF can't log-in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
clipboard.txt (text/plain), 5.07 KB, created by
Jacek Pospychala
on 2009-08-26 05:56:13 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Jacek Pospychala
Created:
2009-08-26 05:56:13 EDT
Size:
5.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.atf.mozilla.ide.ui >Index: src/org/eclipse/atf/mozilla/ide/ui/netmon/model/impl/MozHTTPRequest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.atf/components/plugins/org.eclipse.atf.mozilla.ide.ui/src/org/eclipse/atf/mozilla/ide/ui/netmon/model/impl/MozHTTPRequest.java,v >retrieving revision 1.3 >diff -u -r1.3 MozHTTPRequest.java >--- src/org/eclipse/atf/mozilla/ide/ui/netmon/model/impl/MozHTTPRequest.java 17 Oct 2007 22:09:33 -0000 1.3 >+++ src/org/eclipse/atf/mozilla/ide/ui/netmon/model/impl/MozHTTPRequest.java 26 Aug 2009 09:55:24 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.atf.mozilla.ide.ui.netmon.model.impl; > >+import org.eclipse.atf.mozilla.ide.ui.MozIDEUIPlugin; > import org.eclipse.atf.mozilla.ide.ui.netmon.model.IHTTPRequest; > import org.mozilla.interfaces.nsIHttpChannel; > import org.mozilla.interfaces.nsIHttpHeaderVisitor; >@@ -30,100 +31,86 @@ > > //URL of the http request > protected String url; >- >+ > //HTTP method value > protected String method; >- >+ > //Body content of the request > protected String body = ""; >- >+ > //marks if this request is started using XHR > protected boolean xhr = false; >- >- public MozHTTPRequest( nsIHttpChannel httpChannel ){ >- this( httpChannel, false ); >+ >+ public MozHTTPRequest(nsIHttpChannel httpChannel) { >+ this(httpChannel, false); > } >- >- public MozHTTPRequest( nsIHttpChannel httpChannel, boolean xhr ){ >+ >+ public MozHTTPRequest(nsIHttpChannel httpChannel, boolean xhr) { > //creating the local request representation >- >+ > this.xhr = xhr; >- >+ > //URL of the request > this.url = httpChannel.getURI().getAsciiSpec(); >- >+ > //HTTP method used > this.method = httpChannel.getRequestMethod(); > > extractBody(httpChannel); >- >+ > extractHeaders(httpChannel); > } >- >+ > /* > * Currently handling POSTs and GETs > */ >- protected void extractBody( nsIHttpChannel httpChannel ) { >- if ( POST_METHOD.equals(this.method) || PUT_METHOD.equals(this.method) ) { >- >+ protected void extractBody(nsIHttpChannel httpChannel) { >+ if (POST_METHOD.equals(this.method) || PUT_METHOD.equals(this.method)) { >+ > // set the POST body as the body >- >+ > //The POST body needs to be read from an InputStream > nsIScriptableInputStream scriptableIS = null; >- >+ > //need it so that we can rewind the stream back > nsISeekableStream seekableStream = null; > nsIInputStream is = null; > try { >- nsIUploadChannel upChannel = (nsIUploadChannel) httpChannel >- .queryInterface(nsIUploadChannel.NS_IUPLOADCHANNEL_IID); >+ nsIUploadChannel upChannel = (nsIUploadChannel) httpChannel.queryInterface(nsIUploadChannel.NS_IUPLOADCHANNEL_IID); > > is = upChannel.getUploadStream(); > if (is != null) { >- seekableStream= (nsISeekableStream) is.queryInterface(nsISeekableStream.NS_ISEEKABLESTREAM_IID); >+ seekableStream = (nsISeekableStream) is.queryInterface(nsISeekableStream.NS_ISEEKABLESTREAM_IID); > >- scriptableIS = (nsIScriptableInputStream) Mozilla >- .getInstance() >- .getComponentManager() >- .createInstanceByContractID( >- "@mozilla.org/scriptableinputstream;1", >- null, >- nsIScriptableInputStream.NS_ISCRIPTABLEINPUTSTREAM_IID); >+ scriptableIS = (nsIScriptableInputStream) Mozilla.getInstance().getComponentManager().createInstanceByContractID("@mozilla.org/scriptableinputstream;1", null, nsIScriptableInputStream.NS_ISCRIPTABLEINPUTSTREAM_IID); > > scriptableIS.init(is); >- >+ > //read the entire stream into a StringBuffer > StringBuffer postBuf = new StringBuffer(); > long count; >- while( (count = scriptableIS.available()) > 0 )//some left to read{ >- postBuf.append( scriptableIS.read(count) ); >- >- >+ while ((count = scriptableIS.available()) > 0) >+ //some left to read{ >+ postBuf.append(scriptableIS.read(count)); >+ > body = postBuf.toString(); >- >+ > } > } catch (Exception e) { > //Any errors here, the POST body will be empty >- } >- finally{ >- if( scriptableIS != null ) >- scriptableIS.close(); >- >+ MozIDEUIPlugin.log(e); >+ } finally { > //rewind >- if( seekableStream != null ){ >- seekableStream.seek( 0, 0 ); >+ if (seekableStream != null) { >+ seekableStream.seek(nsISeekableStream.NS_SEEK_SET, 0); > } >- >- if( is != null ) >- is.close(); > } >- } >- else{ >+ } else { > // set the body to the parameters in the URL > body = httpChannel.getURI().getPath(); > } > } >- >+ > public String getBody() { > return body; > } >@@ -140,8 +127,7 @@ > return xhr; > } > >- protected void visitHeaders(nsIHttpChannel httpChannel, >- nsIHttpHeaderVisitor visitor) { >- httpChannel.visitRequestHeaders( visitor ); >+ protected void visitHeaders(nsIHttpChannel httpChannel, nsIHttpHeaderVisitor visitor) { >+ httpChannel.visitRequestHeaders(visitor); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 287302
: 145654