Changeset 32


Ignore:
Timestamp:
08/16/10 21:32:24 (14 years ago)
Author:
bowman
Message:

Fixed issues reported for 0.9.0 (see changelog.txt)

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/changelog.txt

    r31 r32  
    11Cardservproxy changelog:
    22------------------------
     3
     40.9.1 - RC0
     5- Fixed: Handling for unknown sid (0 or a dummy sid listed in dummy-services) was broken in 0.9.0.
     6- Fixed: Incoming requests for dummy sids should not retain the dummy when forwarded, now changed to 0.
     7- Changed: Two ecms (or dcw replies) with the same payload data but different dvb table ids (even/0x80 vs odd/0x81) are
     8  now considered identical by the proxy.
     9   
    310
    4110.9.0 - 2010-08-15 (see README.0.9.0.txt for conceptual changes and tips)
  • trunk/config/proxy-reference.html

    r28 r32  
    933933<div class='indent'>connection-manager/service-map/mapper/dummy-services</div><br />
    934934Some clients who are unable to known the real sid (i.e typically hardware solutions) send fixed dummy sids instead of 0. To make sure these aren't treated as real sids by the service mapping, list any such dummy sids here.<br />
    935 <strong>NOTE: </strong> The first sid listed here will also be used when forwarding unknown sid request to connectors, so if you want unknown forwards to keep the sid 0 - set 0 as the first entry in this list.<br />
    936 <br />
    937 Example:  <em class='italic'>&lt;dummy-services>101 1101&lt;/dummy-services></em> <br />
     935<strong>NOTE: </strong> The first sid listed here will also be used when forwarding unknown sid request to connectors, so if you want unknown forwards to keep the sid 0 - set 0 as the first entry in this list. If for some reason you absolutely want to retain the original dummy-services in the forwards too, set -1 as the first entry.<br />
     936<br />
     937Example:  <em class='italic'>&lt;dummy-services>0 101 1101&lt;/dummy-services></em> <br />
    938938</a>
    939939
  • trunk/src/com/bowman/cardserv/CamdNetMessage.java

    r1 r32  
    236236  }
    237237
     238  public void setCommandTag(int commandTag) {
     239    this.commandTag = commandTag;
     240  }
     241
    238242  public int getDataLength() {
    239243    return dataLength;
     
    519523
    520524  public int hashCode() {
    521     int result;
    522     result = commandTag;
    523     result = 29 * result + dataHash;
    524     return result;
     525    // int result;
     526    // result = commandTag;
     527    // result = 29 * result + dataHash;
     528    // return result;
     529    return dataHash;
    525530  }
    526531
  • trunk/src/com/bowman/cardserv/CardServProxy.java

    r24 r32  
    794794                  if(!conn.isPending(entry.msg) && conn.canDecode(entry.msg)) try {
    795795                    if(conn.sendEcmRequest(new CamdNetMessage(entry.msg), null)) {
    796                       if(entry.msg.getServiceId() != 0) logger.fine("Redundant forward to " + conn.getLabel() + " for service [" +
    797                           config.getServiceName(entry.msg) + "] ...");
     796                      if(!connManager.isServiceUnknown(entry.msg.getProfileName(), entry.msg.getServiceId()))
     797                        logger.fine("Redundant forward to " + conn.getLabel() + " for service [" + config.getServiceName(entry.msg) + "] ...");
    798798                      else logger.fine("Broadcasting " + entry.msg.hashCodeStr() + " with unknown service to " + conn.getLabel() + "...");
    799799                    }
  • trunk/src/com/bowman/cardserv/cws/AbstractCwsConnector.java

    r1 r32  
    547547    synchronized(this) {
    548548      if(!isConnected()) return false;
    549       seqNr = sendMessage(new CamdNetMessage(request)); // send copy
     549      CamdNetMessage req = new CamdNetMessage(request);
     550      if(connManager.getUnknownSid(req.getProfileName()) != -1) {
     551        if(connManager.isServiceUnknown(req.getProfileName(), req.getServiceId()))
     552          req.setServiceId(connManager.getUnknownSid(req.getProfileName())); // change outgoing sid for unknowns
     553      }
     554      seqNr = sendMessage(req); // send copy
    550555      if(seqNr != -1) {
    551556        if(sentMap.put(new Integer(seqNr), qe) != null) logger.severe("Overwrote existing pending seqNr: " + seqNr);
  • trunk/src/com/bowman/cardserv/cws/CwsServiceMapper.java

    r24 r32  
    55import com.bowman.cardserv.tv.TvService;
    66import com.bowman.cardserv.*;
     7import com.bowman.cardserv.session.CspSession;
    78
    89import java.io.*;
     
    289290      if(conn.isReady()) tmp.add(conn);
    290291    }
     292    for(Iterator iter = cm.getMultiConnectors(profile.getNetworkId(), profile.getCaId()).values().iterator(); iter.hasNext(); ) {
     293      conn = (CwsConnector)iter.next();
     294      if(conn.isReady()) tmp.add(conn);
     295    }
    291296    return tmp;
    292297  }
     
    374379        else logger.warning("Connector for unknown sid [" + id + "] requested.");
    375380      }
    376       if(id.getCustomId() > 0) serviceUnknown = true;
     381      serviceUnknown = true;
    377382    }
    378383
     
    495500    }
    496501
     502    if(secondary != null) {
     503      if(leastLoaded != null) {
     504        secondary.remove(leastLoaded);
     505        if(secondary.isEmpty()) secondary = null;
     506      }
     507    }
     508
    497509    return new ConnectorSelection(leastLoaded, secondary, unknown);
    498510  }
     
    572584          if(session != null) {
    573585            String s = "Service [" + config.getServiceName(msg) + "] no longer available on CWS: " + conn.getName() +
    574                 " Ecm source was: " + session;
     586                " - Ecm source was: " + session;
    575587            if(resetServices.contains(id)) logger.info(s);
    576588            else logger.warning(s);
     
    591603          } else {
    592604            if(session != null) {
     605              String prevFlags = (session instanceof CspSession)?null:session.getLastTransactionFlags();
    593606              String s = "Service [" + config.getServiceName(msg) + "] failed to decode on CWS: "  + conn.getName() +
    594                   " (two consecutive failures removes mapping). Ecm source was: " + session;
     607                  " (two consecutive failures removes mapping). Ecm source was: " + session +
     608                  (prevFlags==null?"":" [prev: " + prevFlags + "]");
    595609              if(resetServices.contains(id)) logger.info(s);
    596610              else logger.warning(s);
  • trunk/src/com/bowman/cardserv/cws/NewcamdCwsConnector.java

    r1 r32  
    394394
    395395  public synchronized int sendMessage(CamdNetMessage msg) {
    396     if(conn == null || !conn.isInitialized()) return -1;
    397     if(msg.isEcm() && msg.getServiceId() == 0) msg.setServiceId(connManager.getUnknownSid(profile.getName()));
     396    if(conn == null || !conn.isInitialized()) return -1;   
    398397    if(msg.isEmm()) emmCount++;
    399398    else if(msg.isKeepAlive()) keepAliveCount++;
  • trunk/src/com/bowman/cardserv/session/AbstractSession.java

    r20 r32  
    289289      logger.fine("Not interested in reply: " + ecmReply);
    290290      return -1;     
    291     } else return sendEcmReplyNative(((EcmTransaction)transactions.get(ecmRequest)).getRequest(), ecmReply);
     291    } else {
     292      ecmRequest = ((EcmTransaction)transactions.get(ecmRequest)).getRequest(); // make sure original instance is used
     293      if(ecmRequest.getCommandTag() != ecmReply.getCommandTag()) { // ensure table id is same as it was in request
     294        logger.fine("Table-id mismatch, response (from " + ecmReply.getConnectorName() + ") had table-id " +
     295            Integer.toHexString(ecmReply.getCommandTag()) + " but request had " + Integer.toHexString(ecmRequest.getCommandTag()) +
     296            " (from user '" + user + "' - " + clientId + ")");
     297        ecmReply.setCommandTag(ecmRequest.getCommandTag());
     298      }
     299      return sendEcmReplyNative(ecmRequest, ecmReply);
     300    }
    292301  }
    293302
Note: See TracChangeset for help on using the changeset viewer.