Changeset 7795 for trunk/src/dot/proxy
- Timestamp:
- 03/26/07 09:28:08 (22 months ago)
- Location:
- trunk/src/dot/proxy
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dot/proxy/http_parse.c
r7618 r7795 1470 1470 urlIsLocal(const char *url, int len) 1471 1471 { 1472 return (len > 0 && url[0] == '/'); 1472 return (len >= 13 && strstr(url, "pac_check.txt")) || 1473 (len > 0 && url[0] == '/'); 1473 1474 } 1474 1475 … … 1476 1477 urlIsSpecial(const char *url, int len) 1477 1478 { 1478 return (len >= 8 && memcmp(url, "/polipo/", 8) == 0); 1479 return (len >= 13 && strstr(url, "pac_check.txt")) || 1480 (len >= 8 && memcmp(url, "/polipo/", 8) == 0); 1479 1481 } 1480 1482 -
trunk/src/dot/proxy/local.c
r7743 r7795 351 351 "\r\nServer: polipo" 352 352 "\r\nContent-Type: text/javascript"); 353 }else if(isPACCheck(object) == 1){ 354 hlen = snnprintf(buffer, 0, 1024, 355 "\r\nServer: polipo" 356 "\r\nContent-Type: text/plain"); 353 357 }else{ 354 358 hlen = snnprintf(buffer, 0, 1024, … … 376 380 #ifndef NO_OFFLINE_SUPPORT 377 381 } else if(disableOfflineSupport == 0 && 378 matchUrl("/polipo/offline", object)) {379 handleOfflineAPI(object, requestor);382 matchUrl("/polipo/offline", object)) { 383 handleOfflineAPI(object, requestor); 380 384 #endif 385 } else if(isPACCheck(object) == 1) { 386 printf("pac_check.txt was requested"); 387 objectPrintf(object, 0, 388 "the web application is inside the PAC file"); 389 object->length = object->size; 381 390 } else if(matchUrl("/polipo/status", object)) { 382 391 objectPrintf(object, 0, … … 678 687 } 679 688 689 int 690 isPACCheck(ObjectPtr object) 691 { 692 char *testUrl; 693 printf("isPACCheck\n"); 694 695 if(disableOfflineSupport == 1) 696 return 0; 697 698 /* object->key doesn't use a null terminator, which 699 strstr requires; copy it over and add a null 700 terminator. */ 701 testUrl = (char *)malloc((unsigned)(object->key_size + 1)); 702 memcpy(testUrl, object->key, object->key_size); 703 testUrl[object->key_size] = '\0'; 704 printf("testUrl=%s\n", testUrl); 705 if(strstr(testUrl, "pac_check.txt") != NULL) 706 return 1; 707 else 708 return 0; 709 } 710 680 711 #ifdef HAVE_FORK 681 712 static void -
trunk/src/dot/proxy/local.h
r7618 r7795 48 48 StreamRequestPtr srequest); 49 49 int httpSpecialDoSideFinish(AtomPtr data, HTTPRequestPtr requestor); 50 int isPACCheck(ObjectPtr object); 51