View Issue Details

IDProjectCategoryView StatusLast Update
0000123easycwmpHelppublic2016-05-11 13:02
Reporterwonderlive Assigned Tomohamed.kallel  
PriorityhighSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformAT91SAM9OSLinuxOS Version2.6.39
Summary0000123: HTTP SERVER CONNECTION FAILED
Description2016-03-18 10:11:50 [easycwmp] NOTICE - external script init
config_init_local(55):: easycwmp.@local[0].interface=eth0
config_init_local(65):: easycwmp.@local[0].port=7547
config_init_local(83):: easycwmp.@local[0].ubus_socket=/tmp/ubus.sock
config_init_local(71):: easycwmp.@local[0].username=acs
config_init_local(77):: easycwmp.@local[0].password=Sct123
config_init_local(94):: easycwmp.@local[0].logging_level=4
config_init_acs(165):: easycwmp.@acs[0].username=acs
config_init_acs(190):: easycwmp.@acs[0].periodic_time=0001-01-01T00:00:00Z
config_init_acs(196):: easycwmp.@acs[0].http100continue_disable=1
config_init_acs(177):: easycwmp.@acs[0].periodic_enable=1
config_init_acs(171):: easycwmp.@acs[0].password=Sct123
config_init_acs(159):: easycwmp.@acs[0].url=http://192.168.169.108:80/acs
config_init_acs(183):: easycwmp.@acs[0].periodic_interval=60
2016-03-18 10:11:51 [easycwmp] NOTICE - init periodic inform: reference time = n/a, interval = 60
2016-03-18 10:11:51 [easycwmp] NOTICE - external: execute update_value_change (null)
2016-03-18 10:11:53 [easycwmp] NOTICE - daemon started
2016-03-18 10:11:53 [easycwmp] NOTICE - external: execute inform device_id
2016-03-18 10:11:53 [easycwmp] NOTICE - external script exit
2016-03-18 10:11:53 [easycwmp] NOTICE - interface eth0 has ip 192.168.169.251
+++ HTTP SERVER CONFIGURATION +++
ip: '192.168.169.251'
port: '7547'
--- HTTP SERVER CONFIGURATION ---
2016-03-18 10:11:53 [easycwmp] NOTICE - http server initialized
2016-03-18 10:11:53 [easycwmp] NOTICE - entering main loop
+++ RECEIVED HTTP REQUEST +++
http_digest_auth_fail_response(335):: http_digest_auth_fail_response: header: Digest realm="realm@easycwmp",qop="auth",nonce="599002c19a8b35fe2970182c51d9a2a20000023f",opaque="328458fab28345ae87ab3210a8513b14eff452a2"--- RECEIVED HTTP REQUEST ---
+++ RECEIVED HTTP REQUEST +++
http_digest_auth_check(378):: http_digest_auth_check: header: username="acs", realm="realm@easycwmp", nonce="599002c19a8b35fe2970182c51d9a2a20000023f", uri="/", response="a3b97c6940a45876f571fe01c09e5eb3", qop=auth, nc=00000001, cnonce="981184409bb5d7096782306681f35a08", opaque="328458fab28345ae87ab3210a8513b14eff452a2"

--- RECEIVED HTTP REQUEST ---
+++ HTTP SERVER CONNECTION FAILED +++
+++ RECEIVED HTTP REQUEST +++
http_digest_auth_fail_response(335):: http_digest_auth_fail_response: header: Digest realm="realm@easycwmp",qop="auth",nonce="6f70de597eb161e72e21e5e65677106d00000267",opaque="328458fab28345ae87ab3210a8513b14eff452a2"--- RECEIVED HTTP REQUEST ---
+++ RECEIVED HTTP REQUEST +++
http_digest_auth_check(378):: http_digest_auth_check: header: username="acs", realm="realm@easycwmp", nonce="6f70de597eb161e72e21e5e65677106d00000267", uri="/", response="6f17488506469e6d9625827e283ea2af", qop=auth, nc=00000001, cnonce="e6d291990a740d6d03ea59ce3d984e59", opaque="328458fab28345ae87ab3210a8513b14eff452a2"

