Welcome! Log In Create A New Profile

Advanced

weird behavior - race condition ?

Matthieu Tourne
March 27, 2011 04:32AM
Hi all,

I just found a weird behavior in nginx, which looks like a race condition.

I'm using an unmodified nginx 0.9.6 with no option on the ./configure line
and the config is pretty much the default except for those 2 directives in
the http section :

client_max_body_size 20M;
client_body_in_single_buffer on;


I have the "location ~ \.php$" enabled and a simple script called
print_post.php which contains :
<?php print_r($_POST); ?>

let's curl it to see if this works :
curl 'http://localhost/print_post.php' -F 'file=@/path/to/15M_file' -F
'foo=bar'

it shows as you would expect :
Array
(
[foo] => bar
)

now let's use HTTP 1.0 (with the -0 option for curl):
curl 'http://localhost/print_post.php' -F 'file=@/path/to/15M_file' -F
'foo=bar' -0
sometimes I get the expected result, and some other times just an empty
array :
Array
(
)

strangely this doesn't seem to occur with HTTP 1.1, and seems to go away if
I don't use "client_body_in_single_buffer on;"

can anybody reproduce this ?

Thank you,
Matthieu.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

weird behavior - race condition ?

Matthieu Tourne 2103 March 27, 2011 04:32AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 270
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready