Changeset 3633 for trunk/module-newcamd.c
- Timestamp:
- 10/19/10 19:34:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-newcamd.c
r3627 r3633 86 86 struct s_client *cl = cur_client(); 87 87 88 head_size = (cl-> reader->ncd_proto==NCD_524)?8:12;88 head_size = (cl->ncd_proto==NCD_524)?8:12; 89 89 90 90 if (len < 3 || len + head_size > CWS_NETMSGSIZE || handle < 0) … … 109 109 else 110 110 netbuf[2] = netbuf[3] = 0; 111 memset(netbuf+4, 0, (cl-> reader->ncd_proto==NCD_524)?4:8);111 memset(netbuf+4, 0, (cl->ncd_proto==NCD_524)?4:8); 112 112 if( sid ) { 113 netbuf[(cl-> reader->ncd_proto==NCD_524)?6:4] = (uchar)(sid>>8); //sid114 netbuf[(cl-> reader->ncd_proto==NCD_524)?7:5] = (uchar)(sid);113 netbuf[(cl->ncd_proto==NCD_524)?6:4] = (uchar)(sid>>8); //sid 114 netbuf[(cl->ncd_proto==NCD_524)?7:5] = (uchar)(sid); 115 115 } 116 116 //if ((!ncd_proto==NCD_524) && (buffer[0] >= 0xd1) && (buffer[0]<= 0xd8)) { // extended proto for mg … … 182 182 msgid = (netbuf[2] << 8) | netbuf[3]; 183 183 184 if( cl-> reader->ncd_proto==NCD_AUTO ) {184 if( cl->ncd_proto==NCD_AUTO ) { 185 185 // auto detect 186 186 int l5 = (((netbuf[13] & 0x0f) << 8) | netbuf[14]) + 3; … … 188 188 189 189 if( (l5<=len-12) && ((netbuf[12]&0xF0)==0xE0 || (netbuf[12]&0xF0)==0x80) ) 190 cl-> reader->ncd_proto = NCD_525;190 cl->ncd_proto = NCD_525; 191 191 else if( (l4<=len-8) && ((netbuf[8]&0xF0)==0xE0 || (netbuf[9]&0xF0)==0x80) ) 192 cl-> reader->ncd_proto = NCD_524;192 cl->ncd_proto = NCD_524; 193 193 else { 194 194 cs_debug("nmr: 4 return -1"); … … 196 196 } 197 197 198 cs_debug("nmr: autodetect: newcamd52%d used", (cl-> reader->ncd_proto==NCD_525)?5:4);198 cs_debug("nmr: autodetect: newcamd52%d used", (cl->ncd_proto==NCD_525)?5:4); 199 199 } 200 200 201 ncd_off=(cl-> reader->ncd_proto==NCD_525)?4:0;201 ncd_off=(cl->ncd_proto==NCD_525)?4:0; 202 202 203 203 returnLen = (((netbuf[9+ncd_off] & 0x0f) << 8) | netbuf[10+ncd_off]) + 3; … … 232 232 { 233 233 case COMMTYPE_SERVER: 234 buffer[0]=(cl-> reader->ncd_proto==NCD_525)?netbuf[4]:netbuf[6]; // sid235 buffer[1]=(cl-> reader->ncd_proto==NCD_525)?netbuf[5]:netbuf[7];234 buffer[0]=(cl->ncd_proto==NCD_525)?netbuf[4]:netbuf[6]; // sid 235 buffer[1]=(cl->ncd_proto==NCD_525)?netbuf[5]:netbuf[7]; 236 236 break; 237 237 case COMMTYPE_CLIENT: … … 700 700 // check for non ready reader and reject client 701 701 struct s_reader *rdr; 702 for (rdr=first_reader; rdr ; rdr=rdr->next) 703 if(rdr->caid[0]==cfg->ncd_ptab.ports[cl->port_idx].ftab.filts[0].caid) 702 for (rdr=first_reader; rdr ; rdr=rdr->next) { 703 if(rdr->caid[0]==cfg->ncd_ptab.ports[cl->port_idx].ftab.filts[0].caid) { 704 if(rdr->card_status == CARD_NEED_INIT) { 705 cs_log("init for reader %s not finished -> reject client", rdr->label); 706 ok = 0; 707 } 704 708 break; 705 706 if(rdr->card_status == CARD_NEED_INIT) { 707 cs_log("init for reader %s not finished -> reject client", rdr->label); 708 ok = 0; 709 } 709 710 } 710 711 … … 1234 1235 client->udp_sa.sin_port = htons((u_short)client->reader->r_port); 1235 1236 1237 client->ncd_proto=client->reader->ncd_proto; 1238 1236 1239 cs_log("proxy %s:%d newcamd52%d (fd=%d%s)", 1237 1240 client->reader->device, client->reader->r_port,
Note:
See TracChangeset
for help on using the changeset viewer.