--- RECEIVED HTTP REQUEST ---
+++ HTTP SERVER CONNECTION FAILED +++
Steps To Reproduce1.run easycwmpd
2.acs initiate the connection actively
Additional Informationin http.c,i found this method,but i dont know how the condiction is false.

static void
http_del_client(struct uloop_process *uproc, int ret)
{
    wait(0);
    FREE(uproc);

    /* child terminated ; check return code */
    if (WIFEXITED(ret) && WEXITSTATUS(ret) == 0) {
        DDF("+++ HTTP SERVER CONNECTION SUCCESS +++\n");
        log_message(NAME, L_NOTICE, "acs initiated connection\n");
        cwmp_connection_request(EVENT_CONNECTION_REQUEST);
    } else {
        DDF("+++ HTTP SERVER CONNECTION FAILED +++\n");
    }
}
TagsNo tags attached.
e-mail notification

Activities

wonderlive

2016-03-18 04:04

reporter  

cpe_passive.pcapng (1,192 bytes)

mohamed.kallel

2016-03-18 23:17

administrator   ~0000408

try to remove the FREE(uproc); in the line 299

done_child:
              fclose(fp);
              FREE(uproc); //<============== remove this line
              DDF("--- RECEIVED HTTP REQUEST ---\n");
              exit(status);
         }

and tes if your problem is fixed. Please let me know about the result

wonderlive

2016-03-21 02:26

reporter   ~0000409

hello mohamed.kallel,
i remove the line which you told me,and it seems not fixed.i print out the value of 'ret' and 'status' in the following,would it help?

+++ RECEIVED HTTP REQUEST +++
http_digest_auth_check(378):: http_digest_auth_check: header: username="acs", realm="realm@easycwmp", nonce="a852e1b405e404976c784bb1009745c90000011e", uri="/",
 response="b3ac3973abf96a1f86b13f8611eb088c", qop=auth, nc=00000001, cnonce="3d715b89c264584f49a72e8330cf4f7d", opaque="328458fab28345ae87ab3210a8513b14eff452a2
"
--- RECEIVED HTTP REQUEST ---status 0
--- http_del_client ---ret 3328

okraits

2016-04-03 12:15

reporter   ~0000411

I think i am experiencing the same issue, at least it's the same error message "HTTP SERVER CONNECTION FAILED" and thus same line of code.

I was testing the reliability of connection requests sent from GenieACS to easycwmp and i noticed that in quite a few cases easycwmp simply didn't initiate the requested connection and i didn't find a reason why. I already discussed this topic on the GenieACS mailinglist and the developer thinks it's an easycwmp issue:

http://lists.genieacs.com/pipermail/users/2016-March/000677.html

okraits

2016-04-03 12:18

reporter   ~0000412

BTW, i got the same return value as wonderlive. If needed, i can provide easycwmp debug logs and a tcp dump.

mohamed.kallel

2016-04-04 11:59

administrator   ~0000413

Lokks like a bug. I have to investigate more in order to confirm it.
Sorry, I can not do it right now since I m taken by other projects.
I will let you know when I will fix it

mohamed.kallel

2016-05-04 15:46

administrator   ~0000437

It's not reporduced for me.
Could you add more debug message inorder to follow the reason.

Please add the following debug line in the http_new_client() function:

 else if (auth_digest = strstr(buffer, "Authorization: Digest ")) {
    if (http_digest_auth_check("GET", "/", auth_digest + strlen("Authorization: Digest "), REALM, username, password, 300) == MHD_YES)
            auth_status = 1;
    else
        auth_status = 0;
}
DDF("--- MORE DEBUG(1) auth_status = %d ---\n", auth_status); //<---- Add this line

mohamed.kallel

2016-05-04 15:53

administrator   ~0000438

What's your linux system?

mohamed.kallel

2016-05-04 15:57

administrator   ~0000439

Please try to remove the FREE(uproc); in the done_child: label

done_child:
            fclose(fp);
            FREE(uproc); //<---- remove this line
            DDF("--- RECEIVED HTTP REQUEST ---\n");
            exit(status);

 and remove also the FREE(uproc); from the http_del_client() function


http_del_client(struct uloop_process *uproc, int ret)
{
    wait(0);
    FREE(uproc); //<------ remove this line

    /* child terminated ; check return code */


And then check if your problem is reproduced

okraits

2016-05-09 14:45

reporter   ~0000442

+++ RECEIVED EMPTY HTTP RESPONSE +++
+++ RECEIVED HTTP REQUEST +++
--- MORE DEBUG(1) auth_status = 0 ---
--- MORE DEBUG(1) auth_status = 0 ---
--- MORE DEBUG(1) auth_status = 0 ---
--- MORE DEBUG(1) auth_status = 0 ---
http_digest_auth_fail_response(335):: http_digest_auth_fail_response: header: Digest realm="realm@easycwmp",qop="auth",nonce="",opaque=""--- RECEIVED HTTP REQUEST ---
+++ RECEIVED HTTP REQUEST +++
--- MORE DEBUG(1) auth_status = 0 ---
http_digest_auth_check(378):: http_digest_auth_check: header: username="tdt",realm="realm@easycwmp",nonce="",uri="/",qop=auth,nc=00000001,cnonce="",response="",opaque=""
--- MORE DEBUG(1) auth_status = 1 ---
--- MORE DEBUG(1) auth_status = 1 ---
--- MORE DEBUG(1) auth_status = 1 ---
--- MORE DEBUG(1) auth_status = 1 ---
--- RECEIVED HTTP REQUEST ---
+++ HTTP SERVER CONNECTION FAILED +++

okraits

2016-05-09 14:52

reporter   ~0000443

Last edited: 2016-05-09 14:53

I commented out the FREE calls you mentioned and the issue still occurs.

I run easycwmp on OpenWRT chaos calmer.

mohamed.kallel

2016-05-09 15:48

administrator   ~0000444

This is wierd,
I use also OpenWRT chaos calmer. And I did not get a such behaviour.
Could you provide to me a remote access to your equipment for tests. And also the make config to build the package according to your hardware

mohamed.kallel

2016-05-09 17:44

administrator   ~0000445

does the problem always reproduced? Or it's rarely reproduced?

okraits

2016-05-10 08:45

reporter   ~0000446

The problem occurs with varying intensity. With a script, i create every 10 seconds a task in GenieACS which asks for a connection request to set a parameter. Here's my debugging output of the GenieACS REST interface:

10 May 08:27:37 - processed
10 May 08:27:48 - processed
10 May 08:27:59 - processed
10 May 08:28:10 - processed
10 May 08:28:23 - processed
10 May 08:28:38 - queued
10 May 08:28:49 - processed
10 May 08:29:03 - queued
10 May 08:29:17 - queued
10 May 08:29:28 - processed
10 May 08:29:39 - processed
10 May 08:29:53 - queued
10 May 08:30:04 - processed
10 May 08:30:15 - processed
10 May 08:30:26 - processed
10 May 08:30:37 - processed
10 May 08:30:51 - queued
10 May 08:31:05 - queued
10 May 08:31:16 - processed
10 May 08:31:31 - queued
10 May 08:31:42 - processed
10 May 08:31:56 - queued
10 May 08:32:07 - processed
10 May 08:32:21 - queued
10 May 08:32:32 - processed
10 May 08:32:43 - processed
10 May 08:32:54 - processed
10 May 08:33:08 - queued
10 May 08:33:22 - queued
10 May 08:33:36 - queued
10 May 08:33:47 - processed
10 May 08:33:58 - processed

All lines with "queued" are the cases in which the problem occurs.

okraits

2016-05-10 08:50

reporter   ~0000447

I can provide you remote access to the CPE. Could you please send me your public SSH key?

mohamed.kallel

2016-05-10 10:19

administrator  

id_rsa.pub (414 bytes)

mohamed.kallel

2016-05-10 10:20

administrator   ~0000448

public key attached

mohamed.kallel

2016-05-10 10:25

administrator   ~0000449

what you get when you make Connection Request with your browser (FirFox, Chrome...).

Do you get the same error?


You can make Connection Request from your browser with the URL:

http://<address of your router>:7547

okraits

2016-05-10 10:51

reporter   ~0000450

The error doesn't occur when i connect to easycwmp with a browser.

Can you please give me your mail address so i can send you the connection details for the CPE?

mohamed.kallel

2016-05-10 11:14

administrator   ~0000451

my email address is in the headers of the source file of easycwmp

mohamed.kallel

2016-05-10 11:16

administrator   ~0000452

could you remove the following line too and retry

http_del_client(struct uloop_process *uproc, int ret)
{
    wait(0); //<------ remove this line
    FREE(uproc); //<------ remove this line

    /* child terminated ; check return code */

okraits

2016-05-10 12:50

reporter   ~0000453

Last edited: 2016-05-10 12:54

I removed the comments in front of the FREE calls and commented out the wait call in http_del_client().

THe problem didn't occur then. I tried for > 30 min in 10 second intervals as i mentioned above.

Should i send you the connection details for the CPE so you can do tests on it?

mohamed.kallel

2016-05-10 13:02

administrator   ~0000454

OK, so the problem is solved when you removed the wait(0) ?!

So as summary to fix the problem you have to remove the following 2 lines:

1)

done_child:
              fclose(fp);
              FREE(uproc); //<============== remove this line
              DDF("--- RECEIVED HTTP REQUEST ---\n");
              exit(status);
         }

