Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4453 - in branches/stable-1.0: . src/event

Anonymous User
February 05, 2012 03:08PM
Author: mdounin
Date: 2012-02-05 20:06:50 +0000 (Sun, 05 Feb 2012)
New Revision: 4453

Log:
Merge of r4422:

Fixed error handling in ngx_event_connect_peer().

Previously if ngx_add_event() failed a connection was freed two times (once
in the ngx_event_connect_peer(), and again by a caller) as pc->connection was
left set. Fix is to always use ngx_close_connection() to close connection
properly and set pc->connection to NULL on errors.

Patch by Piotr Sikora.


Modified:
branches/stable-1.0/
branches/stable-1.0/src/event/ngx_event_connect.c


Property changes on: branches/stable-1.0
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415-4416
+ /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4223,4227-4232,4235-4237,4265-4268,4270,4274-4276,4278-4280,4282-4284,4294-4295,4298,4300-4309,4313,4315,4320-4321,4326-4327,4335-4336,4338-4343,4372-4375,4377,4379,4381-4385,4393,4396,4398,4400-4406,4413,4415-4416,4422

Modified: branches/stable-1.0/src/event/ngx_event_connect.c
===================================================================
--- branches/stable-1.0/src/event/ngx_event_connect.c 2012-02-05 20:05:11 UTC (rev 4452)
+++ branches/stable-1.0/src/event/ngx_event_connect.c 2012-02-05 20:06:50 UTC (rev 4453)
@@ -160,6 +160,9 @@
ngx_log_error(level, c->log, err, "connect() to %V failed",
pc->name);

+ ngx_close_connection(c);
+ pc->connection = NULL;
+
return NGX_DECLINED;
}
}
@@ -241,13 +244,9 @@

failed:

- ngx_free_connection(c);
+ ngx_close_connection(c);
+ pc->connection = NULL;

- if (ngx_close_socket(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- ngx_close_socket_n " failed");
- }
-
return NGX_ERROR;
}


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

[nginx] svn commit: r4453 - in branches/stable-1.0: . src/event

Anonymous User 1336 February 05, 2012 03:08PM



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

Online Users

Guests: 199
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