Changeset 436
- Timestamp:
- Oct 15, 2014, 10:44:36 AM (11 years ago)
- Location:
- trunk/icedtea-web
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/icedtea-web/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java
r427 r436 51 51 import java.io.File; 52 52 import java.io.FileInputStream; 53 import java.io.InputStream; 53 54 import java.io.InputStreamReader; 54 55 import java.nio.charset.Charset; … … 535 536 } 536 537 537 public void createPluginReader(final File file) {538 OutputController.getLogger().log("Starting processing of plugin-debug-to-console " + file.getAbsolutePath());538 public void createPluginReader(final InputStream inputstream) { 539 OutputController.getLogger().log("Starting processing of plugin-debug-to-console " + inputstream); 539 540 Thread t = new Thread(new Runnable() { 540 541 541 542 @Override 542 543 public void run() { 544 OutputController.getLogger().log("Started processing of plugin-debug-to-console " + inputstream); 543 545 BufferedReader br = null; 544 546 try { 545 br = new BufferedReader(new InputStreamReader( new FileInputStream(file),547 br = new BufferedReader(new InputStreamReader(inputstream, 546 548 Charset.forName("UTF-8"))); 547 549 //never ending loop … … 567 569 } 568 570 } 569 OutputController.getLogger().log("Ended processing of plugin-debug-to-console " + file.getAbsolutePath());571 OutputController.getLogger().log("Ended processing of plugin-debug-to-console " + inputstream); 570 572 } 571 573 }, "plugin-debug-to-console reader thread"); 572 574 t.setDaemon(true); 573 575 t.start(); 574 575 OutputController.getLogger().log("Started processing of plugin-debug-to-console " + file.getAbsolutePath()); 576 } 577 578 public void createPluginReader(final File file) { 579 OutputController.getLogger().log("Starting processing of plugin-debug-to-console " + file.getAbsolutePath()); 580 try { 581 createPluginReader(new FileInputStream(file)); 582 } catch (Exception ex) { 583 OutputController.getLogger().log(ex); 584 } 576 585 } 577 586 } -
trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc
r433 r436 173 173 #endif 174 174 175 #ifdef __OS2__ 176 int debug_pipe[2] = { -1 }; 177 #else 175 178 // Applet viewer debug pipe name. 176 179 gchar* debug_pipe_name = NULL; 180 #endif 177 181 178 182 // Applet viewer output watch source. … … 588 592 initialize_debug();//should be already initialized, but... 589 593 if (plugin_debug_to_console){ 594 #ifdef __OS2__ 595 if (socketpair (AF_LOCAL, SOCK_STREAM, 0, debug_pipe) == -1) 596 { 597 PLUGIN_ERROR ("Failed to create debug pipe", strerror (errno)); 598 np_error = NPERR_GENERIC_ERROR; 599 goto cleanup_debug_pipe; 600 } 601 PLUGIN_DEBUG ("ITNP_New: created debug fifo: %d/%d\n", debug_pipe [0], debug_pipe [1]); 602 #else 590 603 // debug_pipe_name 591 604 debug_pipe_name = g_strdup_printf ("%s/%d-icedteanp-plugin-debug-to-appletviewer", … … 610 623 } 611 624 PLUGIN_DEBUG ("ITNP_New: created debug fifo: %s\n", debug_pipe_name); 625 #endif 612 626 } 613 627 … … 622 636 fcntl (in_pipe [0], F_SETFD, FD_CLOEXEC); 623 637 fcntl (out_pipe [0], F_SETFD, FD_CLOEXEC); 638 if (plugin_debug_to_console) 639 fcntl (debug_pipe [0], F_SETFD, FD_CLOEXEC); 624 640 #endif 625 641 … … 630 646 CLOSE_FD (in_pipe [1]); 631 647 CLOSE_FD (out_pipe [1]); 648 if (plugin_debug_to_console) 649 CLOSE_FD (debug_pipe [1]); 632 650 #endif 633 651 … … 698 716 // debug_to_appletviewer 699 717 if (plugin_debug_to_console){ 718 #ifdef __OS2__ 719 debug_to_appletviewer = g_io_channel_unix_new (debug_pipe [0]); 720 #else 700 721 debug_to_appletviewer = g_io_channel_new_file (debug_pipe_name, 701 722 "w", &channel_error); 723 #endif 702 724 if (!debug_to_appletviewer) 703 725 { … … 754 776 out_to_appletviewer = NULL; 755 777 778 #ifdef __OS2__ 779 cleanup_debug_pipe: 780 if (plugin_debug_to_console){ 781 CLOSE_FD (debug_pipe [0]); 782 CLOSE_FD (debug_pipe [1]); 783 } 784 #else 756 785 if (plugin_debug_to_console){ 757 786 // cleanup_debug_pipe: … … 766 795 debug_pipe_name = NULL; 767 796 } 768 769 797 #endif 770 798 771 799 // cleanup_out_pipe: … … 1636 1664 command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << out_pipe[1]).str()); 1637 1665 command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << in_pipe[1]).str()); 1666 if (plugin_debug_to_console) 1667 command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << debug_pipe[1]).str()); 1638 1668 #else 1639 1669 command_line.push_back(out_pipe_name); 1640 1670 command_line.push_back(in_pipe_name); 1641 #endif1642 1671 if (plugin_debug_to_console){ 1643 1672 command_line.push_back(debug_pipe_name); 1644 1673 } 1674 #endif 1645 1675 1646 1676 // Finished command line parameters … … 2440 2470 out_to_appletviewer = NULL; 2441 2471 // cleanup_debug_pipe: 2472 #ifdef __OS2__ 2473 CLOSE_FD (debug_pipe [0]); 2474 CLOSE_FD (debug_pipe [1]); 2475 #else 2442 2476 // Delete debug pipe. 2443 2477 PLUGIN_DEBUG ("NP_Shutdown: deleting debug fifo: %s\n", debug_pipe_name); … … 2447 2481 g_free (debug_pipe_name); 2448 2482 debug_pipe_name = NULL; 2483 #endif 2449 2484 } 2450 2485 -
trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.h
r431 r436 134 134 extern FILE * plugin_file_log; 135 135 extern std::string plugin_file_log_name; 136 #ifdef __OS2__ 137 extern int debug_pipe[2]; 138 #else 136 139 extern gchar* debug_pipe_name; 140 #endif 137 141 138 142 extern gboolean jvm_up; -
trunk/icedtea-web/plugin/icedteanp/IcedTeaPluginUtils.cc
r429 r436 1207 1207 } 1208 1208 if (plugin_debug_to_console){ 1209 #ifdef __OS2__ 1210 if (debug_pipe[0] != -1){ 1211 PLUGIN_DEBUG("plugin_debug_to_console: true, pipe %d\n", debug_pipe[0]); 1212 } 1213 #else 1209 1214 if (debug_pipe_name){ 1210 1215 PLUGIN_DEBUG("plugin_debug_to_console: true, pipe %s\n", debug_pipe_name); … … 1212 1217 PLUGIN_DEBUG("plugin_debug_to_console: true, pipe not yet known or broken\n"); 1213 1218 } 1219 #endif 1214 1220 } else { 1215 1221 PLUGIN_DEBUG("plugin_debug_to_console: false\n"); -
trunk/icedtea-web/plugin/icedteanp/os2/java/sun/applet/PluginMainBase.java
r431 r436 52 52 private static int inPipe = -1; 53 53 private static int outPipe = -1; 54 private static int debugPipe = -1; 54 55 55 56 static boolean checkArgs(String args[]) { … … 60 61 DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(); 61 62 if (JavaConsole.isEnabled()) { 62 if ((args.length < 3) || !new File(args[2]).exists()) {63 if ((args.length < 3) || (debugPipe = Integer.valueOf(args[2]).intValue()) < 0) { 63 64 OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Warning, although console is on, plugin debug connection do not exists. No plugin information will be displayed in console (only java ones)."); 64 } else {65 JavaConsole.getConsole().createPluginReader(new File(args[2]));66 65 } 67 66 } … … 81 80 fdAccess.set(outPipeFD, outPipe); 82 81 streamHandler = new PluginStreamHandler(new FileInputStream(inPipeFD), new FileOutputStream(outPipeFD)); 82 if (JavaConsole.isEnabled() && debugPipe != -1) { 83 FileDescriptor debugPipeFD = new FileDescriptor(); 84 fdAccess.set(debugPipeFD, debugPipe); 85 JavaConsole.getConsole().createPluginReader(new FileInputStream(debugPipeFD)); 86 } 83 87 PluginDebug.debug("Streams initialized"); 84 88 return streamHandler;
Note:
See TracChangeset
for help on using the changeset viewer.