2)

http_del_client(struct uloop_process *uproc, int ret)
{
    wait(0); //<------ remove this line
    FREE(uproc);

And the problme will be solved.
Could you confirm that

I will add that in the future deliveries.

And Thanks I do not need the Device connection details if the problem is solved

okraits

2016-05-10 13:13

reporter   ~0000455

To fix the issue, you have to remove only the "wait(0);" in http_del_client(). The FREE calls at the done_child: label and in http_del_client() are active again.

mohamed.kallel

2016-05-10 13:27

administrator   ~0000456

You have to keep all FREE except this one

done_child:
              fclose(fp);
              FREE(uproc); //<============== remove this line
              DDF("--- RECEIVED HTTP REQUEST ---\n");
              exit(status);
         }


You have to remove it. It's buggy FREE. It could cause problems.

Could you please remove it and test again and provide the result of your test

okraits

2016-05-10 13:27

reporter   ~0000457

But can we safely remove the call of "wait(0);"? We don't wait for the child process to terminate then and the return value is not valid.

If yes, then why did that line exist in the first place?

okraits

2016-05-10 13:46

reporter  

http.c (8,570 bytes)   
/*
 *	This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 2 of the License, or
 *	(at your option) any later version.
 *
 *	Copyright (C) 2012-2015 PIVA SOFTWARE (www.pivasoftware.com)
 *		Author: Mohamed Kallel <mohamed.kallel@pivasoftware.com>
 *		Author: Anis Ellouze <anis.ellouze@pivasoftware.com>
 *	Copyright (C) 2011-2012 Luka Perkov <freecwmp@lukaperkov.net>
 */

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>

#include <libubox/uloop.h>
#include <libubox/usock.h>
#include <curl/curl.h>

#include "http.h"
#include "config.h"
#include "cwmp.h"
#include "easycwmp.h"
#include "digestauth.h"
#include "log.h"

static struct http_client http_c;
static struct http_server http_s;
CURL *curl;
char *http_redirect_url = NULL;

int
http_client_init(void)
{
	if (http_redirect_url) {
		if ((http_c.url = strdup(http_redirect_url)) == NULL)
			return -1;
	}
	else {
		if ((http_c.url = strdup(config->acs->url)) == NULL)
			return -1;
	}

	DDF("+++ HTTP CLIENT CONFIGURATION +++\n");
	DD("url: %s\n", http_c.url);
	if (config->acs->ssl_cert)
		DD("ssl_cert: %s\n", config->acs->ssl_cert);
	if (config->acs->ssl_cacert)
		DD("ssl_cacert: %s\n", config->acs->ssl_cacert);
	if (!config->acs->ssl_verify)
		DD("ssl_verify: SSL certificate validation disabled.\n");
	DDF("--- HTTP CLIENT CONFIGURATION ---\n");

	curl = curl_easy_init();
	if (!curl) return -1;
	curl_easy_setopt(curl, CURLOPT_URL, http_c.url);
	curl_easy_setopt(curl, CURLOPT_USERNAME, config->acs->username ? config->acs->username : "");
	curl_easy_setopt(curl, CURLOPT_PASSWORD, config->acs->password ? config->acs->password : "");
	curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST);
	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, http_get_response);
	curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30);
