Juan Hernandez has posted comments on this change.
Change subject: core: Non-plugin automatic invocation of console session
......................................................................
Patch Set 2: (1 inline comment)
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/console/ConsoleConfigServlet.java
Line 39: private void writeConfigFileHeader(HttpServletResponse response)
throws IOException {
Line 40: PrintWriter writer = response.getWriter();
Line 41:
Line 42: writer.println(CONFIG_FILE_HEADER);
Line 43: if (writer.checkError()) {
What I say is that this will catch errors in the very unlikely case that
writing to the buffer used by the application server fails. It may fail, if the
buffer is exhausted and that triggers the actual sending of the data, but as I
said this is extremely unlikely, specially when sending small amounts of data.
Most servlets in the world don't care at all about this, it is their fault.
All in all, I am equally satisfied with and without these calls to
writer.checkError.
Using the post method instead of get, and then loading all the potentially
unlimited (limited to 2 MiB by default in JBoss) content sent by the client in
memory at least three times (twice when the parameter is parsed as each
character takes two bytes, and once again when calling getBytes) is not very
secure. The get method is a bit better in these regards, as the complete header
is limited to 8 KiB. But I guess this is not really relevant.
Line 44: throw new IOException("Error when writing to response
stream");
Line 45: }
Line 46:
Line 47: writer.flush();
--
To view, visit http://gerrit.ovirt.org/11702
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18b9d2efad15f5e9bb98a8176112b721c810205f
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Frank Kobzik <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches