Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 931496 Details for
Bug 1133061
Enabling SSL causes Agent communications to fail during or after plugins download
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
the TestServlet source code
TestServlet.java (text/plain), 2.49 KB, created by
John Mazzitelli
on 2014-08-27 14:14:54 UTC
(
hide
)
Description:
the TestServlet source code
Filename:
MIME Type:
Creator:
John Mazzitelli
Created:
2014-08-27 14:14:54 UTC
Size:
2.49 KB
patch
obsolete
>package org.rhq.enterprise.communications.servlet; > >import java.io.ByteArrayOutputStream; >import java.io.IOException; > >import javax.servlet.ServletConfig; >import javax.servlet.ServletException; >import javax.servlet.ServletInputStream; >import javax.servlet.ServletOutputStream; >import javax.servlet.http.HttpServlet; >import javax.servlet.http.HttpServletRequest; >import javax.servlet.http.HttpServletResponse; > >public class TestServlet extends HttpServlet { > private static final long serialVersionUID = 1L; > > @Override > public void init(ServletConfig config) throws ServletException { > super.init(config); > System.out.println("=========TEST SERVLET INIT()"); > } > > protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, > IOException { > > System.out.println("============TEST SERVLET ContentLength: " + request.getContentLength()); > System.out.println("============TEST SERVLET ContentType: " + request.getContentType()); > > int bufferSize = 1024; > byte[] byteBuffer = new byte[bufferSize]; > ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); > > int contentLength = request.getContentLength(); > ServletInputStream inputStream = request.getInputStream(); > int amtRead = inputStream.read(byteBuffer); > > while (amtRead > 0) { > byteOutputStream.write(byteBuffer, 0, amtRead); > if (amtRead < bufferSize && byteOutputStream.size() >= contentLength) { > break; > } > amtRead = inputStream.read(byteBuffer); > } > byteOutputStream.flush(); > byte[] totalByteArray = byteOutputStream.toByteArray(); > String resultMessage = String.format("Total bytes received/read=[%d]/[%d]", contentLength, totalByteArray.length); > System.out.println("================TEST SERVLET resultMessage=" + resultMessage); > byte[] out = resultMessage.getBytes(); > ServletOutputStream outStream = response.getOutputStream(); > outStream.write(out); > outStream.flush(); > outStream.close(); > //response.setContentLength(out.length); > } > > @Override > protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { > processRequest(req, resp); > } > > @Override > protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { > processRequest(req, resp); > } >}
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 Raw
Actions:
View
Attachments on
bug 1133061
:
931492
| 931496