# ifdef DEVEL
	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
# endif /* DEVEL */
	curl_easy_setopt(curl, CURLOPT_COOKIEFILE, fc_cookies);
	curl_easy_setopt(curl, CURLOPT_COOKIEJAR, fc_cookies);
	if (config->acs->ssl_cert)
		curl_easy_setopt(curl, CURLOPT_SSLCERT, config->acs->ssl_cert);
	if (config->acs->ssl_cacert)
		curl_easy_setopt(curl, CURLOPT_CAINFO, config->acs->ssl_cacert);
	if (!config->acs->ssl_verify)
		curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);

	log_message(NAME, L_NOTICE, "configured acs url %s\n", http_c.url);
	return 0;
}

void
http_client_exit(void)
{
	FREE(http_c.url);

	if(curl) {
	curl_easy_cleanup(curl);
		curl = NULL;
	}
	curl_global_cleanup();
	if (access(fc_cookies, W_OK) == 0)
		remove(fc_cookies);
}

static size_t
http_get_response(void *buffer, size_t size, size_t rxed, char **msg_in)
{
	char *c;

	if (asprintf(&c, "%s%.*s", *msg_in, size * rxed, buffer) == -1) {
		FREE(*msg_in);
		return -1;
	}

	free(*msg_in);
	*msg_in = c;

	return size * rxed;
}

int8_t
http_send_message(char *msg_out, char **msg_in)
{
	CURLcode res;

	curl_easy_setopt(curl, CURLOPT_POSTFIELDS, msg_out);
	http_c.header_list = NULL;
	http_c.header_list = curl_slist_append(http_c.header_list, "Accept:");
	if (!http_c.header_list) return -1;
	http_c.header_list = curl_slist_append(http_c.header_list, "User-Agent: easycwmp");
	if (!http_c.header_list) return -1;
	http_c.header_list = curl_slist_append(http_c.header_list, "Content-Type: text/html; charset=\"utf-8\"");
	if (!http_c.header_list) return -1;
	if (config->acs->http100continue_disable) {
		http_c.header_list = curl_slist_append(http_c.header_list, "Expect:");
		if (!http_c.header_list) return -1;
	}
	if (msg_out) {
		DDF("+++ SEND HTTP REQUEST +++\n");
		DDF("%s", msg_out);
		DDF("--- SEND HTTP REQUEST ---\n");
		curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(msg_out));
		http_c.header_list = curl_slist_append(http_c.header_list, "SOAPAction;");
		if (!http_c.header_list) return -1;
	}
	else {
		DDF("+++ SEND EMPTY HTTP REQUEST +++\n");
		curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0);
	}
	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, http_c.header_list);

	curl_easy_setopt(curl, CURLOPT_WRITEDATA, msg_in);

	*msg_in = (char *) calloc (1, sizeof(char));

	res = curl_easy_perform(curl);

	if (http_c.header_list) {
		curl_slist_free_all(http_c.header_list);
		http_c.header_list = NULL;
	}

	if (!strlen(*msg_in)) {
		FREE(*msg_in);
	}
	
	long httpCode = 0;
	curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpCode);

	if (httpCode == 302 || httpCode == 307) {
		curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &http_redirect_url);
		if ((http_redirect_url = strdup(http_redirect_url)) == NULL)
			return -1;
		http_client_exit();
		if (http_client_init()) {
			D("receiving http redirect: re-initializing http client failed\n");
			FREE(http_redirect_url);
			return -1;
		}
		FREE(http_redirect_url);
		FREE(*msg_in);
		int redirect = http_send_message(msg_out, msg_in);
		return redirect;
	}

	if (res || (httpCode != 200 && httpCode != 204)) {
		log_message(NAME, L_NOTICE, "sending http message failed\n");
		return -1;
	}

	if (*msg_in) {
		DDF("+++ RECEIVED HTTP RESPONSE +++\n");
		DDF("%s", *msg_in);
		DDF("--- RECEIVED HTTP RESPONSE ---\n");
	} else {
		DDF("+++ RECEIVED EMPTY HTTP RESPONSE +++\n");
	}

	return 0;
}

