Changeset 431


Ignore:
Timestamp:
Oct 2, 2014, 1:13:59 AM (11 years ago)
Author:
dmik
Message:

icedtea-web: Adapt 1.5.1 changes to OS/2.

Location:
trunk/icedtea-web
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/icedtea-web/Config.kmk

    r423 r431  
    99PACKAGE_NAME       := icedtea-web
    1010PACKAGE_VER_MAJOR  := 1
    11 PACKAGE_VER_MINOR  := 3
    12 PACKAGE_VER_PATCH  := 0
     11PACKAGE_VER_MINOR  := 5
     12PACKAGE_VER_PATCH  := 1
    1313PACKAGE_VERSION    := $(PACKAGE_VER_MAJOR).$(PACKAGE_VER_MINOR).$(PACKAGE_VER_PATCH)
    1414PACKAGE_STRING     := $(PACKAGE_NAME) $(PACKAGE_VERSION)
     
    3030#ICEDTEA_WEB_DATA_DIR    := /@unixroot/usr/share/$(PACKAGE_NAME)
    3131
    32 ICEDTEA_WEB_JRE     = icedtea_web_jre_dir()
     32ICEDTEA_WEB_JRE     = ""
    3333
    3434#
     
    3939#  - we want full privileges
    4040#
    41 LAUNCHER_BOOTCLASSPATH  = \"-Xbootclasspath/a:%s/netx.jar$(RHINO_RUNTIME)\", \
    42                           icedtea_web_data_dir()
    43 PLUGIN_BOOTCLASSPATH    = \"-Xbootclasspath/a:%s/netx.jar;%s/plugin.jar$(RHINO_RUNTIME)\", \
    44                           icedtea_web_data_dir(), icedtea_web_data_dir()
     41LAUNCHER_BOOTCLASSPATH  = \"-Xbootclasspath/a:%s/netx.jar$(RHINO_RUNTIME)\"
     42PLUGIN_BOOTCLASSPATH    = \"-Xbootclasspath/a:@DATADIR@/netx.jar;@DATADIR@/plugin.jar$(RHINO_RUNTIME)\"
    4543
    4644# Fake update version to work with the Deployment Toolkit script used by Oracle
  • trunk/icedtea-web/netx/Makefile.kmk

    r381 r431  
    6161        (cd $(netx_0_OUTDIR); \
    6262        $(PATH_BOOTSTRAP_JDK)/bin/jar cfm $(netx_JARFILE) \
    63             $(netx_MANIFEST) javax/jnlp net)
     63            $(netx_MANIFEST) javax/jnlp net sun)
    6464
    6565netx: $$(netx_JARFILE)
  • trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc

    r429 r431  
    221221
    222222#ifdef __OS2__
    223 struct QueueProcessorData
    224 {
    225     PluginRequestProcessor *processor;
    226     bool stopRequested;
    227 };
    228 
    229223static QueueProcessorData queue_processor_data1 = { NULL, false };
    230224static QueueProcessorData queue_processor_data2 = { NULL, false };
     
    314308            }
    315309      }
     310#ifdef __OS2___
     311      custom_jre = icedtea_web_jre_dir();
     312      if (custom_jre.length())
     313          return custom_jre+"/bin/java";
     314#endif
    316315      return appletviewer_default_executable;     
    317316}
     
    327326            }
    328327      }
    329       return appletviewer_default_rtjar;     
     328#ifdef __OS2___
     329      custom_jre = icedtea_web_jre_dir();
     330      if (custom_jre.length())
     331          return custom_jre+"/lib/rt.jar";
     332#endif
     333      return appletviewer_default_rtjar;
    330334}
    331335
     
    513517  if (socketpair (AF_LOCAL, SOCK_STREAM, 0, in_pipe) == -1)
    514518    {
    515       PLUGIN_ERROR_TWO ("Failed to create input pipe", strerror (errno));
     519      PLUGIN_ERROR ("Failed to create input pipe", strerror (errno));
    516520      np_error = NPERR_GENERIC_ERROR;
    517521      goto cleanup_in_pipe;
     
    550554  if (socketpair (AF_LOCAL, SOCK_STREAM, 0, out_pipe) == -1)
    551555    {
    552       PLUGIN_ERROR_TWO ("Failed to create output pipe", strerror (errno));
     556      PLUGIN_ERROR ("Failed to create output pipe", strerror (errno));
    553557      np_error = NPERR_GENERIC_ERROR;
    554558      goto cleanup_out_pipe;
     
    15941598  }
    15951599
     1600#ifdef __OS2__
     1601  {
     1602    std::string path = PLUGIN_BOOTCLASSPATH;
     1603    static const std::string datadir = "@DATADIR@";
     1604    size_t pos = 0;
     1605    while ((pos = path.find(datadir, pos)) != std::string::npos) {
     1606      path.replace(pos, datadir.length(), icedtea_web_data_dir());
     1607      pos += datadir.length();
     1608    }
     1609    command_line.push_back(path);
     1610  }
     1611#else
    15961612  command_line.push_back(PLUGIN_BOOTCLASSPATH);
     1613#endif
    15971614  // set the classpath to avoid using the default (cwd).
    15981615  command_line.push_back("-classpath");
     
    16171634  command_line.push_back("sun.applet.PluginMain");
    16181635#ifdef __OS2__
    1619   command_line.push_back((std::ostrstream() << out_pipe[1]).str());
    1620   command_line.push_back((std::ostrstream() << in_pipe[1]).str());
     1636  command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << out_pipe[1]).str());
     1637  command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << in_pipe[1]).str());
    16211638#else
    16221639  command_line.push_back(out_pipe_name);
     
    24432460
    24442461#ifdef __OS2__
    2445   // pthread_cancel() isn't implemented on OS?2, so use an old good flag
     2462  // pthread_cancel() isn't implemented on OS/2, so use an old good flag
    24462463  queue_processor_data1.stopRequested = true;
    24472464  queue_processor_data2.stopRequested = true;
    24482465  queue_processor_data3.stopRequested = true;
    2449   pthread_cond_broadcast(&cond_message_available);
     2466  plugin_req_proc->cancelWait();
    24502467#else
    24512468  pthread_cancel(plugin_request_processor_thread1);
  • trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.h

    r429 r431  
    107107NPError start_jvm_if_needed();
    108108
     109#ifdef __OS2__
     110struct QueueProcessorData
     111{
     112    PluginRequestProcessor *processor;
     113    bool stopRequested;
     114};
     115#endif
     116
    109117// ID of plug-in thread
    110118extern pthread_t itnp_plugin_thread_id;
  • trunk/icedtea-web/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc

    r429 r431  
    643643    QueueProcessorData *queue_processor_data = (QueueProcessorData *) data;
    644644    PluginRequestProcessor* processor = queue_processor_data->processor;
     645    processor->queueProcessorThread(queue_processor_data);
    645646#else
    646647    PluginRequestProcessor* processor = (PluginRequestProcessor*) data;
     648    processor->queueProcessorThread();
    647649#endif
    648     processor->queueProcessorThread();
    649650    return NULL;
    650651}
    651652
    652653void
     654#ifdef __OS2__
     655PluginRequestProcessor::queueProcessorThread(QueueProcessorData *queue_processor_data)
     656#else
    653657PluginRequestProcessor::queueProcessorThread()
     658#endif
    654659{
    655660    std::vector<std::string*>* message_parts = NULL;
  • trunk/icedtea-web/plugin/icedteanp/IcedTeaPluginRequestProcessor.h

    r429 r431  
    7070void* queue_processor(void* data);
    7171
     72#ifdef __OS2__
     73struct QueueProcessorData;
     74#endif
     75
    7276/**
    7377 * Processes requests made TO the plugin (by java or anyone else)
     
    127131
    128132        /* Thread run method for processing queued messages */
     133#ifdef __OS2__
     134        void queueProcessorThread(QueueProcessorData *queue_processor_data);
     135        void cancelWait() { pthread_cond_broadcast(&cond_message_available); }
     136#else
    129137        void queueProcessorThread();
     138#endif
    130139};
    131140
  • trunk/icedtea-web/plugin/icedteanp/Makefile.kmk

    r422 r431  
    3838    IcedTeaJavaRequestProcessor.cc \
    3939    IcedTeaPluginRequestProcessor.cc \
    40     IcedTeaPluginUtils.cc
     40    IcedTeaPluginUtils.cc \
     41    IcedTeaParseProperties.cc
    4142
    4243npicedt_SOURCES.os2 = \
  • trunk/icedtea-web/plugin/icedteanp/java/sun/applet/PluginMain.java

    r429 r431  
    133133            JNLPRuntime.exit(1);
    134134        }
    135         DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched();
    136         if (JavaConsole.isEnabled()) {
    137             if ((args.length < 3) || !new File(args[2]).exists()) {
    138                 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).");
    139             } else {
    140                 JavaConsole.getConsole().createPluginReader(new File(args[2]));
    141             }
    142         }
     135
    143136        try {
    144137            PluginStreamHandler streamHandler = connect(args);
  • trunk/icedtea-web/plugin/icedteanp/os2/OS_OS2_WinOS2.cc

    r385 r431  
    4141#include <winuser32.h> // CreateFakeWindowEx and friends
    4242
     43#include "IcedTeaNPPlugin.h"
    4344#include "IcedTeaPluginUtils.h"
    4445
  • trunk/icedtea-web/plugin/icedteanp/os2/java/sun/applet/PluginMainBase.java

    r368 r431  
    4444import java.io.IOException;
    4545
     46import net.sourceforge.jnlp.config.DeploymentConfiguration;
     47import net.sourceforge.jnlp.util.logging.JavaConsole;
     48import net.sourceforge.jnlp.util.logging.OutputController;
     49
    4650class PluginMainBase {
    4751
     
    5054
    5155    static boolean checkArgs(String args[]) {
    52         if (args.length == 2) {
     56        if (args.length >= 2) {
    5357            inPipe = Integer.valueOf(args[0]).intValue();
    5458            outPipe = Integer.valueOf(args[1]).intValue();
    55             if (inPipe >= 0 && outPipe >= 0)
     59            if (inPipe >= 0 && outPipe >= 0) {
     60                DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched();
     61                if (JavaConsole.isEnabled()) {
     62                    if ((args.length < 3) || !new File(args[2]).exists()) {
     63                        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                    }
     67                }
    5668                return true;
     69            }
    5770        }
    58         System.err.println("Invalid pipe descriptors provided. Refusing to proceed.");
     71        OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Invalid pipe descriptors provided. Refusing to proceed.");
    5972        return false;
    6073    }
     
    6780        FileDescriptor outPipeFD = new FileDescriptor();
    6881        fdAccess.set(outPipeFD, outPipe);
    69         try {
    70             streamHandler = new PluginStreamHandler(new FileInputStream(inPipeFD), new FileOutputStream(outPipeFD));
    71             PluginDebug.debug("Streams initialized");
    72         } catch (IOException ioe) {
    73             ioe.printStackTrace();
    74         }
     82        streamHandler = new PluginStreamHandler(new FileInputStream(inPipeFD), new FileOutputStream(outPipeFD));
     83        PluginDebug.debug("Streams initialized");
    7584        return streamHandler;
    7685    }
  • trunk/icedtea-web/plugin/icedteanp/x11/java/sun/applet/PluginMainBase.java

    r368 r431  
    4646
    4747    static boolean checkArgs(String args[]) {
    48         if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) {
    49             System.err.println("Invalid pipe names provided. Refusing to proceed.");
     48        if (args.length < 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) {
     49            OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Invalid pipe names provided. Refusing to proceed.");
    5050            return false;
     51        }
     52        DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched();
     53        if (JavaConsole.isEnabled()) {
     54            if ((args.length < 3) || !new File(args[2]).exists()) {
     55                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).");
     56            } else {
     57                JavaConsole.getConsole().createPluginReader(new File(args[2]));
     58            }
    5159        }
    5260        return true;
     
    6169            PluginDebug.debug("Streams initialized");
    6270        } catch (IOException ioe) {
    63             ioe.printStackTrace();
     71            OutputController.getLogger().log(OutputController.Level.ERROR_ALL,ioe);
    6472        }
    6573        return streamHandler;
Note: See TracChangeset for help on using the changeset viewer.