Changeset 15282 for trunk/FACT++/dim/src/webDid
- Timestamp:
- 04/08/13 15:07:07 (12 years ago)
- Location:
- trunk/FACT++/dim/src/webDid
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/webDid/webDid.c
r14937 r15282 15 15 int match; 16 16 int busy; 17 int isSMI; 17 18 }SERVER; 18 19 … … 23 24 int match; 24 25 int busy; 26 int hasSMI; 25 27 }NODE; 26 28 NODE *Node_head = (NODE *)0; … … 319 321 buffer->services[j].n_clients = vtohl( 320 322 buffer->services[j].n_clients); 321 if( strlen(sname) == MAX_TASK_NAME-4-1)323 if((int)strlen(sname) == MAX_TASK_NAME-4-1) 322 324 { 323 325 strcpy(str,buffer->services[j].name); … … 337 339 nodep = (NODE *)malloc(sizeof(NODE)); 338 340 strcpy(nodep->name,buffer->server.node); 341 nodep->hasSMI = 0; 339 342 nodep->server_head = (SERVER *)malloc(sizeof(SERVER)); 340 343 sll_init((SLL *)nodep->server_head); … … 352 355 servp->server.n_services = 0; 353 356 servp->service_ptr = 0; 357 servp->isSMI = 0; 358 if(strstr(sname,"_SMI")) 359 { 360 servp->isSMI = 1; 361 nodep->hasSMI = 1; 362 } 354 363 sll_insert_queue((SLL *)nodep->server_head,(SLL *)servp); 355 364 } … … 373 382 if(n_services != -1) 374 383 { 375 service_size = n_services* sizeof(DNS_SERVICE_INFO);376 servp->service_ptr = (DNS_SERVICE_INFO *)malloc( service_size);377 memcpy(servp->service_ptr, buffer->services, service_size);384 service_size = n_services*(int)sizeof(DNS_SERVICE_INFO); 385 servp->service_ptr = (DNS_SERVICE_INFO *)malloc((size_t)service_size); 386 memcpy(servp->service_ptr, buffer->services, (size_t)service_size); 378 387 N_services += n_services; 379 388 } … … 391 400 servp->server.n_services = 0; 392 401 servp->busy = -1; 402 servp->isSMI = 0; 393 403 } 394 404 } … … 464 474 if(!rpc_flag) 465 475 { 466 ptr += strlen(str);476 ptr += (int)strlen(str); 467 477 ptr1 = strchr(ptr,'|'); 468 478 } 469 479 else if(rpc_flag == 1) 470 480 { 471 ptr += strlen(str);481 ptr += (int)strlen(str); 472 482 ptr1 = strchr(ptr,','); 473 483 } 474 484 else 475 485 { 476 ptr += strlen(str);486 ptr += (int)strlen(str); 477 487 ptr = strchr(ptr,','); 478 488 ptr++; … … 512 522 if(!rpc_flag) 513 523 { 514 ptr += strlen(str);524 ptr += (int)strlen(str); 515 525 ptr1 = strchr(ptr,'|'); 516 526 } 517 527 else if(rpc_flag == 1) 518 528 { 519 ptr += strlen(str);529 ptr += (int)strlen(str); 520 530 ptr1 = strchr(ptr,','); 521 531 } 522 532 else 523 533 { 524 ptr += strlen(str);534 ptr += (int)strlen(str); 525 535 ptr = strchr(ptr,','); 526 536 ptr++; 527 537 ptr1 = strchr(ptr,'|'); 528 538 } 529 strncpy(format,ptr,( int)(ptr1 - ptr));539 strncpy(format,ptr,(size_t)(ptr1 - ptr)); 530 540 format[(int)(ptr1-ptr)] = '\0'; 531 541 } … … 678 688 servicep->n_browsers = 0; 679 689 sll_insert_queue((SLL *)Curr_service_head,(SLL *)servicep); 680 servicep->sid = dic_info_service_stamped( service, MONITORED, subscribe, 0, 0,690 servicep->sid = (int)dic_info_service_stamped( service, MONITORED, subscribe, 0, 0, 681 691 recv_service_info, servicep, &no_link_int, 4); 682 692 } … … 792 802 if(servicep->buffer_size) 793 803 free(servicep->buffer); 794 servicep->buffer = malloc( *size);804 servicep->buffer = malloc((size_t)*size); 795 805 servicep->buffer_size = *size; 796 806 } 797 memcpy(servicep->buffer, (char *)buffer, *size);807 memcpy(servicep->buffer, (char *)buffer, (size_t)*size); 798 808 servicep->size = *size; 799 809 if (servicep->buffer_str_size < (1024 + (*size)*16)) … … 801 811 if(servicep->buffer_str_size) 802 812 free(servicep->buffer_str); 803 servicep->buffer_str = malloc( 1024 + (*size)*16);813 servicep->buffer_str = malloc((size_t)(1024 + (*size)*16)); 804 814 servicep->buffer_str_size = 1024 + (*size)*16; 805 815 } … … 855 865 sprintf(ptr,".%03d",mili); 856 866 strcat(timestr, aux); 857 timestr[ strlen(timestr)-1] = '\0';867 timestr[(int)strlen(timestr)-1] = '\0'; 858 868 859 869 sprintf(str," Timestamp: %s         Quality: %d    Size: %s<br /><br />", … … 906 916 strcat(Service_content_str," L"); 907 917 if(!num) 908 size = ssize/ sizeof(int);918 size = ssize/(int)sizeof(int); 909 919 else 910 920 size = num; 911 psize = size * sizeof(int);921 psize = size * (int)sizeof(int); 912 922 print_service_standard(ptr, size); 913 923 break; … … 916 926 strcat(Service_content_str," I"); 917 927 if(!num) 918 size = ssize/ sizeof(int);928 size = ssize/(int)sizeof(int); 919 929 else 920 930 size = num; 921 psize = size * sizeof(int);931 psize = size * (int)sizeof(int); 922 932 print_service_standard(ptr, size); 923 933 break; … … 926 936 strcat(Service_content_str," S"); 927 937 if(!num) 928 size = ssize/ sizeof(short);938 size = ssize/(int)sizeof(short); 929 939 else 930 940 size = num; 931 psize = size * sizeof(short);941 psize = size * (int)sizeof(short); 932 942 print_service_short(ptr, size); 933 943 break; … … 936 946 strcat(Service_content_str," F"); 937 947 if(!num) 938 size = ssize/ sizeof(float);948 size = ssize/(int)sizeof(float); 939 949 else 940 950 size = num; 941 psize = size * sizeof(float);951 psize = size * (int)sizeof(float); 942 952 print_service_float(ptr, size); 943 953 break; … … 946 956 strcat(Service_content_str," D"); 947 957 if(!num) 948 size = ssize/ sizeof(double);958 size = ssize/(int)sizeof(double); 949 959 else 950 960 size = num; 951 psize = size * sizeof(double);961 psize = size * (int)sizeof(double); 952 962 print_service_double(ptr, size); 953 963 break; … … 956 966 strcat(Service_content_str," X"); 957 967 if(!num) 958 size = ssize/ sizeof(longlong);968 size = ssize/(int)sizeof(longlong); 959 969 else 960 970 size = num; 961 psize = size * sizeof(longlong);971 psize = size * (int)sizeof(longlong); 962 972 print_service_standard(ptr, size*2); 963 973 break; … … 999 1009 1000 1010 ptr = Service_content_str; 1001 ptr += strlen(Service_content_str);1011 ptr += (int)strlen(Service_content_str); 1002 1012 for( i = 0; i < size; i++) 1003 1013 { … … 1030 1040 } 1031 1041 strcpy(ptr, tmp); 1032 ptr += strlen(tmp);1042 ptr += (int)strlen(tmp); 1033 1043 } 1034 1044 strcpy(tmp,"<br />"); … … 1043 1053 1044 1054 ptr = Service_content_str; 1045 ptr += strlen(Service_content_str);1055 ptr += (int)strlen(Service_content_str); 1046 1056 for( i = 0; i < size; i++) 1047 1057 { … … 1068 1078 if(j == 0) 1069 1079 strcat(tmp,"        D: "); 1070 sprintf_html(str, 12, last[j]);1080 sprintf_html(str, 12, (int)last[j]); 1071 1081 strcat(tmp,str); 1072 1082 } … … 1074 1084 } 1075 1085 strcpy(ptr, tmp); 1076 ptr += strlen(tmp);1086 ptr += (int)strlen(tmp); 1077 1087 } 1078 1088 strcpy(tmp,"<br />"); … … 1087 1097 1088 1098 ptr = Service_content_str; 1089 ptr += strlen(Service_content_str);1099 ptr += (int)strlen(Service_content_str); 1090 1100 for( i = 0; i < size; i++) 1091 1101 { … … 1118 1128 } 1119 1129 strcpy(ptr, tmp); 1120 ptr += strlen(tmp);1130 ptr += (int)strlen(tmp); 1121 1131 } 1122 1132 strcpy(tmp,"<br />"); … … 1131 1141 asc = (char *)buff; 1132 1142 ptr = Service_content_str; 1133 ptr += strlen(Service_content_str);1143 ptr += (int)strlen(Service_content_str); 1134 1144 for( i = 0; i < size; i++) 1135 1145 { … … 1150 1160 */ 1151 1161 strcat(tmp," "); 1152 strcat(tmp,&str[ strlen(str)-2]);1162 strcat(tmp,&str[(int)strlen(str)-2]); 1153 1163 /* 1154 1164 if(i%4 == 3) … … 1180 1190 } 1181 1191 strcpy(ptr, tmp); 1182 ptr += strlen(tmp);1192 ptr += (int)strlen(tmp); 1183 1193 } 1184 1194 strcpy(tmp,"<br />"); … … 1192 1202 1193 1203 ptr = Service_content_str; 1194 ptr += strlen(Service_content_str);1204 ptr += (int)strlen(Service_content_str); 1195 1205 for( i = 0; i < size; i++) 1196 1206 { … … 1212 1222 } 1213 1223 strcpy(ptr, tmp); 1214 ptr += strlen(tmp);1224 ptr += (int)strlen(tmp); 1215 1225 } 1216 1226 strcpy(tmp,"<br />"); 1217 1227 strcpy(ptr, tmp); 1218 ptr += strlen(tmp);1228 ptr += (int)strlen(tmp); 1219 1229 } 1220 1230 … … 1225 1235 1226 1236 ptr = Service_content_str; 1227 ptr += strlen(Service_content_str);1237 ptr += (int)strlen(Service_content_str); 1228 1238 for( i = 0; i < size; i++) 1229 1239 { … … 1245 1255 } 1246 1256 strcpy(ptr, tmp); 1247 ptr += strlen(tmp);1257 ptr += (int)strlen(tmp); 1248 1258 } 1249 1259 strcpy(tmp,"<br />"); 1250 1260 strcpy(ptr, tmp); 1251 ptr += strlen(tmp);1261 ptr += (int)strlen(tmp); 1252 1262 } 1253 1263 … … 1257 1267 1258 1268 strcat(ptr,"{\n"); 1259 ptro = ptr + strlen(ptr);1269 ptro = ptr + (int)strlen(ptr); 1260 1270 return ptro; 1261 1271 } … … 1266 1276 1267 1277 strcat(ptr,"}\n"); 1268 ptro = ptr + strlen(ptr);1278 ptro = ptr + (int)strlen(ptr); 1269 1279 return ptro; 1270 1280 } … … 1275 1285 1276 1286 sprintf(ptr,"%s: [\n", node); 1277 ptro = ptr + strlen(ptr);1287 ptro = ptr + (int)strlen(ptr); 1278 1288 return ptro; 1279 1289 } … … 1284 1294 1285 1295 strcat(ptr,"]\n"); 1286 ptro = ptr + strlen(ptr);1296 ptro = ptr + (int)strlen(ptr); 1287 1297 return ptro; 1288 1298 } … … 1296 1306 else 1297 1307 sprintf(ptr,"{ %s", child); 1298 ptro = ptr + strlen(ptr);1308 ptro = ptr + (int)strlen(ptr); 1299 1309 return ptro; 1300 1310 } … … 1308 1318 else 1309 1319 strcat(ptr," }\n"); 1310 ptro = ptr + strlen(ptr);1320 ptro = ptr + (int)strlen(ptr); 1311 1321 return ptro; 1312 1322 } … … 1352 1362 for(i = 0; i < ((int)strlen(label) + 1); i++) 1353 1363 { 1354 label[i] = tolower(label[i]);1364 label[i] = (char)tolower((int)label[i]); 1355 1365 if(label[i] == '.') 1356 1366 { … … 1384 1394 if(JSONBufferSize == 0) 1385 1395 { 1386 JSONBuffer = malloc( N_nodes*128+N_servers*128);1396 JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1387 1397 } 1388 1398 else if (JSONBufferSize < N_nodes*128+N_servers*128) 1389 1399 { 1390 1400 free(JSONBuffer); 1391 JSONBuffer = malloc( N_nodes*128+N_servers*128);1401 JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1392 1402 } 1393 1403 ptr = JSONBuffer; … … 1397 1407 if(browserp->JSONBufferSize == 0) 1398 1408 { 1399 browserp->JSONBuffer = malloc( N_nodes*128+N_servers*128);1409 browserp->JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1400 1410 } 1401 1411 else if (browserp->JSONBufferSize < N_nodes*128+N_servers*128) 1402 1412 { 1403 1413 free(browserp->JSONBuffer); 1404 browserp->JSONBuffer = malloc( N_nodes*128+N_servers*128);1414 browserp->JSONBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1405 1415 } 1406 1416 ptr = browserp->JSONBuffer; … … 1556 1566 if(JSONServicesSize == 0) 1557 1567 { 1558 JSONServices = malloc( n_services*256);1568 JSONServices = malloc((size_t)(n_services*256)); 1559 1569 } 1560 1570 else if (JSONServicesSize < n_services*256) 1561 1571 { 1562 1572 free(JSONServices); 1563 JSONServices = malloc( n_services*256);1573 JSONServices = malloc((size_t)(n_services*256)); 1564 1574 } 1565 1575 if(browserp) … … 1704 1714 if(last_size) 1705 1715 free(last_buffer); 1706 last_buffer = malloc( full_size);1716 last_buffer = malloc((size_t)full_size); 1707 1717 last_size = full_size; 1708 1718 } 1709 memset(last_buffer, 0, last_size);1719 memset(last_buffer, 0, (size_t)last_size); 1710 1720 buffer_ptr = last_buffer; 1711 1721 ptr = format; … … 1864 1874 strp++; 1865 1875 } 1866 num = strlen(strp)+1;1867 strncpy((char *)ptr,strp, num);1876 num = (int)strlen(strp)+1; 1877 strncpy((char *)ptr,strp,(size_t)num); 1868 1878 if( (ptr1 = (char *)strchr((char *)ptr,'\"')) ) 1869 1879 { -
trunk/FACT++/dim/src/webDid/webServer.c
r14937 r15282 68 68 (void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n", 69 69 date_buffer, (int)strlen(logbuffer), "text/html"); 70 (void)web_write(conn_id,snd_buffer, strlen(snd_buffer));71 (void)web_write(conn_id,logbuffer, strlen(logbuffer));70 (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer)); 71 (void)web_write(conn_id,logbuffer,(int)strlen(logbuffer)); 72 72 break; 73 73 case LOG: (void)printf("INFO: %s:%s:%d\n",s1, s2,conn_id); … … 98 98 if((ptr = strstr(buffer, parptr))) 99 99 { 100 ptrs[i] = ptr+ strlen(parptr);100 ptrs[i] = ptr+(int)strlen(parptr); 101 101 found++; 102 102 } … … 206 206 int code; 207 207 208 buffer_size = strlen(buffer) + 1;208 buffer_size = (int)strlen(buffer) + 1; 209 209 if(buffer_size > conv_buffer_size ) 210 210 { 211 211 if(conv_buffer_size) 212 212 free(conv_buffer); 213 conv_buffer = malloc( buffer_size);213 conv_buffer = malloc((size_t)buffer_size); 214 214 conv_buffer_size = buffer_size; 215 215 } … … 333 333 (void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n", 334 334 date_buffer, (int)strlen(ptr), datatype); 335 (void)web_write(conn_id,snd_buffer, strlen(snd_buffer));335 (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer)); 336 336 if(WebDID_Debug) 337 337 printf("SENDING DATA to conn %d:\n%s\n",conn_id, snd_buffer); 338 (void)web_write(conn_id,ptr,strlen(ptr)); 338 (void)web_write(conn_id,ptr,(int)strlen(ptr)); 339 if(WebDID_Debug == 2) 340 printf("SENDING DATA to conn %d:\n%s\n",conn_id, ptr); 341 } 342 343 344 void sendSmiData(int conn_id, char *buffer, int type) 345 { 346 static char date_buffer[128]; 347 static char snd_buffer[BUFSIZE+1]; /* static so zero filled */ 348 static char snd_data_buffer[BUFSIZE+1]; /* static so zero filled */ 349 char *ptr = 0; 350 char node[128], server[256], service[256]; 351 int pid, ret, req, browser, force; 352 extern char *update_services(); 353 extern char *update_service_data(); 354 extern char *getJSONHeader(); 355 extern char *getJSONBuffer(); 356 char datatype[128]; 357 char *conv_buffer; 358 359 conv_buffer = buffer; 360 strcpy(datatype,"application/json"); 361 if(type == 0) 362 { 363 ptr = getJSONHeader(); 364 } 365 else if(type == 1) 366 { 367 ret = getNodeParameters(conv_buffer, node, &browser); 368 ptr = getJSONBuffer(node, browser); 369 } 370 else if(type == 2) 371 { 372 ret = getServerParameters(conv_buffer, node, server, &pid, &browser); 373 if(!ret) 374 { 375 strcpy(snd_data_buffer,"{}"); 376 ptr = snd_data_buffer; 377 } 378 else 379 { 380 ptr = update_services(node, server, pid, browser); 381 } 382 } 383 else if(type == 3) 384 { 385 ret = getServiceParameters(conv_buffer, service, &req, &browser, &force); 386 if(!ret) 387 { 388 strcpy(snd_data_buffer,"{}"); 389 ptr = snd_data_buffer; 390 } 391 else 392 { 393 update_service_data(service, conn_id, 0, req, browser, force); 394 return; 395 } 396 } 397 else if(type == 4) 398 { 399 ptr = conv_buffer; 400 if(WebDID_Debug) 401 printf("%s\n",ptr); 402 strcpy(datatype,"text/html"); 403 } 404 else if(type == 5) 405 { 406 ret = getServiceParameters(conv_buffer, service, &req, &browser, &force); 407 if(!ret) 408 { 409 strcpy(snd_data_buffer,"{}"); 410 ptr = snd_data_buffer; 411 } 412 else 413 { 414 check_browser_changes(service, conn_id, 0, req, browser, force); 415 return; 416 } 417 } 418 else if(type == 6) 419 { 420 ret = getServiceParameters(conv_buffer, service, &req, &browser, &force); 421 if(!ret) 422 { 423 strcpy(snd_data_buffer,"{}"); 424 ptr = snd_data_buffer; 425 } 426 else 427 { 428 find_services(service, conn_id, browser, force); 429 if(force == -1) 430 strcpy(snd_data_buffer,""); 431 else 432 strcpy(snd_data_buffer,"load"); 433 ptr = snd_data_buffer; 434 } 435 } 436 getTime(date_buffer); 437 (void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n", 438 date_buffer, (int)strlen(ptr), datatype); 439 (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer)); 440 if(WebDID_Debug) 441 printf("SENDING DATA to conn %d:\n%s\n",conn_id, snd_buffer); 442 (void)web_write(conn_id,ptr,(int)strlen(ptr)); 339 443 if(WebDID_Debug == 2) 340 444 printf("SENDING DATA to conn %d:\n%s\n",conn_id, ptr); … … 356 460 else buffer[0]=0; 357 461 462 if(WebDID_Debug) 463 printf("Got %s\n", buffer); 358 464 if( strncmp(buffer,"GET ",4) && strncmp(buffer,"get ",4) ) 359 465 { … … 371 477 } 372 478 373 for(j=0;j<i-1;j++) /* check for illegal parent directory use .. */ 479 if(WebDID_Debug) 480 printf("Got 1 %s\n", buffer); 481 for(j=0;j<i-1;j++) /* check for illegal parent directory use .. */ 374 482 { 375 483 if(buffer[j] == '.' && buffer[j+1] == '.') … … 379 487 } 380 488 } 381 if( !strncmp(&buffer[0],"GET /\0",6) || !strncmp(&buffer[0],"get /\0",6) ) 489 if((int)strlen(buffer) == 5) 490 { 491 if( !strncmp(&buffer[0],"GET /",5) || !strncmp(&buffer[0],"get /",5) ) 382 492 /* convert no filename to index file */ 383 493 (void)strcpy(buffer,"GET /index.html"); 384 494 } 495 if((int)strlen(buffer) == 8) 496 { 497 if( !strncmp(&buffer[0],"GET /smi",8) || !strncmp(&buffer[0],"get /smi",8) ) 498 /* convert no filename to index file */ 499 (void)strcpy(buffer,"GET /smi/index.html"); 500 } 385 501 /* work out the file type and check we support it */ 386 buflen= strlen(buffer);502 buflen=(int)strlen(buffer); 387 503 fstr = (char *)0; 388 504 for(i=0;extensions[i].ext != 0;i++) 389 505 { 390 len = strlen(extensions[i].ext);391 if( !strncmp(&buffer[buflen-len], extensions[i].ext, len))506 len = (int)strlen(extensions[i].ext); 507 if( !strncmp(&buffer[buflen-len], extensions[i].ext, (size_t)len)) 392 508 { 393 509 fstr =extensions[i].filetype; … … 397 513 /* 398 514 (void)sprintf(snd_buffer,"HTTP/1.1 100 Continue\r\n\r\n"); 399 (void)web_write(conn_id,snd_buffer, strlen(snd_buffer));515 (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer)); 400 516 printf("SENDING to conn %d:\n%s\n",conn_id, snd_buffer); 401 517 */ … … 432 548 { 433 549 sendData(conn_id, &buffer[5], 6); 550 return; 551 } 552 else if(!strncmp(&buffer[5],"smiObjects",11)) 553 { 554 sendSmiData(conn_id, &buffer[5], 2); 434 555 return; 435 556 } … … 441 562 *ptr = '\0'; 442 563 } 443 buflen= strlen(buffer);564 buflen=(int)strlen(buffer); 444 565 for(i=0;extensions[i].ext != 0;i++) 445 566 { 446 len = strlen(extensions[i].ext);567 len = (int)strlen(extensions[i].ext); 447 568 if( !strncmp(&buffer[buflen-len], extensions[i].ext, len)) 448 569 { … … 476 597 477 598 flen = 0; 478 while ( (ret = read(file_fd, snd_buffer, BUFSIZE)) > 0 )599 while ( (ret = (int)read(file_fd, snd_buffer, BUFSIZE)) > 0 ) 479 600 { 480 601 flen += ret; … … 491 612 (void)sprintf(snd_buffer,"HTTP/1.1 200 OK\r\nDate: %s\r\nServer: DID/19.7\r\nContent-Length: %d\r\nContent-Type: %s\r\nConnection: close\r\n\r\n", 492 613 date_buffer, flen, fstr); 493 (void)web_write(conn_id,snd_buffer, strlen(snd_buffer));614 (void)web_write(conn_id,snd_buffer,(int)strlen(snd_buffer)); 494 615 if(WebDID_Debug) 495 616 printf("SENDING to conn %d:\n%s\n",conn_id, snd_buffer); 496 617 497 618 /* send file in 8KB block - last block may be smaller */ 498 while ( (ret = read(file_fd, snd_buffer, BUFSIZE)) > 0 ) {619 while ( (ret = (int)read(file_fd, snd_buffer, BUFSIZE)) > 0 ) { 499 620 (void)web_write(conn_id,snd_buffer,ret); 500 621 if(WebDID_Debug == 2) -
trunk/FACT++/dim/src/webDid/webTcpip.c
r14937 r15282 163 163 { 164 164 dna_connp->buffer = 165 (int *) realloc(dna_connp->buffer, size);166 memset(dna_connp->buffer, 0, size);165 (int *) realloc(dna_connp->buffer, (size_t)size); 166 memset(dna_connp->buffer, 0, (size_t)size); 167 167 dna_connp->buffer_size = size; 168 168 } … … 288 288 { 289 289 sscanf(node,"%d.%d.%d.%d",&a, &b, &c, &d); 290 ipaddr[0] = a;291 ipaddr[1] = b;292 ipaddr[2] = c;293 ipaddr[3] = d;290 ipaddr[0] = (unsigned char)a; 291 ipaddr[1] = (unsigned char)b; 292 ipaddr[2] = (unsigned char)c; 293 ipaddr[3] = (unsigned char)d; 294 294 if( (host = gethostbyaddr(ipaddr, sizeof(ipaddr), AF_INET)) == (struct hostent *)0 ) 295 295 {
Note:
See TracChangeset
for help on using the changeset viewer.