void
http_server_init(void)
{
	http_digest_init_nonce_priv_key();

	http_s.http_event.cb = http_new_client;

	http_s.http_event.fd = usock(USOCK_TCP | USOCK_SERVER, "0.0.0.0", config->local->port);
	uloop_fd_add(&http_s.http_event, ULOOP_READ | ULOOP_EDGE_TRIGGER);

	DDF("+++ HTTP SERVER CONFIGURATION +++\n");
	if (config->local->ip)
		DDF("ip: '%s'\n", config->local->ip);
	else
		DDF("NOT BOUND TO IP\n");
	DDF("port: '%s'\n", config->local->port);
	DDF("--- HTTP SERVER CONFIGURATION ---\n");

	log_message(NAME, L_NOTICE, "http server initialized\n");
}

static void
http_new_client(struct uloop_fd *ufd, unsigned events)
{
	int status;
	struct timeval t;

	t.tv_sec = 60;
	t.tv_usec = 0;

	for (;;) {
		int client = accept(ufd->fd, NULL, NULL);

		/* set one minute timeout */
		if (setsockopt(ufd->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&t, sizeof t)) {
			DD("setsockopt() failed\n");
		}

		if (client == -1)
			break;

		struct uloop_process *uproc = calloc(1, sizeof(*uproc));
		if (!uproc || (uproc->pid = fork()) == -1) {
			FREE(uproc);
			close(client);
		}

		if (uproc->pid != 0) {
			/* parent */
			/* register an event handler for when the child terminates */
			uproc->cb = http_del_client;
			uloop_process_add(uproc);
			close(client);
		} else {
			/* child */
			FILE *fp;
			char buffer[BUFSIZ];
			char *auth_digest;
			int8_t auth_status = 0;
			
			fp = fdopen(client, "r+");

			DDF("+++ RECEIVED HTTP REQUEST +++\n");
			while (fgets(buffer, sizeof(buffer), fp)) {
				char *username = config->local->username;
				char *password = config->local->password;
				if (!username || !password) {
					// if we dont have username or password configured proceed with connecting to ACS
					auth_status = 1;
				}
				else if (auth_digest = strstr(buffer, "Authorization: Digest ")) {
					if (http_digest_auth_check("GET", "/", auth_digest + strlen("Authorization: Digest "), REALM, username, password, 300) == MHD_YES)
						auth_status = 1;
					else
						auth_status = 0;
				}
				if (buffer[0] == '\r' || buffer[0] == '\n') {
					/* end of http request (empty line) */
					goto http_end_child;
				}
			}
error_child:
			/* here we are because of an error, e.g. timeout */
			status = ETIMEDOUT|ENOMEM;
			goto done_child;

http_end_child:
			fflush(fp);
			if (auth_status) {
				status = 0;
				fputs("HTTP/1.1 200 OK\r\n", fp);
				fputs("Content-Length: 0\r\n", fp);
			} else {
				status = EACCES;
				fputs("HTTP/1.1 401 Unauthorized\r\n", fp);
				fputs("Content-Length: 0\r\n", fp);
				fputs("Connection: close\r\n", fp);
				http_digest_auth_fail_response(fp, "GET", "/", REALM, OPAQUE);
				fputs("\r\n", fp);
			}
			fputs("\r\n", fp);
			goto done_child;

done_child:
			fclose(fp);
			DDF("--- RECEIVED HTTP REQUEST ---\n");
			exit(status);
		}
	}
}

