comparison src/core/ngx_conf_file.c @ 378:fc497c1dfb7c NGINX_0_6_33

nginx 0.6.33 *) Feature: now nginx returns the 405 status code for POST method requesting a static file only if the file exists. *) Workaround: compatibility with glibc 2.3. Thanks to Eric Benson and Maxim Dounin. *) Bugfix: the resolver did not understand big DNS responses. Thanks to Zyb. *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" error. *) Bugfix: the ngx_http_charset_module did not understand quoted charset name received from backend. *) Bugfix: if the "max_fails=0" parameter was used in upstream with several servers, then a worker process exited on a SIGFPE signal. Thanks to Maxim Dounin. *) Bugfix: the $r->header_in() method did not return value of the "Host", "User-Agent", and "Connection" request header lines; the bug had appeared in 0.6.32. *) Bugfix: a full response was returned for request method HEAD while redirection via an "error_page" directive. *) Bugfix: if a directory has search only rights and the first index file was absent, then nginx returned the 500 status code. *) Bugfix: of recursive error_page for 500 status code.
author Igor Sysoev <http://sysoev.ru>
date Thu, 20 Nov 2008 00:00:00 +0300
parents 6639b93e81b2
children 09b703ae3ba5
comparison
equal deleted inserted replaced
377:15c4ba3bc2fa 378:fc497c1dfb7c
804 804
805 805
806 static void 806 static void
807 ngx_conf_flush_files(ngx_cycle_t *cycle) 807 ngx_conf_flush_files(ngx_cycle_t *cycle)
808 { 808 {
809 ssize_t n, len;
809 ngx_uint_t i; 810 ngx_uint_t i;
810 ngx_list_part_t *part; 811 ngx_list_part_t *part;
811 ngx_open_file_t *file; 812 ngx_open_file_t *file;
812 813
813 ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "flush files"); 814 ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "flush files");
824 part = part->next; 825 part = part->next;
825 file = part->elts; 826 file = part->elts;
826 i = 0; 827 i = 0;
827 } 828 }
828 829
829 if (file[i].buffer == NULL || file[i].pos - file[i].buffer == 0) { 830 len = file[i].pos - file[i].buffer;
831
832 if (file[i].buffer == NULL || len == 0) {
830 continue; 833 continue;
831 } 834 }
832 835
833 ngx_write_fd(file[i].fd, file[i].buffer, file[i].pos - file[i].buffer); 836 n = ngx_write_fd(file[i].fd, file[i].buffer, len);
837
838 if (n == NGX_FILE_ERROR) {
839 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
840 ngx_write_fd_n " to \"%s\" failed",
841 file[i].name.data);
842
843 } else if (n != len) {
844 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
845 ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz",
846 file[i].name.data, n, len);
847 }
834 } 848 }
835 } 849 }
836 850
837 851
838 void ngx_cdecl 852 void ngx_cdecl