Changeset 3614 for trunk/module-radegast.c
- Timestamp:
- 10/18/10 15:32:35 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-radegast.c
r3483 r3614 37 37 cs_debug("radegast: recv chk - %s", cs_hexdump(0, dcw, 16)); 38 38 *rc = 1; 39 return( reader[client->ridx].msg_idx);39 return(client->reader->msg_idx); 40 40 } 41 41 … … 209 209 ecmbuf[4] = er->caid >> 8; 210 210 211 reader[client->ridx].msg_idx = er->idx;211 client->reader->msg_idx = er->idx; 212 212 n = send(client->pfd, ecmbuf, er->l + 30, 0); 213 213 … … 228 228 229 229 cur_client()->pfd=0; 230 if ( reader[cur_client()->ridx].r_port<=0)231 { 232 cs_log("radegast: invalid port %d for server %s", reader[cur_client()->ridx].r_port, reader[cur_client()->ridx].device);230 if (cur_client()->reader->r_port<=0) 231 { 232 cs_log("radegast: invalid port %d for server %s", cur_client()->reader->r_port, cur_client()->reader->device); 233 233 return(1); 234 234 } … … 247 247 #endif 248 248 loc_sa.sin_addr.s_addr = INADDR_ANY; 249 loc_sa.sin_port = htons( reader[cur_client()->ridx].l_port);249 loc_sa.sin_port = htons(cur_client()->reader->l_port); 250 250 251 251 if ((cur_client()->udp_fd=socket(PF_INET, SOCK_STREAM, p_proto))<0) … … 260 260 (void *)&cfg->netprio, sizeof(ulong)); 261 261 #endif 262 if (! reader[cur_client()->ridx].tcp_ito) {263 ulong keep_alive = reader[cur_client()->ridx].tcp_ito?1:0;262 if (!cur_client()->reader->tcp_ito) { 263 ulong keep_alive = cur_client()->reader->tcp_ito?1:0; 264 264 setsockopt(cur_client()->udp_fd, SOL_SOCKET, SO_KEEPALIVE, 265 265 (void *)&keep_alive, sizeof(ulong)); … … 268 268 memset((char *)&cur_client()->udp_sa,0,sizeof(cur_client()->udp_sa)); 269 269 cur_client()->udp_sa.sin_family = AF_INET; 270 cur_client()->udp_sa.sin_port = htons((u_short) reader[cur_client()->ridx].r_port);270 cur_client()->udp_sa.sin_port = htons((u_short)cur_client()->reader->r_port); 271 271 272 272 cs_log("radegast: proxy %s:%d (fd=%d)", 273 reader[cur_client()->ridx].device, reader[cur_client()->ridx].r_port, cur_client()->udp_fd);273 cur_client()->reader->device, cur_client()->reader->r_port, cur_client()->udp_fd); 274 274 275 275 handle = network_tcp_connection_open(); 276 276 if(handle < 0) return -1; 277 277 278 reader[cur_client()->ridx].tcp_connected = 2;279 reader[cur_client()->ridx].card_status = CARD_INSERTED;280 reader[cur_client()->ridx].last_g = reader[cur_client()->ridx].last_s = time((time_t *)0);281 282 cs_debug("radegast: last_s=%d, last_g=%d", reader[cur_client()->ridx].last_s, reader[cur_client()->ridx].last_g);278 cur_client()->reader->tcp_connected = 2; 279 cur_client()->reader->card_status = CARD_INSERTED; 280 cur_client()->reader->last_g = cur_client()->reader->last_s = time((time_t *)0); 281 282 cs_debug("radegast: last_s=%d, last_g=%d", cur_client()->reader->last_s, cur_client()->reader->last_g); 283 283 284 284 cur_client()->pfd=cur_client()->udp_fd;
Note:
See TracChangeset
for help on using the changeset viewer.