static void
http_del_client(struct uloop_process *uproc, int ret)
{
	FREE(uproc);

	/* child terminated ; check return code */
	if (WIFEXITED(ret) && WEXITSTATUS(ret) == 0) {
		DDF("+++ HTTP SERVER CONNECTION SUCCESS +++\n");
		log_message(NAME, L_NOTICE, "acs initiated connection\n");
		cwmp_connection_request(EVENT_CONNECTION_REQUEST);
	} else {
		DDF("+++ HTTP SERVER CONNECTION FAILED +++\n");
	}
}

http.c (8,570 bytes)   

okraits

2016-05-10 13:48

reporter   ~0000458

I removed the FREE call at the done_child: label and the "wait(0);" call in http_del_client() and the problem doesn't occur.

For reference i've attached the http.c i'm using and which works.

okraits

2016-05-10 14:03

reporter   ~0000459

See also https://github.com/pivasoftware/easycwmp/pull/24.

mohamed.kallel

2016-05-10 15:00

administrator   ~0000460

You can safely remove the call of "wait(0);".
It's a typo from old versions.
in fact the wait of child is done by the libubox functions.

mohamed.kallel

2016-05-10 15:01

administrator   ~0000461

I merged your pull. Thank you for your contrbution!

okraits

2016-05-10 15:04

reporter   ~0000462

Thank you - you're welcome.

mohamed.kallel

2016-05-11 13:02

administrator   ~0000470

fixed in EasyCwmp-1.2.8

Issue History

Date Modified Username Field Change
2016-03-18 04:04 wonderlive New Issue
2016-03-18 04:04 wonderlive File Added: cpe_passive.pcapng
2016-03-18 23:17 mohamed.kallel Note Added: 0000408
2016-03-21 02:26 wonderlive Note Added: 0000409
2016-04-03 12:15 okraits Note Added: 0000411
2016-04-03 12:18 okraits Note Added: 0000412
2016-04-04 11:59 mohamed.kallel Note Added: 0000413
2016-05-04 15:46 mohamed.kallel Note Added: 0000437
2016-05-04 15:53 mohamed.kallel Note Added: 0000438
2016-05-04 15:57 mohamed.kallel Note Added: 0000439
2016-05-09 14:45 okraits Note Added: 0000442
2016-05-09 14:52 okraits Note Added: 0000443
2016-05-09 14:53 okraits Note Edited: 0000443
2016-05-09 15:48 mohamed.kallel Note Added: 0000444
2016-05-09 17:44 mohamed.kallel Note Added: 0000445
2016-05-10 08:45 okraits Note Added: 0000446
2016-05-10 08:50 okraits Note Added: 0000447
2016-05-10 10:19 mohamed.kallel File Added: id_rsa.pub
2016-05-10 10:20 mohamed.kallel Note Added: 0000448
2016-05-10 10:25 mohamed.kallel Note Added: 0000449
2016-05-10 10:51 okraits Note Added: 0000450
2016-05-10 11:14 mohamed.kallel Note Added: 0000451
2016-05-10 11:16 mohamed.kallel Note Added: 0000452
2016-05-10 12:50 okraits Note Added: 0000453
2016-05-10 12:54 okraits Note Edited: 0000453
2016-05-10 13:02 mohamed.kallel Note Added: 0000454
2016-05-10 13:13 okraits Note Added: 0000455
2016-05-10 13:27 mohamed.kallel Note Added: 0000456
2016-05-10 13:27 okraits Note Added: 0000457
2016-05-10 13:46 okraits File Added: http.c
2016-05-10 13:48 okraits Note Added: 0000458
2016-05-10 14:03 okraits Note Added: 0000459
2016-05-10 15:00 mohamed.kallel Note Added: 0000460
2016-05-10 15:01 mohamed.kallel Note Added: 0000461
2016-05-10 15:04 okraits Note Added: 0000462
2016-05-11 13:02 mohamed.kallel Note Added: 0000470
2016-05-11 13:02 mohamed.kallel Status new => resolved
2016-05-11 13:02 mohamed.kallel Resolution open => fixed
2016-05-11 13:02 mohamed.kallel Assigned To => mohamed.kallel