You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2002/04/06 16:31:05 UTC

cvs commit: apache-1.3/src/support httpd.exp

minfrin     02/04/06 06:31:05

  Modified:    src/include ap_mmn.h
               src/main http_protocol.c
               src/support httpd.exp
  Log:
  Namespace protect getline() and get_chunk_size().
  Export ap_getline() and ap_get_chunk_size().
  
  Revision  Changes    Path
  1.59      +2 -1      apache-1.3/src/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/include/ap_mmn.h,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- ap_mmn.h	13 Mar 2002 21:05:29 -0000	1.58
  +++ ap_mmn.h	6 Apr 2002 14:31:05 -0000	1.59
  @@ -235,6 +235,7 @@
    *                        filter_callback to the end of buff.h
    * 19990320.11          - Add some fields to the end of the core_dir_config
    *                        structure
  + * 19990320.12		- add ap_getline(), ap_get_chunk_size()
    */
   
   #define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */
  @@ -242,7 +243,7 @@
   #ifndef MODULE_MAGIC_NUMBER_MAJOR
   #define MODULE_MAGIC_NUMBER_MAJOR 19990320
   #endif
  -#define MODULE_MAGIC_NUMBER_MINOR 11                    /* 0...n */
  +#define MODULE_MAGIC_NUMBER_MINOR 12                    /* 0...n */
   
   /* Useful for testing for features. */
   #define AP_MODULE_MAGIC_AT_LEAST(major,minor)		\
  
  
  
  1.314     +12 -12    apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.313
  retrieving revision 1.314
  diff -u -r1.313 -r1.314
  --- http_protocol.c	25 Mar 2002 22:45:05 -0000	1.313
  +++ http_protocol.c	6 Apr 2002 14:31:05 -0000	1.314
  @@ -857,13 +857,13 @@
    *       then the actual input line exceeded the buffer length,
    *       and it would be a good idea for the caller to puke 400 or 414.
    */
  -static int getline(char *s, int n, BUFF *in, int fold)
  +API_EXPORT(int) ap_getline(char *s, int n, BUFF *in, int fold)
   {
       char *pos, next;
       int retval;
       int total = 0;
   #ifdef CHARSET_EBCDIC
  -    /* When getline() is called, the HTTP protocol is in a state
  +    /* When ap_getline() is called, the HTTP protocol is in a state
        * where we MUST be reading "plain text" protocol stuff,
        * (Request line, MIME headers, Chunk sizes) regardless of
        * the MIME type and conversion setting of the document itself.
  @@ -978,7 +978,7 @@
   
   static int read_request_line(request_rec *r)
   {
  -    char l[DEFAULT_LIMIT_REQUEST_LINE + 2]; /* getline's two extra for \n\0 */
  +    char l[DEFAULT_LIMIT_REQUEST_LINE + 2]; /* ap_getline's two extra for \n\0 */
       const char *ll = l;
       const char *uri;
       conn_rec *conn = r->connection;
  @@ -1000,7 +1000,7 @@
        * have to block during a read.
        */
       ap_bsetflag(conn->client, B_SAFEREAD, 1);
  -    while ((len = getline(l, sizeof(l), conn->client, 0)) <= 0) {
  +    while ((len = ap_getline(l, sizeof(l), conn->client, 0)) <= 0) {
           if ((len < 0) || ap_bgetflag(conn->client, B_EOF)) {
               ap_bsetflag(conn->client, B_SAFEREAD, 0);
   	    /* this is a hack to make sure that request time is set,
  @@ -1031,7 +1031,7 @@
   
       ap_parse_uri(r, uri);
   
  -    /* getline returns (size of max buffer - 1) if it fills up the
  +    /* ap_getline returns (size of max buffer - 1) if it fills up the
        * buffer before finding the end-of-line.  This is only going to
        * happen if it exceeds the configured limit for a request-line.
        */
  @@ -1056,7 +1056,7 @@
   
   static void get_mime_headers(request_rec *r)
   {
  -    char field[DEFAULT_LIMIT_REQUEST_FIELDSIZE + 2]; /* getline's two extra */
  +    char field[DEFAULT_LIMIT_REQUEST_FIELDSIZE + 2]; /* ap_getline's two extra */
       conn_rec *c = r->connection;
       char *value;
       char *copy;
  @@ -1071,7 +1071,7 @@
        * Read header lines until we get the empty separator line, a read error,
        * the connection closes (EOF), reach the server limit, or we timeout.
        */
  -    while ((len = getline(field, sizeof(field), c->client, 1)) > 0) {
  +    while ((len = ap_getline(field, sizeof(field), c->client, 1)) > 0) {
   
           if (r->server->limit_req_fields &&
               (++fields_read > r->server->limit_req_fields)) {
  @@ -1081,7 +1081,7 @@
                             "this server's limit.<P>\n");
               return;
           }
  -        /* getline returns (size of max buffer - 1) if it fills up the
  +        /* ap_getline returns (size of max buffer - 1) if it fills up the
            * buffer before finding the end-of-line.  This is only going to
            * happen if it exceeds the configured limit for a field size.
            */
  @@ -2018,7 +2018,7 @@
       return 1;
   }
   
  -static long get_chunk_size(char *b)
  +API_EXPORT(long) ap_get_chunk_size(char *b)
   {
       long chunksize = 0;
   
  @@ -2100,14 +2100,14 @@
   
       if (r->remaining == 0) {    /* Start of new chunk */
   
  -        chunk_start = getline(buffer, bufsiz, r->connection->client, 0);
  +        chunk_start = ap_getline(buffer, bufsiz, r->connection->client, 0);
           if ((chunk_start <= 0) || (chunk_start >= (bufsiz - 1))
               || !ap_isxdigit(*buffer)) {
               r->connection->keepalive = -1;
               return -1;
           }
   
  -        len_to_read = get_chunk_size(buffer);
  +        len_to_read = ap_get_chunk_size(buffer);
   
           if (len_to_read == 0) { /* Last chunk indicated, get footers */
               if (r->read_body == REQUEST_CHUNKED_DECHUNK) {
  @@ -2141,7 +2141,7 @@
           len_read = chunk_start;
   
           while ((bufsiz > 1) && ((len_read =
  -                  getline(buffer, bufsiz, r->connection->client, 1)) > 0)) {
  +                  ap_getline(buffer, bufsiz, r->connection->client, 1)) > 0)) {
   
               if (len_read != (bufsiz - 1)) {
                   buffer[len_read++] = CR;        /* Restore footer line end  */
  
  
  
  1.38      +2 -0      apache-1.3/src/support/httpd.exp
  
  Index: httpd.exp
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/support/httpd.exp,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- httpd.exp	19 Mar 2002 19:17:40 -0000	1.37
  +++ httpd.exp	6 Apr 2002 14:31:05 -0000	1.38
  @@ -129,6 +129,7 @@
   ap_fnmatch
   ap_force_library_loading
   ap_get_basic_auth_pw
  +ap_get_chunk_size
   ap_get_client_block
   ap_get_gmtoff
   ap_get_list_item
  @@ -142,6 +143,7 @@
   ap_get_time
   ap_get_token
   ap_get_virthost_addr
  +ap_getline
   ap_getparents
   ap_getword
   ap_getword_conf