Documentation Source Text

Check-in [d61bcab9f4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:althttpd.c changes: Send a 403 response to unauthorized agents. Add Ezoom to the list of unauthorized agents. Do not log timeouts if the first line of the HTTP request was never received.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d61bcab9f4d1c7ca8f711e49a9193f31f7d3e89a
User & Date: drh 2012-11-10 14:43:55
Context
2012-11-14
12:46
Fix typo in documentation on EXCLUSIVE locking mode for WAL. check-in: 64593a771c user: drh tags: trunk
2012-11-10
14:43
althttpd.c changes: Send a 403 response to unauthorized agents. Add Ezoom to the list of unauthorized agents. Do not log timeouts if the first line of the HTTP request was never received. check-in: d61bcab9f4 user: drh tags: trunk
12:38
Change the way that user-agent restrictions are handled in althttpd.c. check-in: 8d5d89e6db user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to misc/althttpd.c.

   358    358       "<head><title lineno=\"%d\">Not Found</title></head>\n"
   359    359       "<body><h1>Document Not Found</h1>\n"
   360    360       "The document %s is not available on this server\n"
   361    361       "</body>\n", lineno, zScript);
   362    362     MakeLogEntry(0);
   363    363     exit(0);
   364    364   }
          365  +
          366  +/*
          367  +** Tell the client that they are not welcomed here.
          368  +*/
          369  +static void Forbidden(void){
          370  +  StartResponse("403 Forbidden");
          371  +  nOut += printf(
          372  +    "Content-type: text/plain\r\n"
          373  +    "\r\n"
          374  +    "Access denied\n"
          375  +  );
          376  +  closeConnection = 1;
          377  +  MakeLogEntry(0);
          378  +  exit(0);
          379  +}
   365    380   
   366    381   /*
   367    382   ** Tell the client that authorization is required to access the
   368    383   ** document.
   369    384   */
   370    385   static void NotAuthorized(const char *zRealm){
   371    386     StartResponse("401 Authorization Required");
................................................................................
   398    413   
   399    414   /*
   400    415   ** This is called if we timeout.
   401    416   */
   402    417   static void Timeout(int NotUsed){
   403    418     (void)NotUsed;
   404    419     if( !debugFlag ){
   405         -    strcpy(zReplyStatus, "999");
   406         -    MakeLogEntry(0);
          420  +    if( zScript && zScript[0] ){
          421  +      strcpy(zReplyStatus, "999");
          422  +      MakeLogEntry(0);
          423  +    }
   407    424       exit(0);
   408    425     }
   409    426   }
   410    427   
   411    428   /*
   412    429   ** Tell the client that there is an error in the script.
   413    430   */
................................................................................
   968    985       }
   969    986     }
   970    987   
   971    988     /* Disallow referring from certain clients */
   972    989     if( zAgent ){
   973    990       if( strstr(zAgent, "Windows_9")!=0
   974    991        || strstr(zAgent, "Download_Master")!=0
          992  +     || strstr(zAgent, "_Ezooms/")!=0
   975    993       ){
   976         -      strcpy(zReplyStatus, "997");
   977         -      closeConnection = 1;
   978         -      MakeLogEntry(0);
          994  +      Forbidden();
   979    995       }
   980    996     }
   981    997   #if 0
   982    998     if( zReferer ){
   983    999       static const char *azDisallow[] = {
   984   1000         "skidrowcrack.com",
   985   1001         "hoshiyuugi.tistory.com",