~ubuntu-branches/ubuntu/trusty/jsch/trusty-proposed

« back to all changes in this revision

Viewing changes to src/com/jcraft/jsch/ProxyHTTP.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2008-03-21 11:41:01 UTC
  • mfrom: (3.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080321114101-2g9w5l8ynwf6pbsq
Tags: 0.1.37-3
Add OSGi manifest patch. Thanks to Roberto Jimenoca. Closes: #471209.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2
2
/*
3
 
Copyright (c) 2002,2003,2004,2005,2006 ymnk, JCraft,Inc. All rights reserved.
 
3
Copyright (c) 2002-2008 ymnk, JCraft,Inc. All rights reserved.
4
4
 
5
5
Redistribution and use in source and binary forms, with or without
6
6
modification, are permitted provided that the following conditions are met:
36
36
  private static int DEFAULTPORT=80;
37
37
  private String proxy_host;
38
38
  private int proxy_port;
39
 
  private String host;
40
 
  private int port;
41
39
  private InputStream in;
42
40
  private OutputStream out;
43
41
  private Socket socket;
68
66
    this.passwd=passwd;
69
67
  }
70
68
  public void connect(SocketFactory socket_factory, String host, int port, int timeout) throws JSchException{
71
 
    this.host=host;
72
 
    this.port=port;
73
69
    try{
74
70
      if(socket_factory==null){
75
71
        socket=Util.createSocket(proxy_host, proxy_port, timeout);    
157
153
      try{ if(socket!=null)socket.close(); }
158
154
      catch(Exception eee){
159
155
      }
160
 
      throw new JSchException("ProxyHTTP: "+e.toString());
 
156
      String message="ProxyHTTP: "+e.toString();
 
157
      if(e instanceof Throwable)
 
158
        throw new JSchException(message, (Throwable)e);
 
159
      throw new JSchException(message);
161
160
    }
162
161
  }
163
162
  public InputStream getInputStream(){ return in; }