Changeset 2720
- Timestamp:
- 07/12/10 17:33:24 (14 years ago)
- Location:
- branches/threaded
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/threaded/module-camd35.c
r2715 r2720 390 390 client[cs_idx].udp_fd, ptxt); 391 391 392 if (client[cs_idx].is_udp) client[cs_idx].pfd=client[cs_idx].udp_fd; 392 if (client[cs_idx].is_udp) { 393 client[cs_idx].pfd=client[cs_idx].udp_fd; 394 395 //TODO: dirty udp hotfix 396 struct addrinfo hints, *res = NULL; 397 398 memset(&hints, 0, sizeof(hints)); 399 hints.ai_socktype = SOCK_STREAM; 400 hints.ai_family = client[cs_idx].udp_sa.sin_family; 401 hints.ai_protocol = IPPROTO_TCP; 402 403 if (getaddrinfo(reader[client[cs_idx].ridx].device, NULL, &hints, &res) == 0) { 404 client[cs_idx].udp_sa.sin_addr.s_addr = ((struct sockaddr_in *)(res->ai_addr))->sin_addr.s_addr; 405 client[cs_idx].ip = cs_inet_order(client[cs_idx].udp_sa.sin_addr.s_addr); 406 } else { 407 cs_log("can't resolve %s", reader[client[cs_idx].ridx].device); 408 } 409 if (res) freeaddrinfo(res); 410 } 393 411 394 412 return(0); -
branches/threaded/module-dvbapi.c
r2715 r2720 803 803 return -1; 804 804 } 805 805 806 if (cfg->dvbapi_boxtype == BOXTYPE_IPBOX_PMT) { 807 ca_mask = demux_id + 1; 808 demux_index = demux_id; 809 } 810 806 811 cs_ddump(buffer, length, "capmt:"); 807 812 … … 820 825 } 821 826 } 827 822 828 cs_debug("id: %d\tdemux_index: %d\tca_index: %d\tprogram_info_length: %d", demux_id, demux[demux_id].demux_index, demux[demux_id].cadev_index, program_info_length); 823 824 if (cfg->dvbapi_boxtype == BOXTYPE_IPBOX_PMT) {825 ca_mask = demux_id + 1;826 demux_index = demux_id;827 }828 829 829 830 if (program_info_length > 0 && program_info_length < length) -
branches/threaded/oscam.c
r2715 r2720 1223 1223 1224 1224 /* 1225 * Check if a fd is ready for a write (fir pipes). 1225 * Check if a fd is ready for a write (for pipes). 1226 * retry twice in case of an error (so it could take 3 x timeout_ms in case of a hard error to return) 1226 1227 */ 1228 int pipe_WaitToWrite (int out_fd, unsigned timeout_ms) 1229 { 1230 int i; 1231 fd_set wfds; 1232 fd_set ewfds; 1233 struct timeval tv; 1234 1235 FD_ZERO(&wfds); 1236 FD_SET(out_fd, &wfds); 1237 1238 FD_ZERO(&ewfds); 1239 FD_SET(out_fd, &ewfds); 1240 1241 tv.tv_sec = timeout_ms/1000L; 1242 tv.tv_usec = (timeout_ms % 1000) * 1000L; 1243 for(i=0;i<3;i++) { 1244 if (select(out_fd + 1, NULL, &wfds, &ewfds, &tv) == -1) { 1245 cs_debug("pipe_WaitToWrite() error on fd=%d, select_ret=-1, errno=%d", out_fd, errno); 1246 continue; 1247 } 1248 if (FD_ISSET(out_fd, &ewfds)) { 1249 cs_debug("pipe_WaitToWrite() error on fd=%d, fd is in ewfds, errno=%d", out_fd, errno); 1250 continue; 1251 } 1252 break; 1253 } 1254 1255 return (FD_ISSET(out_fd,&wfds)) ? 1 : 0; 1256 } 1257 1258 /* 1227 1259 int pipe_WaitToWrite (int out_fd, unsigned timeout_ms) 1228 1260 { … … 1252 1284 return (FD_ISSET(out_fd,&wfds)) ? 1 : 0; 1253 1285 } 1286 */ 1254 1287 1255 1288 /* … … 1261 1294 // check is write to pipe ready if fails check 1262 1295 // one more time and give up if fails 1263 if (!pipe_WaitToWrite(fd, 100))1264 1296 if (!pipe_WaitToWrite(fd, 100)) 1265 1297 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.