cvs: php4 /main rfc1867.c

From: Date: Mon, 29 Oct 2001 18:58:15 +0000
Subject: cvs: php4 /main rfc1867.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8024@lists.php.net to get a copy of this message
sniper Mon Oct 29 13:58:15 2001 EDT Modified files: /php4/main rfc1867.c Log: - Added myself to authors. - Modified the clause about Apache to say what exactly was borrowed. Should there be the Apache license included in this file? Index: php4/main/rfc1867.c diff -u php4/main/rfc1867.c:1.77 php4/main/rfc1867.c:1.78 --- php4/main/rfc1867.c:1.77 Sat Oct 27 01:26:24 2001 +++ php4/main/rfc1867.c Mon Oct 29 13:58:15 2001 @@ -13,9 +13,11 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf <rasmus@php.net> | + | Jani Taskinen <sniper@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: rfc1867.c,v 1.77 2001/10/27 05:26:24 sniper Exp $ */ +/* $Id: rfc1867.c,v 1.78 2001/10/29 18:58:15 sniper Exp $ */ + #include <stdio.h> #include "php.h" @@ -109,8 +111,8 @@ } -/* - * Following code is borrowed from Apache +/* + * Following code is based on apache_multipart_buffer.c from libapreq-0.33 package. * */ @@ -172,6 +174,7 @@ return actual_read; } + /* eof if we are out of bytes, or if we hit the final boundary */ static int multipart_buffer_eof(multipart_buffer *self TSRMLS_DC) { @@ -182,6 +185,7 @@ } } + /* create new multipart_buffer structure */ static multipart_buffer *multipart_buffer_new(char *boundary, int boundary_len) { @@ -206,6 +210,7 @@ return self; } + /* gets the next CRLF terminated line from the input buffer. if it doesn't find a CRLF, and the buffer isn't completely full, returns @@ -251,6 +256,7 @@ return line; } + /* returns the next CRLF terminated line from the client */ static char *get_line(multipart_buffer *self TSRMLS_DC) { @@ -264,6 +270,7 @@ return ptr; } + /* Free header entry */ static void php_free_hdr_entry(mime_header_entry *h) { @@ -271,6 +278,7 @@ if(h->value) efree(h->value); } + /* finds a boundary */ static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC) { @@ -289,6 +297,7 @@ return 0; } + /* parse headers */ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC) { @@ -378,6 +387,7 @@ return res; } + static char *substring_conf(char *start, int len, char quote) { char *result = emalloc(len + 2); @@ -396,6 +406,7 @@ return result; } + static char *php_ap_getword_conf(char **line) { char *str = *line, *strend, *res, quote; @@ -441,6 +452,7 @@ return res; } + /* search for a string in a fixed-length byte string. if partial is true, partial matches are allowed at the end of the buffer. @@ -469,6 +481,7 @@ return ptr; } + /* read until a boundary condition */ static int multipart_buffer_read(multipart_buffer *self, char *buf, int bytes TSRMLS_DC) { @@ -508,6 +521,7 @@ return len; } + /* XXX: this is horrible memory-usage-wise, but we only expect

« previous php.cvs (#8024) next »